[Bf-blender-cvs] [7615498] master: Alleviate somewhat the issue of T44505

Antony Riakiotakis noreply at git.blender.org
Tue Apr 28 17:18:45 CEST 2015


Commit: 7615498e6dfe2902e265f49c2d1605fe81dcf99c
Author: Antony Riakiotakis
Date:   Tue Apr 28 17:18:32 2015 +0200
Branches: master
https://developer.blender.org/rB7615498e6dfe2902e265f49c2d1605fe81dcf99c

Alleviate somewhat the issue of T44505

Issue is zfighting with wire of mesh when parts of the mesh are close
together. We can make this slightly better by reducing the offset,
however this offset is calculated pre-perspective division and can vary
greatly with distance. Correct approach would be using polygon offset,
however we draw mesh wireframes as lines, (not polygons with polygon
mode line) so this approach will not work.
Alternatively, we could set an offset in a shader, however we don't have
code for that either.

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

M	source/blender/editors/screen/glutil.c

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

diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c
index 6001534..618d690 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -1008,7 +1008,7 @@ void bglPolygonOffset(float viewdist, float dist)
 		/* dist is from camera to center point */
 		
 		if (winmat[15] > 0.5f) offs = 0.00001f * dist * viewdist;  // ortho tweaking
-		else offs = 0.0005f * dist;  // should be clipping value or so...
+		else offs = 0.0001f * dist;  // should be clipping value or so...
 		
 		winmat[14] -= offs;
 		offset += offs;




More information about the Bf-blender-cvs mailing list