Fix T63846: In Orthographic View, unconfirmed Grease Pencil strokes do not appear in front of Reference Images

In orthographic, the z-depth was wrong.
This commit is contained in:
2019-04-25 17:11:58 +02:00
parent dedd3338d6
commit c04dcde0ba
3 changed files with 3 additions and 3 deletions

View File

@@ -177,7 +177,7 @@ void main()
/* set zdepth */
if (xraymode == GP_XRAY_FRONT) {
gl_FragDepth = 0.000001;
gl_FragDepth = min(0.000001, (gl_FragCoord.z / gl_FragCoord.w));
}
else if (xraymode == GP_XRAY_3DSPACE) {
/* if 3D mode, move slightly the fill to avoid z-fighting between stroke and fill on same stroke */

View File

@@ -31,7 +31,7 @@ vec2 toScreenSpace(vec4 vertex)
float getZdepth(vec4 point)
{
if (xraymode == GP_XRAY_FRONT) {
return 0.000001;
return min(0.000001, (point.z / point.w));
}
if (xraymode == GP_XRAY_3DSPACE) {
return (point.z / point.w);

View File

@@ -35,7 +35,7 @@ vec2 toScreenSpace(vec4 vertex)
float getZdepth(vec4 point)
{
if (xraymode == GP_XRAY_FRONT) {
return 0.000001;
return min(0.000001, (point.z / point.w));
}
if (xraymode == GP_XRAY_3DSPACE) {
return (point.z / point.w);