[Bf-blender-cvs] [7280d9d1e41] master: DRW: Increase weight paint wire depth bias

Campbell Barton noreply at git.blender.org
Thu Feb 14 05:24:50 CET 2019


Commit: 7280d9d1e41df9596608af77dc206573ed2d3e7a
Author: Campbell Barton
Date:   Thu Feb 14 13:50:15 2019 +1100
Branches: master
https://developer.blender.org/rB7280d9d1e41df9596608af77dc206573ed2d3e7a

DRW: Increase weight paint wire depth bias

By default wire would z-fight against the surface.
Increase the bias, also don't adjust the 'w' component
since it causes bias that depends on the view direction.

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

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

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

diff --git a/source/blender/draw/modes/shaders/paint_wire_vert.glsl b/source/blender/draw/modes/shaders/paint_wire_vert.glsl
index 7acd4fa6c1f..64b58fb3673 100644
--- a/source/blender/draw/modes/shaders/paint_wire_vert.glsl
+++ b/source/blender/draw/modes/shaders/paint_wire_vert.glsl
@@ -19,7 +19,7 @@ void main()
 	gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
 	/* Add offset in Z to avoid zfighting and render selected wires on top. */
 	/* TODO scale this bias using znear and zfar range. */
-	gl_Position.zw -= exp2(-20.0) * (is_select ? 2.0 : 1.0);
+	gl_Position.z -= (is_select ? 2e-4 : 1e-4);
 
 	if (is_hidden) {
 		gl_Position = vec4(-2.0, -2.0, -2.0, 1.0);



More information about the Bf-blender-cvs mailing list