Fix T43783: Cycles clipping doesn't match viewport when camera is inside volume

Ray length adjustment got lost in some refactor commit back to 2.71 days.
This commit is contained in:
Sergey Sharybin 2015-02-24 13:06:29 +05:00
parent 4c75f77669
commit a585cbd2af
Notes: blender-bot 2023-02-14 11:34:30 +01:00
Referenced by issue #43783, Cycles clipping doesn't match viewport when camera is inside volume
1 changed files with 5 additions and 0 deletions

View File

@ -281,6 +281,11 @@ ccl_device_inline bool kernel_path_surface_bounce(KernelGlobals *kg, RNG *rng,
/* update path state, count as transparent */
path_state_next(kg, state, LABEL_TRANSPARENT);
if(state->bounce == 0)
ray->t -= sd->ray_length; /* clipping works through transparent */
else
ray->t = FLT_MAX;
/* setup ray position, direction stays unchanged */
ray->P = ray_offset(sd->P, -sd->Ng);
#ifdef __RAY_DIFFERENTIALS__