diff options
-rw-r--r-- | source/blender/render/intern/include/render_types.h | 4 | ||||
-rw-r--r-- | source/blender/render/intern/source/convertblender.c | 1 | ||||
-rw-r--r-- | source/blender/render/intern/source/envmap.c | 4 |
3 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 536a2b8a85f..b87b1e6f367 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -595,7 +595,9 @@ typedef struct LampRen { float imat[3][3]; float spottexfac; float sh_invcampos[3], sh_zfac; /* sh_= spothalo */ - + + float lampmat[4][4]; /* worls space lamp matrix, used for scene rotation */ + float mat[3][3]; /* 3x3 part from lampmat x viewmat */ float area[8][3], areasize; diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index c6ebe44c5da..55146162f25 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -3650,6 +3650,7 @@ static GroupObject *add_render_lamp(Render *re, Object *ob) mul_m4_m4m4(mat, re->viewmat, ob->obmat); invert_m4_m4(ob->imat, mat); + copy_m4_m4(lar->lampmat, ob->obmat); copy_m3_m4(lar->mat, mat); copy_m3_m4(lar->imat, ob->imat); diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index 28b29261e4e..06be00a5a5e 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -329,9 +329,9 @@ void env_rotate_scene(Render *re, float mat[4][4], int do_rotate) /* copy from add_render_lamp */ if (do_rotate == 1) - mul_m4_m4m4(tmpmat, re->viewmat, go->ob->obmat); + mul_m4_m4m4(tmpmat, re->viewmat, lar->lampmat); else - mul_m4_m4m4(tmpmat, re->viewmat_orig, go->ob->obmat); + mul_m4_m4m4(tmpmat, re->viewmat_orig, lar->lampmat); invert_m4_m4(go->ob->imat, tmpmat); copy_m3_m4(lar->mat, tmpmat); |