2017-10-04 17:37:55 +02:00
|
|
|
#version 450 core
|
|
|
|
|
|
|
|
//! type fragment
|
|
|
|
//! include dof-common.l.glsl
|
|
|
|
|
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 );
|
|
|
|
}
|