From fe222643b4a53fae38bc5ead86551b99abbdc583 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 28 Dec 2013 23:00:51 +0100 Subject: Cycles Volume Render: add volume emission support. This is done using the existing Emission node and closure (we may add a volume emission node, not clear yet if it will be needed). Volume emission only supports indirect light sampling which means it's not very efficient to make small or far away bright light sources. Using direct light sampling and MIS would be tricky and probably won't be added anytime soon. Other renderers don't support this either as far as I know, lamps and ray visibility tricks may be used instead. --- intern/cycles/kernel/kernel_shadow.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'intern/cycles/kernel/kernel_shadow.h') diff --git a/intern/cycles/kernel/kernel_shadow.h b/intern/cycles/kernel/kernel_shadow.h index 80c9da8eab8..4bf063ee185 100644 --- a/intern/cycles/kernel/kernel_shadow.h +++ b/intern/cycles/kernel/kernel_shadow.h @@ -74,7 +74,7 @@ ccl_device_inline bool shadow_blocked(KernelGlobals *kg, PathState *state, Ray * #ifdef __VOLUME__ /* attenuation for last line segment towards light */ if(ps.volume_stack[0].shader != SHADER_NO_ID) - throughput *= kernel_volume_get_shadow_attenuation(kg, &ps, ray); + kernel_volume_get_shadow_attenuation(kg, &ps, ray, &throughput); #endif *shadow *= throughput; @@ -89,7 +89,7 @@ ccl_device_inline bool shadow_blocked(KernelGlobals *kg, PathState *state, Ray * if(ps.volume_stack[0].shader != SHADER_NO_ID) { Ray segment_ray = *ray; segment_ray.t = isect.t; - throughput *= kernel_volume_get_shadow_attenuation(kg, &ps, &segment_ray); + kernel_volume_get_shadow_attenuation(kg, &ps, &segment_ray, &throughput); } #endif @@ -120,7 +120,7 @@ ccl_device_inline bool shadow_blocked(KernelGlobals *kg, PathState *state, Ray * #ifdef __VOLUME__ else if(!result && state->volume_stack[0].shader != SHADER_NO_ID) { /* apply attenuation from current volume shader */ - *shadow *= kernel_volume_get_shadow_attenuation(kg, state, ray); + kernel_volume_get_shadow_attenuation(kg, state, ray, shadow); } #endif #endif -- cgit v1.2.3