diff options
author | Patrick Mours <pmours@nvidia.com> | 2022-11-11 18:42:49 +0300 |
---|---|---|
committer | Patrick Mours <pmours@nvidia.com> | 2022-11-11 19:10:30 +0300 |
commit | 097a13f5be143bd37bfd635cbf31515d531d7a8a (patch) | |
tree | d45481a1c80eb0d1251fad51d07813242d5cf21b /intern/cycles/kernel/osl/shaders/node_tangent.osl | |
parent | dc8a1d38b73420428f9fb878386b99ebb69dd841 (diff) |
Fix broken Cycles rendering with recent OSL versions
Commit c8dd33f5a37b6a6db0b6950d24f9a7cff5ceb799 in OSL
changed behavior of shader parameters that reference each other
and are also overwritten with an instance value.
This is causing the "NormalIn" parameter of a few OSL nodes in
Cycles to be set to zero somehow, which should instead have
received the value from a "node_geometry" node Cycles generates
and connects automatically. I am not entirely sure why that is
happening, but these parameters are superfluous anyway, since
OSL already provides the necessary data in the global variable "N".
So this patch simply removes those parameters (which mimics
SVM, where these parameters do not exist either), which also
fixes the rendering artifacts that occured with recent OSL.
Maniphest Tasks: T101222
Differential Revision: https://developer.blender.org/D16470
Diffstat (limited to 'intern/cycles/kernel/osl/shaders/node_tangent.osl')
-rw-r--r-- | intern/cycles/kernel/osl/shaders/node_tangent.osl | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/intern/cycles/kernel/osl/shaders/node_tangent.osl b/intern/cycles/kernel/osl/shaders/node_tangent.osl index a302c001f08..b3808778b2f 100644 --- a/intern/cycles/kernel/osl/shaders/node_tangent.osl +++ b/intern/cycles/kernel/osl/shaders/node_tangent.osl @@ -3,8 +3,7 @@ #include "stdcycles.h" -shader node_tangent(normal NormalIn = N, - string attr_name = "geom:tangent", +shader node_tangent(string attr_name = "geom:tangent", string direction_type = "radial", string axis = "z", output normal Tangent = normalize(dPdu)) @@ -29,5 +28,5 @@ shader node_tangent(normal NormalIn = N, } T = transform("object", "world", T); - Tangent = cross(NormalIn, normalize(cross(T, NormalIn))); + Tangent = cross(N, normalize(cross(T, N))); } |