diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2014-01-23 13:20:42 +0400 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2014-01-23 13:20:42 +0400 |
commit | 6c1c6f22cea9729c40e02ed45374bad31fbca6dd (patch) | |
tree | c6433821f7ac73cd3f757d2de09afc1db00360ab /source/blender/gpu/intern/gpu_material.c | |
parent | 1713db203583a1b93143b14dfa77eb447697deac (diff) |
Removed the omat matrix from DupliObject.
This was storing the original object matrix, which builds on the
assumption that obmat is modified during dupli construction, which is a
bad hack.
Now the obmats are still modified, but this only happens outside of the
dupli system itself and the original ("omat") is stored as local
variables in the same place where the obmat manipulation takes place.
This is easier to follow and avoids hidden hacks as much as possible.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D254
Diffstat (limited to 'source/blender/gpu/intern/gpu_material.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index a425153f403..7c67e615217 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -859,11 +859,15 @@ static void material_lights(GPUShadeInput *shi, GPUShadeResult *shr) Object *ob_iter = dob->ob; if (ob_iter->type==OB_LAMP) { + float omat[4][4]; + copy_m4_m4(omat, ob_iter->obmat); copy_m4_m4(ob_iter->obmat, dob->mat); lamp = GPU_lamp_from_blender(shi->gpumat->scene, ob_iter, ob); if (lamp) shade_one_light(shi, shr, lamp); + + copy_m4_m4(ob_iter->obmat, omat); } } |