diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-01-30 14:40:05 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-01-30 17:05:47 +0300 |
commit | 7261d675e6aeb1b0dff2712f50df9f4da6e1d453 (patch) | |
tree | 733ddccdddcd39bd9f36441ec5cfec7d28c0eae8 /intern/cycles/kernel/osl | |
parent | b3c4a2a8da7f1a243628da852d1b8fdc986cbc25 (diff) |
Fix Cycles incorrect principled BSDF mixing with some parameter variatons.
Spotted by Ha Hyung-jin, thanks!
Diffstat (limited to 'intern/cycles/kernel/osl')
-rw-r--r-- | intern/cycles/kernel/osl/osl_closures.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/intern/cycles/kernel/osl/osl_closures.cpp b/intern/cycles/kernel/osl/osl_closures.cpp index 608e856e019..c52230de86e 100644 --- a/intern/cycles/kernel/osl/osl_closures.cpp +++ b/intern/cycles/kernel/osl/osl_closures.cpp @@ -194,10 +194,12 @@ public: return NULL; } + bsdf->T = make_float3(0.0f, 0.0f, 0.0f); bsdf->extra = extra; bsdf->ior = 1.5f; bsdf->alpha_x = clearcoat_roughness; bsdf->alpha_y = clearcoat_roughness; + bsdf->extra->color = make_float3(0.0f, 0.0f, 0.0f); bsdf->extra->cspec0 = make_float3(0.04f, 0.04f, 0.04f); bsdf->extra->clearcoat = clearcoat; return bsdf; @@ -379,6 +381,7 @@ public: bsdf->extra = extra; bsdf->extra->color = color; bsdf->extra->cspec0 = cspec0; + bsdf->extra->clearcoat = 0.0f; return bsdf; } }; @@ -388,6 +391,8 @@ public: void setup(ShaderData *sd, int path_flag, float3 weight) { MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); + bsdf->T = make_float3(0.0f, 0.0f, 0.0f); + bsdf->alpha_y = bsdf->alpha_x; sd->flag |= (bsdf) ? bsdf_microfacet_ggx_fresnel_setup(bsdf, sd) : 0; } }; @@ -462,6 +467,8 @@ public: bsdf->extra = extra; bsdf->extra->color = color; + bsdf->extra->cspec0 = make_float3(0.0f, 0.0f, 0.0f); + bsdf->extra->clearcoat = 0.0f; return bsdf; } }; @@ -471,6 +478,9 @@ public: void setup(ShaderData *sd, int path_flag, float3 weight) { MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); + bsdf->ior = 0.0f; + bsdf->T = make_float3(0.0f, 0.0f, 0.0f); + bsdf->alpha_y = bsdf->alpha_x; sd->flag |= (bsdf) ? bsdf_microfacet_multi_ggx_setup(bsdf) : 0; } }; @@ -493,6 +503,7 @@ public: void setup(ShaderData *sd, int path_flag, float3 weight) { MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); + bsdf->ior = 0.0f; sd->flag |= (bsdf) ? bsdf_microfacet_multi_ggx_aniso_setup(bsdf) : 0; } }; @@ -519,6 +530,8 @@ public: void setup(ShaderData *sd, int path_flag, float3 weight) { MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); + bsdf->T = make_float3(0.0f, 0.0f, 0.0f); + bsdf->alpha_y = bsdf->alpha_x; sd->flag |= (bsdf) ? bsdf_microfacet_multi_ggx_glass_setup(bsdf) : 0; } }; @@ -568,6 +581,7 @@ public: bsdf->extra = extra; bsdf->extra->color = color; bsdf->extra->cspec0 = cspec0; + bsdf->extra->clearcoat = 0.0f; return bsdf; } }; @@ -577,6 +591,8 @@ public: void setup(ShaderData *sd, int path_flag, float3 weight) { MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); + bsdf->T = make_float3(0.0f, 0.0f, 0.0f); + bsdf->alpha_y = bsdf->alpha_x; sd->flag |= (bsdf) ? bsdf_microfacet_multi_ggx_fresnel_setup(bsdf, sd) : 0; } }; @@ -629,6 +645,8 @@ public: void setup(ShaderData *sd, int path_flag, float3 weight) { MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight); + bsdf->T = make_float3(0.0f, 0.0f, 0.0f); + bsdf->alpha_y = bsdf->alpha_x; sd->flag |= (bsdf) ? bsdf_microfacet_multi_ggx_glass_fresnel_setup(bsdf, sd) : 0; } }; |