mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix #113461: Cycles subsurface artifacts with volume interior
Ignore self for the volume stack update from the the subsurface entry to the exit point. This was meant for other objects only.
This commit is contained in:
parent
9bc7fcc36e
commit
b6f7ebe811
1 changed files with 9 additions and 3 deletions
|
|
@ -44,6 +44,10 @@ ccl_device void integrator_volume_stack_update_for_subsurface(KernelGlobals kg,
|
|||
qsort(hits, num_hits, sizeof(Intersection), intersections_compare);
|
||||
|
||||
for (uint hit = 0; hit < num_hits; ++hit, ++isect) {
|
||||
/* Ignore self, SSS itself already enters and exits the object. */
|
||||
if (isect->object == volume_ray.self.object) {
|
||||
continue;
|
||||
}
|
||||
shader_setup_from_ray(kg, stack_sd, &volume_ray, isect);
|
||||
volume_stack_enter_exit(kg, state, stack_sd);
|
||||
}
|
||||
|
|
@ -53,9 +57,11 @@ ccl_device void integrator_volume_stack_update_for_subsurface(KernelGlobals kg,
|
|||
int step = 0;
|
||||
while (step < 2 * volume_stack_size &&
|
||||
scene_intersect_volume(kg, &volume_ray, &isect, visibility)) {
|
||||
shader_setup_from_ray(kg, stack_sd, &volume_ray, &isect);
|
||||
volume_stack_enter_exit(kg, state, stack_sd);
|
||||
|
||||
/* Ignore self, SSS itself already enters and exits the object. */
|
||||
if (isect.object != volume_ray.self.object) {
|
||||
shader_setup_from_ray(kg, stack_sd, &volume_ray, &isect);
|
||||
volume_stack_enter_exit(kg, state, stack_sd);
|
||||
}
|
||||
/* Move ray forward. */
|
||||
volume_ray.tmin = intersection_t_offset(isect.t);
|
||||
volume_ray.self.object = isect.object;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue