diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-11-01 23:07:15 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-11-05 20:13:44 +0300 |
commit | c571be4e05788b8d3447a0bfe59942ebb4464750 (patch) | |
tree | 9ee997dee0a0d11b04cf1806f3ca5da9f06c3a78 /intern/cycles/kernel/osl/osl_closures.h | |
parent | 2c02a04c464c2f5c6e211ceb7b21255eaca7e087 (diff) |
Code refactor: sum transparent and absorption weights outside closures.
Diffstat (limited to 'intern/cycles/kernel/osl/osl_closures.h')
-rw-r--r-- | intern/cycles/kernel/osl/osl_closures.h | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/intern/cycles/kernel/osl/osl_closures.h b/intern/cycles/kernel/osl/osl_closures.h index ff5fd9cc905..38943b77656 100644 --- a/intern/cycles/kernel/osl/osl_closures.h +++ b/intern/cycles/kernel/osl/osl_closures.h @@ -48,11 +48,13 @@ OSL::ClosureParam *closure_holdout_params(); OSL::ClosureParam *closure_ambient_occlusion_params(); OSL::ClosureParam *closure_bsdf_diffuse_ramp_params(); OSL::ClosureParam *closure_bsdf_phong_ramp_params(); +OSL::ClosureParam *closure_bsdf_transparent_params(); OSL::ClosureParam *closure_bssrdf_cubic_params(); OSL::ClosureParam *closure_bssrdf_gaussian_params(); OSL::ClosureParam *closure_bssrdf_burley_params(); OSL::ClosureParam *closure_bssrdf_principled_params(); -OSL::ClosureParam *closure_henyey_greenstein_volume_params(); +OSL::ClosureParam *closure_absorption_params(); +OSL::ClosureParam *closure_henyey_greenstein_params(); OSL::ClosureParam *closure_bsdf_microfacet_multi_ggx_params(); OSL::ClosureParam *closure_bsdf_microfacet_multi_ggx_glass_params(); OSL::ClosureParam *closure_bsdf_microfacet_multi_ggx_aniso_params(); @@ -69,11 +71,13 @@ void closure_holdout_prepare(OSL::RendererServices *, int id, void *data); void closure_ambient_occlusion_prepare(OSL::RendererServices *, int id, void *data); void closure_bsdf_diffuse_ramp_prepare(OSL::RendererServices *, int id, void *data); void closure_bsdf_phong_ramp_prepare(OSL::RendererServices *, int id, void *data); +void closure_bsdf_transparent_prepare(OSL::RendererServices *, int id, void *data); void closure_bssrdf_cubic_prepare(OSL::RendererServices *, int id, void *data); void closure_bssrdf_gaussian_prepare(OSL::RendererServices *, int id, void *data); void closure_bssrdf_burley_prepare(OSL::RendererServices *, int id, void *data); void closure_bssrdf_principled_prepare(OSL::RendererServices *, int id, void *data); -void closure_henyey_greenstein_volume_prepare(OSL::RendererServices *, int id, void *data); +void closure_absorption_prepare(OSL::RendererServices *, int id, void *data); +void closure_henyey_greenstein_prepare(OSL::RendererServices *, int id, void *data); void closure_bsdf_microfacet_multi_ggx_prepare(OSL::RendererServices *, int id, void *data); void closure_bsdf_microfacet_multi_ggx_glass_prepare(OSL::RendererServices *, int id, void *data); void closure_bsdf_microfacet_multi_ggx_aniso_prepare(OSL::RendererServices *, int id, void *data); @@ -147,36 +151,6 @@ static ClosureParam *bsdf_##lower##_params() \ \ CCLOSURE_PREPARE_STATIC(bsdf_##lower##_prepare, Upper##Closure) -/* Volume */ - -#define VOLUME_CLOSURE_CLASS_BEGIN(Upper, lower, structname, TYPE) \ -\ -class Upper##Closure : public CBSDFClosure { \ -public: \ - structname params; \ -\ - void setup(ShaderData *sd, int path_flag, float3 weight) \ - { \ - structname *volume = (structname*)bsdf_alloc_osl(sd, sizeof(structname), weight, ¶ms); \ - sd->flag |= (volume) ? volume_##lower##_setup(volume) : 0; \ - } \ -}; \ -\ -static ClosureParam *volume_##lower##_params() \ -{ \ - static ClosureParam params[] = { - -/* parameters */ - -#define VOLUME_CLOSURE_CLASS_END(Upper, lower) \ - CLOSURE_STRING_KEYPARAM(Upper##Closure, label, "label"), \ - CLOSURE_FINISH_PARAM(Upper##Closure) \ - }; \ - return params; \ -} \ -\ -CCLOSURE_PREPARE_STATIC(volume_##lower##_prepare, Upper##Closure) - CCL_NAMESPACE_END #endif /* __OSL_CLOSURES_H__ */ |