From 99a6392fb5aed1831616bfd1ab4a00c345b32d51 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 23 Feb 2022 18:38:51 +0100 Subject: Fix OSL trace() not being fully updated for ray offsetting removal This was the last place still using the ray_offset() function. --- intern/cycles/kernel/osl/services.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'intern/cycles/kernel/osl') 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 { -- cgit v1.2.3