Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/draw/engines/gpencil/shaders/gpencil_depth_merge_frag.glsl')
-rw-r--r--source/blender/draw/engines/gpencil/shaders/gpencil_depth_merge_frag.glsl17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_depth_merge_frag.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_depth_merge_frag.glsl
new file mode 100644
index 00000000000..71597197bd8
--- /dev/null
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_depth_merge_frag.glsl
@@ -0,0 +1,17 @@
+
+uniform sampler2D depthBuf;
+uniform float strokeDepth2d;
+uniform bool strokeOrder3d;
+
+noperspective in vec4 uvcoordsvar;
+
+void main()
+{
+ float depth = textureLod(depthBuf, uvcoordsvar.xy, 0).r;
+ if (strokeOrder3d) {
+ gl_FragDepth = depth;
+ }
+ else {
+ gl_FragDepth = (depth != 0.0) ? gl_FragCoord.z : 1.0;
+ }
+}