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:
Diffstat (limited to 'source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_swirl_frag.glsl')
-rw-r--r--source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_swirl_frag.glsl6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_swirl_frag.glsl b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_swirl_frag.glsl
index b226d4f93bc..01d4fe40195 100644
--- a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_swirl_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_swirl_frag.glsl
@@ -42,7 +42,11 @@ void main()
vec2 tc = uv - center;
float dist = length(tc);
- float pxradius = (ProjectionMatrix[3][3] == 0.0) ? (radius / (loc.z * defaultpixsize)) :
+ float locpixsize = abs((loc.z * defaultpixsize));
+ if (locpixsize == 0) {
+ locpixsize = 1;
+ }
+ float pxradius = (ProjectionMatrix[3][3] == 0.0) ? (radius / locpixsize) :
(radius / defaultpixsize);
pxradius = max(pxradius, 1);