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-27 20:27:20 +0300
committerAntonioya <blendergit@gmail.com>2019-04-27 20:27:20 +0300
commit6cb90d180f405e010f4588ec3cfe031f8dbac6cf (patch)
treef451ab5b9962b06c1850e338d02dd4f4dfcb4e57
parent19ebee657e965c5aad627156afa3ce62e47a3379 (diff)
Fix T63937: unconfirmed grease pencil strokes not visible in ortho suface
The value of the z-depth was too high. Now the value is valid for perspective and orthographic view.
-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 68671a00337..16ec0ee9374 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 = min(0.000001, (gl_FragCoord.z / gl_FragCoord.w));
+ gl_FragDepth = min(-0.05, (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 a80598d9b63..a64a7ecb9be 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 min(0.000001, (point.z / point.w));
+ return min(-0.05, (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 20b066019c8..b90f5b33a57 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 min(0.000001, (point.z / point.w));
+ return min(-0.05, (point.z / point.w));
}
if (xraymode == GP_XRAY_3DSPACE) {
return (point.z / point.w);