From 01df756bd10709bb707d4f88f14c50e5680d05a5 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 29 Dec 2013 15:40:43 +0100 Subject: 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. --- intern/cycles/kernel/kernel_accumulate.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'intern/cycles/kernel/kernel_accumulate.h') diff --git a/intern/cycles/kernel/kernel_accumulate.h b/intern/cycles/kernel/kernel_accumulate.h index f4febd7cf2c..24e9d7b8858 100644 --- a/intern/cycles/kernel/kernel_accumulate.h +++ b/intern/cycles/kernel/kernel_accumulate.h @@ -35,7 +35,7 @@ ccl_device_inline void bsdf_eval_init(BsdfEval *eval, ClosureType type, float3 v if(type == CLOSURE_BSDF_TRANSPARENT_ID) eval->transparent = value; - else if(CLOSURE_IS_BSDF_DIFFUSE(type)) + else if(CLOSURE_IS_BSDF_DIFFUSE(type) || CLOSURE_IS_PHASE(type)) eval->diffuse = value; else if(CLOSURE_IS_BSDF_GLOSSY(type)) eval->glossy = value; @@ -55,7 +55,7 @@ ccl_device_inline void bsdf_eval_accum(BsdfEval *eval, ClosureType type, float3 { #ifdef __PASSES__ if(eval->use_light_pass) { - if(CLOSURE_IS_BSDF_DIFFUSE(type)) + if(CLOSURE_IS_BSDF_DIFFUSE(type) || CLOSURE_IS_PHASE(type)) eval->diffuse += value; else if(CLOSURE_IS_BSDF_GLOSSY(type)) eval->glossy += value; -- cgit v1.2.3