Emmanuel BENOîT
68d01ca42e
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.
20 lines
478 B
GLSL
20 lines
478 B
GLSL
#version 450 core
|
|
|
|
//! type fragment
|
|
//! include dof.glsl
|
|
|
|
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 = DOF_Blur( z , DOF_CoC( z ) , uv , blurvec );
|
|
|
|
blurdir.x = -1;
|
|
blurvec = normalize( blurdir ) / uResolution;
|
|
vec3 color1 = DOF_Blur( z , DOF_CoC( z ) , uv , blurvec );
|
|
|
|
o_Color = min( color0 , color1 );
|
|
}
|