diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-01-20 04:01:07 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-01-23 14:49:35 +0300 |
commit | b129ea843a7332ddd96554a8c59be379dabf2210 (patch) | |
tree | 8555be190fb59f9eab84b2de2c5a89731e349a0d /intern/cycles/kernel/shaders | |
parent | 4a5ee1a5a2adc8032cf710357081d3a1e3fcad95 (diff) |
Cycles: change material output displacement to vector.
Previously only scalar displacement along the normal was supported,
now displacement can go in any direction. For backwards compatibility,
a Displacement node will be automatically inserted in existing files.
This will make it possible to support vector displacement maps in the
future. It's already possible to use them to some extent, but requires
a manual shader node setup. For tangent space maps the right tangent
may also not be available yet, depends on the map.
Differential Revision: https://developer.blender.org/D3015
Diffstat (limited to 'intern/cycles/kernel/shaders')
-rw-r--r-- | intern/cycles/kernel/shaders/node_output_displacement.osl | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/intern/cycles/kernel/shaders/node_output_displacement.osl b/intern/cycles/kernel/shaders/node_output_displacement.osl index 294b8dd6bf2..5dbef0244fe 100644 --- a/intern/cycles/kernel/shaders/node_output_displacement.osl +++ b/intern/cycles/kernel/shaders/node_output_displacement.osl @@ -16,10 +16,8 @@ #include "stdosl.h" -displacement node_output_displacement(float Displacement = 0.0) +displacement node_output_displacement(vector Displacement = 0.0) { - vector dP = normalize(transform("object", N)); - dP *= Displacement * 0.1; /* todo: get rid of this factor */ - P += transform("object", "world", dP); + P += Displacement; } |