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:
authorJanne Karhu <jhkarh@gmail.com>2011-02-28 18:42:15 +0300
committerJanne Karhu <jhkarh@gmail.com>2011-02-28 18:42:15 +0300
commit506e8aa43786f80c60979fb53ba38288cfe193ad (patch)
tree02b541af0d65ffa69e97146b0b016b9cf0d6e9f8 /source/blender/makesdna/DNA_object_types.h
parent13b617c78fb2e81b805d6f84b05a68ad951bc4ce (diff)
Bug fix: Render and 3d view conflict over ob->imat
* For rendering every object's inverse matrix "ob->imat" needs to be in render view coordinates, but for drawing in 3d view it needs to be in global coordinates. Originally (way back in historical times) ob->imat was only used for rendering, but over the years other uses came up too. Before 2.5 this wasn't a problem as rendering was a totally blocking operation, but with the new "interactive ui while rendering" the problems started. Basically any update that redrew the 3d view while rendering (like rotating the scene with mouse) updated the inverse matrix into global coordinates thus invalidating it for the render, leading to all kinds of strange discontinuities with textures and volumetrics. * Problems were very easy to achieve using orco/object coordinates for pretty much any textures (bump, point density, volume, sky), for examples see bug reports 24906 and 25229. Render baking normals in object coordinates was wrong most of the time too. * Now there is a separate inverse matrix ob->imat_ren that's calculated at the beginning of rendering and is used in all places inside render code where it's needed. This way the original ob->imat can change at will during rendering without causing problems.
Diffstat (limited to 'source/blender/makesdna/DNA_object_types.h')
-rw-r--r--source/blender/makesdna/DNA_object_types.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 8c0e065e27f..c97a1d8fef5 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -145,7 +145,13 @@ typedef struct Object {
float obmat[4][4]; /* final worldspace matrix with constraints & animsys applied */
float parentinv[4][4]; /* inverse result of parent, so that object doesn't 'stick' to parent */
float constinv[4][4]; /* inverse result of constraints. doesn't include effect of parent or object local transform */
- float imat[4][4]; /* inverse matrix of 'obmat' for during render, old game engine, temporally: ipokeys of transform */
+ float imat[4][4]; /* inverse matrix of 'obmat' for any other use than rendering! */
+
+ /* Previously 'imat' was used at render time, but as other places use it too
+ * the interactive ui of 2.5 creates problems. So now only 'imat_ren' should
+ * be used when ever the inverse of ob->obmat * re->viewmat is needed! - jahka
+ */
+ float imat_ren[4][4];
unsigned int lay; /* copy of Base */