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:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user