Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2019-04-25 18:11:58 +0300
committerAntonioya <blendergit@gmail.com>2019-04-25 18:11:58 +0300
commitc04dcde0ba9f15cd15d14514e47c1dc3c003315e (patch)
treeab12ed6e5e56b20bf616d8e5107b4fe562e9d197 /source/blender/draw/engines
parentdedd3338d603da94ab5ff4bcbd1f1a4b063f263a (diff)
Fix T63846: In Orthographic View, unconfirmed Grease Pencil strokes do not appear in front of Reference Images
In orthographic, the z-depth was wrong.
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r--source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl2
-rw-r--r--source/blender/draw/engines/gpencil/shaders/gpencil_point_geom.glsl2
-rw-r--r--source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl2
3 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
index 632c63a39aa..68671a00337 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
@@ -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 */
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_point_geom.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_point_geom.glsl
index 2fb48ac5147..a80598d9b63 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_point_geom.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_point_geom.glsl
@@ -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);
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
index 7e62d6f0d64..20b066019c8 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
@@ -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);