diff options
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl b/source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl index 3761bf350eb..9035a311ecb 100644 --- a/source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl @@ -2,7 +2,13 @@ * This fragment shader was initially found at http://fabiensanglard.net/shadowmappingVSM/index.php */ -varying vec4 v_position; +#if __VERSION__ == 120 + varying vec4 v_position; + #define fragColor gl_FragColor +#else + in vec4 v_position; + out vec4 fragColor; +#endif void main() { @@ -17,5 +23,6 @@ void main() float dy = dFdy(depth); moment2 += 0.25 * (dx * dx + dy * dy); - gl_FragColor = vec4(moment1, moment2, 0.0, 0.0); + fragColor = vec4(moment1, moment2, 0.0, 0.0); + // TODO: write to a 2-component target --^ } |