diff options
author | Antonioya <blendergit@gmail.com> | 2018-09-30 12:46:47 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-09-30 12:49:02 +0300 |
commit | 4a724081247205f1ebe34b2cac35bdfc76512b67 (patch) | |
tree | cc17035c9ef99868bfbeec5371a5795d0cb34e88 /source | |
parent | f1afa6f6a71220fefcd3d967f261edd6ad93a43a (diff) |
GP: Do not use UI pixel scale for strokes
This scale value only must affect the interface, but never the stroke.
Diffstat (limited to 'source')
12 files changed, 9 insertions, 28 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index c7ca4349c0e..d42a0055be6 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -380,7 +380,6 @@ DRWShadingGroup *DRW_gpencil_shgroup_stroke_create( DRW_shgroup_uniform_vec2(grp, "Viewport", viewport_size, 1); DRW_shgroup_uniform_float(grp, "pixsize", stl->storage->pixsize, 1); - DRW_shgroup_uniform_float(grp, "pixelsize", &U.pixelsize, 1); /* avoid wrong values */ if ((gpd) && (gpd->pixfactor == 0)) { @@ -470,7 +469,6 @@ static DRWShadingGroup *DRW_gpencil_shgroup_point_create( DRW_shgroup_uniform_vec2(grp, "Viewport", viewport_size, 1); DRW_shgroup_uniform_float(grp, "pixsize", stl->storage->pixsize, 1); - DRW_shgroup_uniform_float(grp, "pixelsize", &U.pixelsize, 1); /* avoid wrong values */ if ((gpd) && (gpd->pixfactor == 0)) { diff --git a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c index 5a96d6d1275..49629c72444 100644 --- a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c +++ b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c @@ -220,7 +220,6 @@ static void DRW_gpencil_fx_blur( DRW_shgroup_uniform_vec3(fx_shgrp, "loc", &cache->loc[0], 1); DRW_shgroup_uniform_float(fx_shgrp, "pixsize", stl->storage->pixsize, 1); - DRW_shgroup_uniform_float(fx_shgrp, "pixelsize", &U.pixelsize, 1); DRW_shgroup_uniform_float(fx_shgrp, "pixfactor", &cache->pixfactor, 1); fxd->runtime.fx_sh = fx_shgrp; @@ -330,7 +329,6 @@ static void DRW_gpencil_fx_light( DRW_shgroup_uniform_float(fx_shgrp, "ambient", &fxd->ambient, 1); DRW_shgroup_uniform_float(fx_shgrp, "pixsize", stl->storage->pixsize, 1); - DRW_shgroup_uniform_float(fx_shgrp, "pixelsize", &U.pixelsize, 1); DRW_shgroup_uniform_float(fx_shgrp, "pixfactor", &cache->pixfactor, 1); fxd->runtime.fx_sh = fx_shgrp; @@ -363,7 +361,6 @@ static void DRW_gpencil_fx_pixel( DRW_shgroup_uniform_vec3(fx_shgrp, "loc", &cache->loc[0], 1); DRW_shgroup_uniform_float(fx_shgrp, "pixsize", stl->storage->pixsize, 1); - DRW_shgroup_uniform_float(fx_shgrp, "pixelsize", &U.pixelsize, 1); DRW_shgroup_uniform_float(fx_shgrp, "pixfactor", &gpd->pixfactor, 1); fxd->runtime.fx_sh = fx_shgrp; @@ -399,7 +396,6 @@ static void DRW_gpencil_fx_rim( DRW_shgroup_uniform_vec3(fx_shgrp, "loc", &cache->loc[0], 1); DRW_shgroup_uniform_float(fx_shgrp, "pixsize", stl->storage->pixsize, 1); - DRW_shgroup_uniform_float(fx_shgrp, "pixelsize", &U.pixelsize, 1); DRW_shgroup_uniform_float(fx_shgrp, "pixfactor", &cache->pixfactor, 1); fxd->runtime.fx_sh = fx_shgrp; @@ -415,7 +411,6 @@ static void DRW_gpencil_fx_rim( DRW_shgroup_uniform_vec3(fx_shgrp, "loc", &cache->loc[0], 1); DRW_shgroup_uniform_float(fx_shgrp, "pixsize", stl->storage->pixsize, 1); - DRW_shgroup_uniform_float(fx_shgrp, "pixelsize", &U.pixelsize, 1); DRW_shgroup_uniform_float(fx_shgrp, "pixfactor", &cache->pixfactor, 1); fxd->runtime.fx_sh_b = fx_shgrp; @@ -485,7 +480,6 @@ static void DRW_gpencil_fx_shadow( DRW_shgroup_uniform_float(fx_shgrp, "phase", &fxd->phase, 1); DRW_shgroup_uniform_float(fx_shgrp, "pixsize", stl->storage->pixsize, 1); - DRW_shgroup_uniform_float(fx_shgrp, "pixelsize", &U.pixelsize, 1); DRW_shgroup_uniform_float(fx_shgrp, "pixfactor", &cache->pixfactor, 1); fxd->runtime.fx_sh = fx_shgrp; @@ -537,7 +531,6 @@ static void DRW_gpencil_fx_swirl( DRW_shgroup_uniform_int(fx_shgrp, "transparent", &fxd->transparent, 1); DRW_shgroup_uniform_float(fx_shgrp, "pixsize", stl->storage->pixsize, 1); - DRW_shgroup_uniform_float(fx_shgrp, "pixelsize", &U.pixelsize, 1); DRW_shgroup_uniform_float(fx_shgrp, "pixfactor", &cache->pixfactor, 1); fxd->runtime.fx_sh = fx_shgrp; 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 1bf1d025430..3b2a4f6df66 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 @@ -8,10 +8,9 @@ uniform int blur[2]; uniform vec3 loc; uniform float pixsize; /* rv3d->pixsize */ -uniform float pixelsize; /* U.pixelsize */ uniform float pixfactor; -float defaultpixsize = pixsize * pixelsize * (1000.0 / pixfactor); +float defaultpixsize = pixsize * (1000.0 / pixfactor); vec2 noffset = vec2(blur[0], blur[1]); out vec4 FragColor; diff --git a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_light_frag.glsl b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_light_frag.glsl index 6dcd0499baf..c12dd223ebe 100644 --- a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_light_frag.glsl +++ b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_light_frag.glsl @@ -9,12 +9,11 @@ uniform float energy; uniform float ambient; uniform float pixsize; /* rv3d->pixsize */ -uniform float pixelsize; /* U.pixelsize */ uniform float pixfactor; out vec4 FragColor; -float defaultpixsize = pixsize * pixelsize * (1000.0 / pixfactor); +float defaultpixsize = pixsize * (1000.0 / pixfactor); #define height loc.w diff --git a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_pixel_frag.glsl b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_pixel_frag.glsl index 0b25dbbd012..eb5596c639a 100644 --- a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_pixel_frag.glsl +++ b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_pixel_frag.glsl @@ -9,13 +9,12 @@ uniform vec4 color; uniform vec3 loc; uniform float pixsize; /* rv3d->pixsize */ -uniform float pixelsize; /* U.pixelsize */ uniform float pixfactor; out vec4 FragColor; int uselines = size[2]; -float defaultpixsize = pixsize * pixelsize * (1000.0 / pixfactor); +float defaultpixsize = pixsize * (1000.0 / pixfactor); vec2 nsize = max(vec2(size[0], size[1]), 3.0); /* This pixelation shader is a modified version of original Geeks3d.com code */ diff --git a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_rim_prepare_frag.glsl b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_rim_prepare_frag.glsl index 6ea4faf11fd..2321429fbf1 100644 --- a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_rim_prepare_frag.glsl +++ b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_rim_prepare_frag.glsl @@ -14,10 +14,9 @@ uniform vec3 mask_color; uniform vec3 loc; uniform float pixsize; /* rv3d->pixsize */ -uniform float pixelsize; /* U.pixelsize */ uniform float pixfactor; -float defaultpixsize = pixsize * pixelsize * (1000.0 / pixfactor); +float defaultpixsize = pixsize * (1000.0 / pixfactor); vec2 noffset = vec2(offset[0], offset[1]); out vec4 FragColor; 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 941b746d494..873f70eb1ab 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 @@ -20,7 +20,6 @@ uniform int orientation; uniform vec3 loc; uniform float pixsize; /* rv3d->pixsize */ -uniform float pixelsize; /* U.pixelsize */ uniform float pixfactor; #define M_PI 3.1415926535897932384626433832795 @@ -28,7 +27,7 @@ uniform float pixfactor; #define HORIZONTAL 0 #define VERTICAL 1 -float defaultpixsize = pixsize * pixelsize * (1000.0 / pixfactor); +float defaultpixsize = pixsize * (1000.0 / pixfactor); vec2 noffset = vec2(offset[0], offset[1]); out vec4 FragColor; 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 78aacafdcb7..92485987c93 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 @@ -11,12 +11,11 @@ uniform float angle; uniform int transparent; uniform float pixsize; /* rv3d->pixsize */ -uniform float pixelsize; /* U.pixelsize */ uniform float pixfactor; out vec4 FragColor; -float defaultpixsize = pixsize * pixelsize * (1000.0 / pixfactor); +float defaultpixsize = pixsize * (1000.0 / pixfactor); /* project 3d point to 2d on screen space */ vec2 toScreenSpace(vec4 vertex) diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_point_vert.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_point_vert.glsl index 5e89bf8e5ce..f870bfbb48d 100644 --- a/source/blender/draw/engines/gpencil/shaders/gpencil_point_vert.glsl +++ b/source/blender/draw/engines/gpencil/shaders/gpencil_point_vert.glsl @@ -2,7 +2,6 @@ uniform mat4 ModelViewProjectionMatrix; uniform mat4 ProjectionMatrix; uniform float pixsize; /* rv3d->pixsize */ -uniform float pixelsize; /* U.pixelsize */ uniform int keep_size; uniform float objscale; uniform float pixfactor; @@ -18,7 +17,7 @@ out vec2 finaluvdata; #define TRUE 1 -float defaultpixsize = pixsize * pixelsize * (1000.0 / pixfactor); +float defaultpixsize = pixsize * (1000.0 / pixfactor); void main() { diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_vert.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_vert.glsl index 2f9a105e911..121e244ac8a 100644 --- a/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_vert.glsl +++ b/source/blender/draw/engines/gpencil/shaders/gpencil_stroke_vert.glsl @@ -2,7 +2,6 @@ uniform mat4 ModelViewProjectionMatrix; uniform mat4 ProjectionMatrix; uniform float pixsize; /* rv3d->pixsize */ -uniform float pixelsize; /* U.pixelsize */ uniform int keep_size; uniform float objscale; uniform float pixfactor; @@ -18,7 +17,7 @@ out vec2 finaluvdata; #define TRUE 1 -float defaultpixsize = pixsize * pixelsize * (1000.0 / pixfactor); +float defaultpixsize = pixsize * (1000.0 / pixfactor); void main(void) { diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 3bb770a6c69..be630d98ff1 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -743,7 +743,6 @@ static void gp_draw_stroke_3d(tGPDdraw *tgpw, short thickness, const float ink[4 immBindBuiltinProgram(GPU_SHADER_GPENCIL_STROKE); immUniform2fv("Viewport", viewport); immUniform1f("pixsize", tgpw->rv3d->pixsize); - immUniform1f("pixelsize", U.pixelsize); float obj_scale = (tgpw->ob->size[0] + tgpw->ob->size[1] + tgpw->ob->size[2]) / 3.0f; immUniform1f("objscale", obj_scale); diff --git a/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_vert.glsl b/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_vert.glsl index 5f4f56dcca1..5cbe2f60ebd 100644 --- a/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_vert.glsl @@ -2,7 +2,6 @@ uniform mat4 ModelViewProjectionMatrix; uniform mat4 ProjectionMatrix; uniform float pixsize; /* rv3d->pixsize */ -uniform float pixelsize; /* U.pixelsize */ uniform int keep_size; uniform float objscale; uniform int pixfactor; @@ -16,7 +15,7 @@ out float finalThickness; #define TRUE 1 -float defaultpixsize = pixsize * pixelsize * (1000.0 / pixfactor); +float defaultpixsize = pixsize * (1000.0 / pixfactor); void main(void) { |