[SOLVED] CS代考计算机代写 // Pass 2 fragment shader

30 $

File Name: CS代考计算机代写_//_Pass_2_fragment_shader.zip
File Size: 461.58 KB

SKU: 1262389326 Category: Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Or Upload Your Assignment Here:


// Pass 2 fragment shader
//
// Outputs the Laplacian, computed from depth buffer

#version 300 es

// texCoordInc = the x and y differences, in texture coordinates,
// between one texel and the next.For a window that is 400×300, for
// example, texCoordInc would be (1/400,1/300).

uniform mediump vec2 texCoordInc;

// texCoords = the texture coordinates at this fragment

in mediump vec2 texCoords;

// depthSampler = texture sampler for the depths.

uniform mediump sampler2D depthSampler;

// fragLaplacian = an RGB value that is output from this shader.All
// three components should be identical.This RGB value will be
// stored in the Laplacian texture.

layout (location = 0) out mediump vec3 fragLaplacian;

void main()

{
mediump vec2 dummy = texCoords;// REMOVE THIS … It’s just here because MacOS complains otherwise

// YOUR CODE HERE.You will have to compute the Laplacian by
// evaluating a 3×3 filter kernel at the current texture
// coordinates.The Laplacian weights of the 3×3 kernel are
//
//-1-1-1
//-1 8-1
//-1-1-1
//
// Store a signed value for the Laplacian; do not take its absolute
// value.

fragLaplacian = vec3( 0.1, 0.2, 0.3 );
}

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CS代考计算机代写 // Pass 2 fragment shader
30 $