Emmanuel BENOîT
c3ccc9403a
It doesn't work too well, however. Other algorithms need to be checked out.
15 lines
372 B
GLSL
15 lines
372 B
GLSL
#version 450 core
|
|
|
|
//! type compute
|
|
//! include chunks/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 ) );
|
|
}
|