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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-01-02 20:18:11 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-01-02 20:18:11 +0300
commitf8ce4ebf073cec4224a29c3ac9d3961814f93c4d (patch)
treeb7384a4aa60d011e45ba34bd093ca439b5fc4b78 /source/blender/draw/engines/gpencil/gpencil_shader_fx.c
parentf694d3792941ce24092865cffb038aa0e5cc08f2 (diff)
Fix wrong grease pencil shader FX usage of object location.
It should use the evaluated object location, and not add any unnecessary dependency on geometry data.
Diffstat (limited to 'source/blender/draw/engines/gpencil/gpencil_shader_fx.c')
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_shader_fx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c
index 225dc1a58d7..db080b0626b 100644
--- a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c
+++ b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c
@@ -310,7 +310,7 @@ static void DRW_gpencil_fx_light(
DRW_shgroup_uniform_vec2(fx_shgrp, "Viewport", DRW_viewport_size_get(), 1);
/* location of the light using obj location as origin */
- copy_v3_v3(fxd->loc, &fxd->object->loc[0]);
+ copy_v3_v3(fxd->loc, fxd->object->obmat[3]);
/* Calc distance to strokes plane
* The w component of location is used to transfer the distance to drawing plane
@@ -323,7 +323,7 @@ static void DRW_gpencil_fx_light(
}
mul_mat3_m4_v3(cache->obmat, r_normal); /* only rotation component */
plane_from_point_normal_v3(r_plane, r_point, r_normal);
- float dt = dist_to_plane_v3(fxd->object->loc, r_plane);
+ float dt = dist_to_plane_v3(fxd->object->obmat[3], r_plane);
fxd->loc[3] = dt; /* use last element to save it */
DRW_shgroup_uniform_vec4(fx_shgrp, "loc", &fxd->loc[0], 1);
@@ -469,7 +469,7 @@ static void DRW_gpencil_fx_shadow(
DRW_shgroup_uniform_vec4(fx_shgrp, "shadow_color", &fxd->shadow_rgba[0], 1);
if ((fxd->object) && (fxd->flag & FX_SHADOW_USE_OBJECT)) {
- DRW_shgroup_uniform_vec3(fx_shgrp, "loc", &fxd->object->loc[0], 1);
+ DRW_shgroup_uniform_vec3(fx_shgrp, "loc", fxd->object->obmat[3], 1);
}
else {
DRW_shgroup_uniform_vec3(fx_shgrp, "loc", &cache->loc[0], 1);
@@ -609,7 +609,7 @@ static void DRW_gpencil_fx_swirl(
DRW_shgroup_uniform_vec2(fx_shgrp, "Viewport", DRW_viewport_size_get(), 1);
- DRW_shgroup_uniform_vec3(fx_shgrp, "loc", &fxd->object->loc[0], 1);
+ DRW_shgroup_uniform_vec3(fx_shgrp, "loc", fxd->object->obmat[3], 1);
DRW_shgroup_uniform_int(fx_shgrp, "radius", &fxd->radius, 1);
DRW_shgroup_uniform_float(fx_shgrp, "angle", &fxd->angle, 1);