diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-02-23 20:38:51 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-02-23 22:01:03 +0300 |
commit | 99a6392fb5aed1831616bfd1ab4a00c345b32d51 (patch) | |
tree | a7a02874793aab1183570e54c0b2b7fe46ac0857 | |
parent | dbef66c32f728546c6b0a1759a38e7edd9fa4dfc (diff) |
Fix OSL trace() not being fully updated for ray offsetting removal
This was the last place still using the ray_offset() function.
-rw-r--r-- | intern/cycles/kernel/osl/services.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/intern/cycles/kernel/osl/services.cpp b/intern/cycles/kernel/osl/services.cpp index d79e7dfa8a5..67e8a40d4c3 100644 --- a/intern/cycles/kernel/osl/services.cpp +++ b/intern/cycles/kernel/osl/services.cpp @@ -1651,12 +1651,16 @@ bool OSLRenderServices::trace(TraceOpt &options, ray.D = TO_FLOAT3(R); ray.t = (options.maxdist == 1.0e30f) ? FLT_MAX : options.maxdist - options.mindist; ray.time = sd->time; + ray.self.object = OBJECT_NONE; + ray.self.prim = PRIM_NONE; + ray.self.light_object = OBJECT_NONE; + ray.self.light_prim = PRIM_NONE; if (options.mindist == 0.0f) { /* avoid self-intersections */ if (ray.P == sd->P) { - bool transmit = (dot(sd->Ng, ray.D) < 0.0f); - ray.P = ray_offset(sd->P, (transmit) ? -sd->Ng : sd->Ng); + ray.self.object = sd->object; + ray.self.prim = sd->prim; } } else { |