diff options
Diffstat (limited to 'source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_shadow_prepare_frag.glsl')
-rw-r--r-- | source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_shadow_prepare_frag.glsl | 10 |
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; |