[Bf-blender-cvs] [9f7f310e256] greasepencil-object: Fix z-depth problems in wave modifier
Antonio Vazquez
noreply at git.blender.org
Tue Aug 8 11:19:22 CEST 2017
Commit: 9f7f310e256a0f88ec14636efa5402d8a5021b43
Author: Antonio Vazquez
Date: Mon Aug 7 13:14:51 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB9f7f310e256a0f88ec14636efa5402d8a5021b43
Fix z-depth problems in wave modifier
===================================================================
M source/blender/draw/engines/gpencil/shaders/gpencil_wave_frag.glsl
===================================================================
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_wave_frag.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_wave_frag.glsl
index 635bb027ca2..882b2cf59f1 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_wave_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_wave_frag.glsl
@@ -19,20 +19,22 @@ void main()
{
vec4 outcolor;
ivec2 uv = ivec2(gl_FragCoord.xy);
- float stroke_depth = texelFetch(strokeDepth, uv, 0).r;
- gl_FragDepth = stroke_depth;
+ float stroke_depth;
float value;
if (orientation == HORIZONTAL) {
float pval = (uv.x * M_PI) / wsize[0];
value = amplitude * sin((period * pval) + phase);
outcolor = texelFetch(strokeColor, ivec2(uv.x, uv.y + value), 0);
+ stroke_depth = texelFetch(strokeDepth, ivec2(uv.x, uv.y + value), 0).r;
}
else {
float pval = (uv.y * M_PI) / wsize[1];
value = amplitude * sin((period * pval) + phase);
outcolor = texelFetch(strokeColor, ivec2(uv.x + value, uv.y), 0);
+ stroke_depth = texelFetch(strokeDepth, ivec2(uv.x + value, uv.y), 0).r;
}
FragColor = outcolor;
+ gl_FragDepth = stroke_depth;
}
More information about the Bf-blender-cvs
mailing list