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-10-01 12:36:06 +0300
committerAntonioya <blendergit@gmail.com>2018-10-01 12:36:18 +0300
commitbe0e58d980d963c60869c412ada86641baaa2e48 (patch)
tree70299aa9d9970fd5c5087b4021cb779f23c209ee /source/blender/draw/engines/gpencil/shaders
parent534009098ea094aa1f3b5298101e5d9e0a3cb1dc (diff)
GP: Fix Shadow rotation bug
Diffstat (limited to 'source/blender/draw/engines/gpencil/shaders')
-rw-r--r--source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_shadow_prepare_frag.glsl10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_shadow_prepare_frag.glsl b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_shadow_prepare_frag.glsl
index e2bd725ec0d..d5384900b0a 100644
--- a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_shadow_prepare_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_shadow_prepare_frag.glsl
@@ -60,6 +60,12 @@ void main()
/* move point to new coords system */
vec2 tpos = vec2(uv.x, uv.y) - loc2d;
+ /* rotation */
+ if (rotation != 0) {
+ vec2 rotpoint = vec2((tpos.x * cosv) - (tpos.y * sinv), (tpos.x * sinv) + (tpos.y * cosv));
+ tpos = rotpoint;
+ }
+
/* apply offset */
tpos = vec2(tpos.x - dx, tpos.y - dy);
@@ -67,10 +73,6 @@ void main()
tpos.x *= 1.0 / scale[0];
tpos.y *= 1.0 / scale[1];
- /* rotation */
- tpos.x = (tpos.x * cosv) - (tpos.y * sinv);
- tpos.y = (tpos.x * sinv) + (tpos.y * cosv);
-
/* back to original coords system */
vec2 texpos = tpos + loc2d;