demotool/test/fx-dof/dof-pass1.c.glsl
Emmanuel BENOîT 68d01ca42e Shaders - Relative paths
Shaders are no longer found under /shaders in the project; they can be
anywhere. In addition, paths for both (program) instructions in the
script and include directives in shader source code are relative to the
file which contains them.
2017-12-29 11:33:15 +01:00

21 lines
420 B
GLSL

#version 450 core
//! type compute
layout(
local_size_x = 8 ,
local_size_y = 64
) in;
//! include dof-cs.glsl
void main()
{
ivec2 coords = ivec2( gl_GlobalInvocationID.xy );
vec2 uv = vec2( coords ) / uResolution;
vec2 blurvec = vec2( 0 , 1 ) / uResolution;
float z = textureLod( u_Input , uv , 0 ).w;
vec3 c = DOF_Blur( z , DOF_CoC( z ) , uv , blurvec );
imageStore( u_Output , coords , vec4( c , z ) );
}