[Bf-blender-cvs] [9be138bf639] master: Fix empty image wire drawing with front/back depth

Campbell Barton noreply at git.blender.org
Tue Sep 3 11:16:54 CEST 2019


Commit: 9be138bf639644230116caf8098d60d2d24a4dee
Author: Campbell Barton
Date:   Tue Sep 3 19:13:25 2019 +1000
Branches: master
https://developer.blender.org/rB9be138bf639644230116caf8098d60d2d24a4dee

Fix empty image wire drawing with front/back depth

The vertex shaders depth offset was ignored in this case.

===================================================================

M	source/blender/draw/modes/shaders/object_empty_image_frag.glsl

===================================================================

diff --git a/source/blender/draw/modes/shaders/object_empty_image_frag.glsl b/source/blender/draw/modes/shaders/object_empty_image_frag.glsl
index 7dfbf469adc..e33aa6cdcc1 100644
--- a/source/blender/draw/modes/shaders/object_empty_image_frag.glsl
+++ b/source/blender/draw/modes/shaders/object_empty_image_frag.glsl
@@ -37,9 +37,15 @@ void main()
 
   if (depthMode == DEPTH_BACK) {
     gl_FragDepth = 0.999999;
+#ifdef USE_WIRE
+    gl_FragDepth -= 1e-5;
+#endif
   }
   else if (depthMode == DEPTH_FRONT) {
     gl_FragDepth = 0.000001;
+#ifdef USE_WIRE
+    gl_FragDepth -= 1e-5;
+#endif
   }
   else if (depthMode == DEPTH_UNCHANGED) {
     gl_FragDepth = gl_FragCoord.z;



More information about the Bf-blender-cvs mailing list