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>2018-08-06 17:11:31 +0300
committerAntonioya <blendergit@gmail.com>2018-08-06 17:11:53 +0300
commitd07a408a400e25e2e60131bf56065901d63e728c (patch)
tree389037585fcc8aa29a0c2a884c769f2757abfd48 /source/blender/draw/engines/gpencil/shaders
parentd890ad37a8268d31f3f79443b6c3b4a3c6a8b10e (diff)
GP: Fix Front z-depth display precision
The zdepth 0 was clipped and need 0.000001
Diffstat (limited to 'source/blender/draw/engines/gpencil/shaders')
-rw-r--r--source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl9
-rw-r--r--source/blender/draw/engines/gpencil/shaders/gpencil_point_geom.glsl4
-rw-r--r--source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl4
3 files changed, 10 insertions, 7 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 35f47d6c418..d2cad4e44f7 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
@@ -129,12 +129,15 @@ void main()
/* set zdepth */
if (xraymode == GP_XRAY_FRONT) {
- gl_FragDepth = 0.0;
+ gl_FragDepth = 0.000001;
}
- if (xraymode == GP_XRAY_3DSPACE) {
+ else if (xraymode == GP_XRAY_3DSPACE) {
gl_FragDepth = gl_FragCoord.z;
}
- if (xraymode == GP_XRAY_BACK) {
+ else if (xraymode == GP_XRAY_BACK) {
gl_FragDepth = 0.999999;
}
+ else {
+ gl_FragDepth = 0.000001;
+ }
}
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 f092149430c..63f22e0f812 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_point_geom.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_point_geom.glsl
@@ -26,7 +26,7 @@ vec2 toScreenSpace(vec4 vertex)
float getZdepth(vec4 point)
{
if (xraymode == GP_XRAY_FRONT) {
- return 0.0;
+ return 0.000001;
}
if (xraymode == GP_XRAY_3DSPACE) {
return (point.z / point.w);
@@ -36,7 +36,7 @@ float getZdepth(vec4 point)
}
/* in front by default */
- return 0.0;
+ return 0.000001;
}
vec2 rotateUV(vec2 uv, float angle)
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 0bcfe8cddb7..f9054b44996 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_geom.glsl
@@ -33,7 +33,7 @@ vec2 toScreenSpace(vec4 vertex)
float getZdepth(vec4 point)
{
if (xraymode == GP_XRAY_FRONT) {
- return 0.0;
+ return 0.000001;
}
if (xraymode == GP_XRAY_3DSPACE) {
return (point.z / point.w);
@@ -43,7 +43,7 @@ float getZdepth(vec4 point)
}
/* in front by default */
- return 0.0;
+ return 0.000001;
}
void main(void)
{