diff options
author | Antonioya <blendergit@gmail.com> | 2018-10-16 11:23:13 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-10-16 11:23:13 +0300 |
commit | 0b5786e96c9f967b4e28a36974fd0400c06b7ab4 (patch) | |
tree | 3c05e2a5532aee1a133ec9d551f4b58f5b08ab8b /source/blender/draw | |
parent | 88f392f045bd7f4ff04e4d122afa69b522972135 (diff) |
GP: Fix Blur shift when add more samples
The image was moving in +X and +Y when added samples due round precission.
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_blur_frag.glsl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_blur_frag.glsl b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_blur_frag.glsl index 45f142254d7..027048e3f5f 100644 --- a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_blur_frag.glsl +++ b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_blur_frag.glsl @@ -39,6 +39,10 @@ void main() float dx = (ProjectionMatrix[3][3] == 0.0) ? (noffset[0] / (nloc.z * defaultpixsize)) : (noffset[0] / defaultpixsize); float dy = (ProjectionMatrix[3][3] == 0.0) ? (noffset[1] / (nloc.z * defaultpixsize)) : (noffset[1] / defaultpixsize); + /* round to avoid shift when add more samples */ + dx = floor(dx) + 1.0; + dy = floor(dy) + 1.0; + /* apply blurring, using a 9-tap filter with predefined gaussian weights */ /* depth (get the value of the surrounding pixels) */ float outdepth = 0.0; |