diff options
author | Thomas Dinges <blender@dingto.org> | 2015-06-11 16:18:33 +0300 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2015-06-11 16:18:33 +0300 |
commit | 6a0a205cb4f648144729de98b39b91d44bf13752 (patch) | |
tree | dd0869c39d2d3323567e28af73f16fe044bed905 /intern | |
parent | af4d10703b07598e26aee0b5a480d009fbd72602 (diff) |
Cycles: Simplify volume_phase_eval().
This simplification is safe, as the call to volume_phase_eval() is guarded behind a CLOSURE_IS_PHASE check, which is equal to
CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID. I don't think we will add more phase functions anytime soon, if at all.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/closure/volume.h | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/intern/cycles/kernel/closure/volume.h b/intern/cycles/kernel/closure/volume.h index 439610546e5..4d71ba50ec3 100644 --- a/intern/cycles/kernel/closure/volume.h +++ b/intern/cycles/kernel/closure/volume.h @@ -107,18 +107,9 @@ ccl_device int volume_absorption_setup(ShaderClosure *sc) ccl_device float3 volume_phase_eval(const ShaderData *sd, const ShaderClosure *sc, float3 omega_in, float *pdf) { - float3 eval; + kernel_assert(sc->type == CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID); - switch(sc->type) { - case CLOSURE_VOLUME_HENYEY_GREENSTEIN_ID: - eval = volume_henyey_greenstein_eval_phase(sc, sd->I, omega_in, pdf); - break; - default: - eval = make_float3(0.0f, 0.0f, 0.0f); - break; - } - - return eval; + return volume_henyey_greenstein_eval_phase(sc, sd->I, omega_in, pdf); } ccl_device int volume_phase_sample(const ShaderData *sd, const ShaderClosure *sc, float randu, |