/* SPDX-License-Identifier: Apache-2.0 * Copyright 2011-2022 Blender Foundation */ #include "node_fresnel.h" #include "stdcycles.h" 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); }