[Bf-blender-cvs] [53ed2705232] blender2.8: Fix T56298: Rendering glitch when bones are in stick mode in ortho view

Clément Foucault noreply at git.blender.org
Mon Aug 13 23:02:41 CEST 2018


Commit: 53ed27052327ee8295380409ac6473f9114d44b1
Author: Clément Foucault
Date:   Mon Aug 13 21:51:41 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB53ed27052327ee8295380409ac6473f9114d44b1

Fix T56298: Rendering glitch when bones are in stick mode in ortho view

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

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

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

diff --git a/source/blender/draw/modes/shaders/armature_stick_vert.glsl b/source/blender/draw/modes/shaders/armature_stick_vert.glsl
index eb14239bc6f..1dbc8e161c2 100644
--- a/source/blender/draw/modes/shaders/armature_stick_vert.glsl
+++ b/source/blender/draw/modes/shaders/armature_stick_vert.glsl
@@ -54,7 +54,7 @@ void main()
 
 	/* Clip the bone to the camera origin plane (not the clip plane)
 	 * to avoid glitches if one end is behind the camera origin (in persp). */
-	const float clip_dist = -1e-7; /* hardcoded, -1e-8 is giving gliches. */
+	float clip_dist = (ProjectionMatrix[3][3] == 0.0) ? -1e-7 : 1e20; /* hardcoded, -1e-8 is giving gliches. */
 	vec3 bvec = v1.xyz - v0.xyz;
 	vec3 clip_pt = v0.xyz + bvec * ((v0.z - clip_dist) / -bvec.z);
 	if (v0.z > clip_dist) {



More information about the Bf-blender-cvs mailing list