Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2013-12-29 02:00:51 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2013-12-29 02:20:53 +0400
commitfe222643b4a53fae38bc5ead86551b99abbdc583 (patch)
tree382d10ebc69d9ac0003ec6451d9e56e88408b358 /intern/cycles/kernel/kernel_shadow.h
parent077fe03eaf29da93df94d9f3a38c3eb0180364cd (diff)
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.
Diffstat (limited to 'intern/cycles/kernel/kernel_shadow.h')
-rw-r--r--intern/cycles/kernel/kernel_shadow.h6
1 files changed, 3 insertions, 3 deletions
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