2017-12-25 18:41:16 +01:00
|
|
|
#version 450 core
|
|
|
|
|
|
|
|
//! type compute
|
2017-12-25 20:39:56 +01:00
|
|
|
|
|
|
|
layout(
|
|
|
|
local_size_x = 8 ,
|
|
|
|
local_size_y = 20
|
|
|
|
) in;
|
|
|
|
|
2017-12-25 18:41:16 +01:00
|
|
|
//! include chunks/dof-cs.glsl
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
ivec2 coords = ivec2( gl_GlobalInvocationID.xy );
|
|
|
|
vec2 uv = vec2( coords ) / uResolution;
|
|
|
|
float z = textureLod( u_Input , uv , 0 ).w;
|
|
|
|
|
|
|
|
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 );
|
|
|
|
|
|
|
|
imageStore( u_Output , coords , vec4( min( color0 , color1 ) , 1. ) );
|
|
|
|
}
|