forked from bartvdbraak/blender
Cycles: Fix regression with transparent shadows in volume
This commit is contained in:
parent
da31a82832
commit
b16fd22018
@ -23,16 +23,23 @@ ccl_device_forceinline bool shadow_handle_transparent_isect(
|
|||||||
KernelGlobals *kg,
|
KernelGlobals *kg,
|
||||||
ShaderData *shadow_sd,
|
ShaderData *shadow_sd,
|
||||||
ccl_addr_space PathState *state,
|
ccl_addr_space PathState *state,
|
||||||
|
# ifdef __VOLUME__
|
||||||
|
struct PathState *volume_state,
|
||||||
|
# endif
|
||||||
Intersection *isect,
|
Intersection *isect,
|
||||||
Ray *ray,
|
Ray *ray,
|
||||||
float3 *throughput)
|
float3 *throughput)
|
||||||
{
|
{
|
||||||
#ifdef __VOLUME__
|
#ifdef __VOLUME__
|
||||||
/* Attenuation between last surface and next surface. */
|
/* Attenuation between last surface and next surface. */
|
||||||
if(state->volume_stack[0].shader != SHADER_NONE) {
|
if(volume_state->volume_stack[0].shader != SHADER_NONE) {
|
||||||
Ray segment_ray = *ray;
|
Ray segment_ray = *ray;
|
||||||
segment_ray.t = isect->t;
|
segment_ray.t = isect->t;
|
||||||
kernel_volume_shadow(kg, shadow_sd, state, &segment_ray, throughput);
|
kernel_volume_shadow(kg,
|
||||||
|
shadow_sd,
|
||||||
|
volume_state,
|
||||||
|
&segment_ray,
|
||||||
|
throughput);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Setup shader data at surface. */
|
/* Setup shader data at surface. */
|
||||||
@ -56,7 +63,7 @@ ccl_device_forceinline bool shadow_handle_transparent_isect(
|
|||||||
}
|
}
|
||||||
#ifdef __VOLUME__
|
#ifdef __VOLUME__
|
||||||
/* Exit/enter volume. */
|
/* Exit/enter volume. */
|
||||||
kernel_volume_stack_enter_exit(kg, shadow_sd, state->volume_stack);
|
kernel_volume_stack_enter_exit(kg, shadow_sd, volume_state->volume_stack);
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -163,6 +170,9 @@ ccl_device bool shadow_blocked_transparent_all_loop(KernelGlobals *kg,
|
|||||||
if(shadow_handle_transparent_isect(kg,
|
if(shadow_handle_transparent_isect(kg,
|
||||||
shadow_sd,
|
shadow_sd,
|
||||||
state,
|
state,
|
||||||
|
#ifdef __VOLUME__
|
||||||
|
&ps,
|
||||||
|
#endif
|
||||||
isect,
|
isect,
|
||||||
ray,
|
ray,
|
||||||
&throughput))
|
&throughput))
|
||||||
@ -288,6 +298,9 @@ ccl_device bool shadow_blocked_transparent_stepped_loop(
|
|||||||
if(shadow_handle_transparent_isect(kg,
|
if(shadow_handle_transparent_isect(kg,
|
||||||
shadow_sd,
|
shadow_sd,
|
||||||
state,
|
state,
|
||||||
|
#ifdef __VOLUME__
|
||||||
|
&ps,
|
||||||
|
#endif
|
||||||
isect,
|
isect,
|
||||||
ray,
|
ray,
|
||||||
&throughput))
|
&throughput))
|
||||||
|
Loading…
Reference in New Issue
Block a user