diff options
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_fx_dof_hq_geo.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_fx_dof_hq_geo.glsl | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_fx_dof_hq_geo.glsl b/source/blender/gpu/shaders/gpu_shader_fx_dof_hq_geo.glsl index 4c650e7695f..52d0a9be499 100644 --- a/source/blender/gpu/shaders/gpu_shader_fx_dof_hq_geo.glsl +++ b/source/blender/gpu/shaders/gpu_shader_fx_dof_hq_geo.glsl @@ -5,27 +5,14 @@ uniform vec2 layerselection; uniform sampler2D cocbuffer; -#if __VERSION__ >= 150 - layout(points) in; - layout(triangle_strip, max_vertices = 4) out; - - #define POS gl_in[0].gl_Position -#else - /* use the EXT_geometry_shader4 way */ - #define POS gl_PositionIn[0] -#endif - -/* initial uv coordinate */ -#if __VERSION__ < 130 - varying in vec2 uvcoord[]; - varying out vec2 particlecoord; - varying out vec4 color; - #define textureLod texture2DLod -#else - in vec2 uvcoord[]; - out vec2 particlecoord; - out vec4 color; -#endif +layout(points) in; +layout(triangle_strip, max_vertices = 4) out; + +#define POS gl_in[0].gl_Position + +in vec2 uvcoord[]; +out vec2 particlecoord; +flat out vec4 color; #define M_PI 3.1415926535897932384626433832795 @@ -46,21 +33,23 @@ void main() vec2 offset_far = vec2(offset_val * 0.5) / vec2(rendertargetdim.x, rendertargetdim.y); - gl_Position = POS + vec4(-offset_far.x, -offset_far.y, 0.0, 0.0); color = colortex; + + gl_Position = POS + vec4(-offset_far.x, -offset_far.y, 0.0, 0.0); particlecoord = vec2(-1.0, -1.0); EmitVertex(); + gl_Position = POS + vec4(-offset_far.x, offset_far.y, 0.0, 0.0); particlecoord = vec2(-1.0, 1.0); - color = colortex; EmitVertex(); + gl_Position = POS + vec4(offset_far.x, -offset_far.y, 0.0, 0.0); particlecoord = vec2(1.0, -1.0); - color = colortex; EmitVertex(); + gl_Position = POS + vec4(offset_far.x, offset_far.y, 0.0, 0.0); particlecoord = vec2(1.0, 1.0); - color = colortex; EmitVertex(); + EndPrimitive(); } |