diff options
Diffstat (limited to 'intern/cycles/kernel/shaders/node_glossy_bsdf.osl')
-rw-r--r-- | intern/cycles/kernel/shaders/node_glossy_bsdf.osl | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/intern/cycles/kernel/shaders/node_glossy_bsdf.osl b/intern/cycles/kernel/shaders/node_glossy_bsdf.osl index 7415211b56d..2d40ee8d3f6 100644 --- a/intern/cycles/kernel/shaders/node_glossy_bsdf.osl +++ b/intern/cycles/kernel/shaders/node_glossy_bsdf.osl @@ -17,25 +17,22 @@ #include "stdosl.h" #include "node_fresnel.h" -shader node_glossy_bsdf( - color Color = 0.8, - string distribution = "GGX", - float Roughness = 0.2, - normal Normal = N, - output closure color BSDF = 0) +shader node_glossy_bsdf(color Color = 0.8, + string distribution = "GGX", + float Roughness = 0.2, + normal Normal = N, + output closure color BSDF = 0) { - float roughness = Roughness * Roughness; - - if (distribution == "sharp") - BSDF = Color * reflection(Normal); - else if (distribution == "beckmann") - BSDF = Color * microfacet_beckmann(Normal, roughness); - else if (distribution == "GGX") - BSDF = Color * microfacet_ggx(Normal, roughness); - else if (distribution == "Multiscatter GGX") - BSDF = Color * microfacet_multi_ggx(Normal, roughness, Color); - else - BSDF = Color * ashikhmin_shirley(Normal, vector(0, 0, 0), roughness, roughness); + float roughness = Roughness * Roughness; + if (distribution == "sharp") + BSDF = Color * reflection(Normal); + else if (distribution == "beckmann") + BSDF = Color * microfacet_beckmann(Normal, roughness); + else if (distribution == "GGX") + BSDF = Color * microfacet_ggx(Normal, roughness); + else if (distribution == "Multiscatter GGX") + BSDF = Color * microfacet_multi_ggx(Normal, roughness, Color); + else + BSDF = Color * ashikhmin_shirley(Normal, vector(0, 0, 0), roughness, roughness); } - |