diff options
author | Lukas Stockner <lukas.stockner@freenet.de> | 2020-05-14 23:12:29 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2020-05-15 01:52:57 +0300 |
commit | c880e54a95dd352262f71cb0834e01fdfbdf000c (patch) | |
tree | 09c788518e44ddd1b2d08b50980d3b9bff9fd602 /intern/cycles/kernel/closure/bsdf_microfacet_multi.h | |
parent | 8d918fe0f2c732258855783b273a9b6a6b429ad7 (diff) |
Cycles: Refactor microfacet BSDFs to remove separate anisotropy code
Since the sampling and evaluation functions handle both cases anyways,
there's not really a point for keeping the distinction in the kernel,
so we might as well cut down the number of CLOSURE_BSDF_MICROFACETs a bit.
Differential Revision: https://developer.blender.org/D7736
Diffstat (limited to 'intern/cycles/kernel/closure/bsdf_microfacet_multi.h')
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_microfacet_multi.h | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/intern/cycles/kernel/closure/bsdf_microfacet_multi.h b/intern/cycles/kernel/closure/bsdf_microfacet_multi.h index a5fe989bcd1..9795c8da065 100644 --- a/intern/cycles/kernel/closure/bsdf_microfacet_multi.h +++ b/intern/cycles/kernel/closure/bsdf_microfacet_multi.h @@ -384,7 +384,7 @@ ccl_device int bsdf_microfacet_multi_ggx_common_setup(MicrofacetBsdf *bsdf) return SD_BSDF | SD_BSDF_HAS_EVAL | SD_BSDF_NEEDS_LCG; } -ccl_device int bsdf_microfacet_multi_ggx_aniso_setup(MicrofacetBsdf *bsdf) +ccl_device int bsdf_microfacet_multi_ggx_setup(MicrofacetBsdf *bsdf) { if (is_zero(bsdf->T)) bsdf->T = make_float3(1.0f, 0.0f, 0.0f); @@ -394,8 +394,7 @@ ccl_device int bsdf_microfacet_multi_ggx_aniso_setup(MicrofacetBsdf *bsdf) return bsdf_microfacet_multi_ggx_common_setup(bsdf); } -ccl_device int bsdf_microfacet_multi_ggx_aniso_fresnel_setup(MicrofacetBsdf *bsdf, - const ShaderData *sd) +ccl_device int bsdf_microfacet_multi_ggx_fresnel_setup(MicrofacetBsdf *bsdf, const ShaderData *sd) { if (is_zero(bsdf->T)) bsdf->T = make_float3(1.0f, 0.0f, 0.0f); @@ -407,26 +406,6 @@ ccl_device int bsdf_microfacet_multi_ggx_aniso_fresnel_setup(MicrofacetBsdf *bsd return bsdf_microfacet_multi_ggx_common_setup(bsdf); } -ccl_device int bsdf_microfacet_multi_ggx_setup(MicrofacetBsdf *bsdf) -{ - bsdf->alpha_y = bsdf->alpha_x; - - bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID; - - return bsdf_microfacet_multi_ggx_common_setup(bsdf); -} - -ccl_device int bsdf_microfacet_multi_ggx_fresnel_setup(MicrofacetBsdf *bsdf, const ShaderData *sd) -{ - bsdf->alpha_y = bsdf->alpha_x; - - bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID; - - bsdf_microfacet_fresnel_color(sd, bsdf); - - return bsdf_microfacet_multi_ggx_common_setup(bsdf); -} - ccl_device int bsdf_microfacet_multi_ggx_refraction_setup(MicrofacetBsdf *bsdf) { bsdf->alpha_y = bsdf->alpha_x; |