[Bf-blender-cvs] [a585cbd] master: Fix T43783: Cycles clipping doesn't match viewport when camera is inside volume
Sergey Sharybin
noreply at git.blender.org
Tue Feb 24 09:08:28 CET 2015
Commit: a585cbd2af92c0a1ebf24c1a28069bb4ebf1d177
Author: Sergey Sharybin
Date: Tue Feb 24 13:06:29 2015 +0500
Branches: master
https://developer.blender.org/rBa585cbd2af92c0a1ebf24c1a28069bb4ebf1d177
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.
===================================================================
M intern/cycles/kernel/kernel_path_surface.h
===================================================================
diff --git a/intern/cycles/kernel/kernel_path_surface.h b/intern/cycles/kernel/kernel_path_surface.h
index d2704c3..f0d4e98 100644
--- a/intern/cycles/kernel/kernel_path_surface.h
+++ b/intern/cycles/kernel/kernel_path_surface.h
@@ -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__
More information about the Bf-blender-cvs
mailing list