demotool/dof-pass2.glsl

16 lines
435 B
Text
Raw Normal View History

2017-10-01 18:51:02 +02:00
void main()
{
vec2 uv = gl_FragCoord.xy / uResolution;
float z = texture( u_Depth , uv ).x;
vec2 blurdir = vec2( 1.0 , 0.577350269189626 );
vec2 blurvec = normalize( blurdir ) / uResolution;
vec3 color0 = depthDirectionalBlur( z , CoC( z ) , uv , blurvec );
blurdir.x = -1;
blurvec = normalize( blurdir ) / uResolution;
vec3 color1 = depthDirectionalBlur( z , CoC( z ) , uv , blurvec );
o_Color = min( color0 , color1 );
}