Cycles: Replace object index hack with actual checks for SD_TRANSFORM_APPLIED

Using ones complement for detecting if transform has been applied was confusing
and led to several bugs. With this proper checks are made.

Also added a few transforms where they were missing, mostly affecting baking
and displacement when `P` is used in the shader (previously `P` was in the
wrong space for these shaders)

Also removed `TIME_INVALID` as this may have resulted in incorrect
transforms in some cases.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2192
This commit is contained in:
Mai Lavelle
2016-09-02 21:37:17 -04:00
parent 92a2c49aab
commit 013b46d6bd
14 changed files with 61 additions and 44 deletions

View File

@@ -18,6 +18,8 @@
displacement node_output_displacement(float Displacement = 0.0)
{
P += N * Displacement * 0.1; /* todo: get rid of this factor */
vector dP = normalize(transform("object", N));
dP *= Displacement * 0.1; /* todo: get rid of this factor */
P += transform("object", "world", dP);
}