diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-04-04 18:45:49 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-06-14 15:49:56 +0400 |
commit | a29807cd63b0cba62e664c54ce34e5717ca51a3e (patch) | |
tree | ac3a32e4393638711686e93879c6c218a17713eb /intern/cycles/kernel/kernel_emission.h | |
parent | d644753319b65a25ae043900cca235070bcdd181 (diff) |
Cycles: volume light sampling
* Volume multiple importace sampling support to combine equiangular and distance
sampling, for both homogeneous and heterogeneous volumes.
* Branched path "Sample All Direct Lights" and "Sample All Indirect Lights" now
apply to volumes as well as surfaces.
Implementation note:
For simplicity this is all done with decoupled ray marching, the only case we do
not use decoupled is for distance only sampling with one light sample. The
homogeneous case should still compile on the GPU because it only requires fixed
size storage, but the heterogeneous case will be trickier to get working.
Diffstat (limited to 'intern/cycles/kernel/kernel_emission.h')
-rw-r--r-- | intern/cycles/kernel/kernel_emission.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernel_emission.h b/intern/cycles/kernel/kernel_emission.h index b382e2c833b..bda98b84da8 100644 --- a/intern/cycles/kernel/kernel_emission.h +++ b/intern/cycles/kernel/kernel_emission.h @@ -194,6 +194,17 @@ ccl_device_noinline bool indirect_lamp_emission(KernelGlobals *kg, PathState *st float3 L = direct_emissive_eval(kg, &ls, -ray->D, ray->dD, ls.t, ray->time, state->bounce, state->transparent_bounce); +#ifdef __VOLUME__ + if(state->volume_stack[0].shader != SHADER_NONE) { + /* shadow attenuation */ + Ray volume_ray = *ray; + volume_ray.t = ls.t; + float3 volume_tp = make_float3(1.0f, 1.0f, 1.0f); + kernel_volume_shadow(kg, state, &volume_ray, &volume_tp); + L *= volume_tp; + } +#endif + if(!(state->flag & PATH_RAY_MIS_SKIP)) { /* multiple importance sampling, get regular light pdf, * and compute weight with respect to BSDF pdf */ |