Fixed the issue that an object disappeared in a multi-material painting gizmo when the object was almost completely sunk under the bed.

Object disappearance was caused by calling glPolygonOffset for rendered triangles in the multi-material painting gizmo to resolve z-fighting between painted triangles and contours around selected areas using seed/bucket fill.
This commit is contained in:
Lukáš Hejl 2021-08-26 12:04:57 +02:00
parent af413e37bb
commit 95e4ab9460
2 changed files with 9 additions and 4 deletions

View file

@ -1,6 +1,11 @@
#version 110
const float EPSILON = 0.0001;
void main()
{
gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
// Values inside depth buffer for fragments of the contour of a selected area are offset
// by small epsilon to solve z-fighting between painted triangles and contour lines.
gl_FragDepth = gl_FragCoord.z - EPSILON;
}