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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user