diff options
author | Ton Roosendaal <ton@blender.org> | 2004-06-13 23:30:56 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2004-06-13 23:30:56 +0400 |
commit | d56315aa1804164998c729d25c1f6f67f80b8ea4 (patch) | |
tree | 3d0eb42c124a4b566329c3831b7060061fe15682 | |
parent | 7f3dcd7c64dec6c0725443b6f3f951b1953d3acd (diff) |
Bug 1335
Displace mapping + Map-Input using Object wasn't working. This caused
by the inverse matrix of an Object potentially not being calculated when
displace was calculated.
Solved by moving imat calculus to the top of the main function.
Yafray note: the convention to hack out all transformations from
renderconverter could be implemented more elegant, by moving this to
the yafray section (and just matrix-transform back). Makes code less
unreadable, but also support displacement then (and might solve other
errors).
-rw-r--r-- | source/blender/renderconverter/intern/convertBlenderScene.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/renderconverter/intern/convertBlenderScene.c b/source/blender/renderconverter/intern/convertBlenderScene.c index 7c8f685be6f..a1672eca367 100644 --- a/source/blender/renderconverter/intern/convertBlenderScene.c +++ b/source/blender/renderconverter/intern/convertBlenderScene.c @@ -2808,6 +2808,23 @@ void RE_rotateBlenderScene(void) init_render_textures(); init_render_materials(); + /* imat objects, OB_DO_IMAT can be set in init_render_materials + has to be done here, since displace can have texture using Object map-input */ + ob= G.main->object.first; + while(ob) { + if(ob->flag & OB_DO_IMAT) { + + ob->flag &= ~OB_DO_IMAT; + /* yafray: set transform to identity matrix, not sure if this is needed here */ + if (R.r.renderer==R_YAFRAY) + MTC_Mat4One(mat); + else + MTC_Mat4MulMat4(mat, ob->obmat, R.viewmat); + MTC_Mat4Invert(ob->imat, mat); + } + ob= ob->id.next; + } + /* MAKE RENDER DATA */ /* each object should only be rendered once */ @@ -2929,7 +2946,6 @@ void RE_rotateBlenderScene(void) MTC_Mat4Invert(ob->imat, mat); } - ob->flag &= ~OB_DO_IMAT; } if(blender_test_break()) break; @@ -2941,22 +2957,6 @@ void RE_rotateBlenderScene(void) } - /* imat objects */ - ob= G.main->object.first; - while(ob) { - if(ob->flag & OB_DO_IMAT) { - - ob->flag &= ~OB_DO_IMAT; - /* yafray: set transform to identity matrix, not sure if this is needed here */ - if (R.r.renderer==R_YAFRAY) - MTC_Mat4One(mat); - else - MTC_Mat4MulMat4(mat, ob->obmat, R.viewmat); - MTC_Mat4Invert(ob->imat, mat); - } - ob= ob->id.next; - } - sort_halos(); if(R.wrld.mode & WO_STARS) RE_make_stars(NULL, NULL, NULL); |