diff options
Diffstat (limited to 'intern/cycles/kernel/kernel_subsurface.h')
-rw-r--r-- | intern/cycles/kernel/kernel_subsurface.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernel_subsurface.h b/intern/cycles/kernel/kernel_subsurface.h index 23e30db1b08..ed8572467ea 100644 --- a/intern/cycles/kernel/kernel_subsurface.h +++ b/intern/cycles/kernel/kernel_subsurface.h @@ -428,12 +428,17 @@ ccl_device_noinline hit = (ss_isect->num_hits > 0); if (hit) { +#ifdef __KERNEL_OPTIX__ + /* t is always in world space with OptiX. */ + t = ss_isect->hits[0].t; +#else /* Compute world space distance to surface hit. */ float3 D = ray->D; object_inverse_dir_transform(kg, sd, &D); D = normalize(D) * ss_isect->hits[0].t; object_dir_transform(kg, sd, &D); t = len(D); +#endif } /* Advance to new scatter location. */ |