demotool/shaders/dof-pass2.f.glsl

21 lines
485 B
Text
Raw Normal View History

2017-10-04 17:37:55 +02:00
#version 450 core
//! type fragment
2017-10-04 19:06:50 +02:00
//! include chunks/dof.glsl
2017-10-04 17:37:55 +02:00
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;
2017-10-04 18:40:15 +02:00
vec3 color0 = DOF_Blur( z , DOF_CoC( z ) , uv , blurvec );
2017-10-01 18:51:02 +02:00
blurdir.x = -1;
blurvec = normalize( blurdir ) / uResolution;
2017-10-04 18:40:15 +02:00
vec3 color1 = DOF_Blur( z , DOF_CoC( z ) , uv , blurvec );
2017-10-01 18:51:02 +02:00
o_Color = min( color0 , color1 );
}