diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2013-12-29 18:40:43 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-01-07 18:03:41 +0400 |
commit | 01df756bd10709bb707d4f88f14c50e5680d05a5 (patch) | |
tree | 62d1374ada6e9c62bae736a7e0e62a6cb2c0a14d /intern/cycles/kernel/kernel_emission.h | |
parent | b174e7b0b89d0e03a20a11f4a754029689af56a9 (diff) |
Cycles Volume Render: scattering support.
This is done by adding a Volume Scatter node. In many cases you will want to
add together a Volume Absorption and Volume Scatter node with the same color
and density to get the expected results.
This should work with branched path tracing, mixing closures, overlapping
volumes, etc. However there's still various optimizations needed for sampling.
The main missing thing from the volume branch is the equiangular sampling for
homogeneous volumes.
The heterogeneous scattering code was arranged such that we can use a single
stratified random number for distance sampling, which gives less noise than
pseudo random numbers for each step. For volumes where the color is textured
there still seems to be something off, needs to be investigated.
Diffstat (limited to 'intern/cycles/kernel/kernel_emission.h')
-rw-r--r-- | intern/cycles/kernel/kernel_emission.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernel_emission.h b/intern/cycles/kernel/kernel_emission.h index e0db9435239..1ec116b7635 100644 --- a/intern/cycles/kernel/kernel_emission.h +++ b/intern/cycles/kernel/kernel_emission.h @@ -103,7 +103,14 @@ ccl_device_noinline bool direct_emission(KernelGlobals *kg, ShaderData *sd, int /* evaluate BSDF at shading point */ float bsdf_pdf; +#ifdef __VOLUME__ + if(sd->prim != ~0) + shader_bsdf_eval(kg, sd, ls.D, eval, &bsdf_pdf); + else + shader_volume_phase_eval(kg, sd, ls.D, eval, &bsdf_pdf); +#else shader_bsdf_eval(kg, sd, ls.D, eval, &bsdf_pdf); +#endif if(ls.shader & SHADER_USE_MIS) { /* multiple importance sampling */ |