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:
-rw-r--r--source/blender/draw/intern/draw_manager_data.c13
-rw-r--r--source/blender/draw/intern/draw_manager_exec.c4
2 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c
index 06b9dedd428..d613203c74d 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -371,12 +371,21 @@ static void drw_call_state_update_matflag(DRWCallState *state,
* This is the opposite of what draw_matrices_model_prepare() does. */
state->matflag |= shgroup->matflag;
+ if (new_flags & DRW_CALL_MODELINVERSE) {
+ if (ob) {
+ copy_m4_m4(state->modelinverse, ob->imat);
+ }
+ else {
+ invert_m4_m4(state->modelinverse, state->model);
+ }
+ }
+
/* Orco factors: We compute this at creation to not have to save the *ob_data */
- if ((new_flags & DRW_CALL_ORCOTEXFAC) != 0) {
+ if (new_flags & DRW_CALL_ORCOTEXFAC) {
drw_call_calc_orco(ob, state->orcotexfac);
}
- if ((new_flags & DRW_CALL_OBJECTINFO) != 0) {
+ if (new_flags & DRW_CALL_OBJECTINFO) {
state->objectinfo[0] = ob ? ob->index : 0;
uint random;
if (DST.dupli_source) {
diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c
index e29b64c7b1f..823fc7e4091 100644
--- a/source/blender/draw/intern/draw_manager_exec.c
+++ b/source/blender/draw/intern/draw_manager_exec.c
@@ -818,10 +818,6 @@ static void draw_matrices_model_prepare(DRWCallState *st)
mul_m3_v3(st->normalviewinverse, st->eyevec);
}
/* Non view dependent */
- if (st->matflag & DRW_CALL_MODELINVERSE) {
- invert_m4_m4(st->modelinverse, st->model);
- st->matflag &= ~DRW_CALL_MODELINVERSE;
- }
if (st->matflag & DRW_CALL_NORMALWORLD) {
copy_m3_m4(st->normalworld, st->model);
invert_m3(st->normalworld);