Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/shaders/node_glossy_bsdf.osl
| Show All 13 Lines | |||||
| * limitations under the License | * limitations under the License | ||||
| */ | */ | ||||
| #include "stdosl.h" | #include "stdosl.h" | ||||
| #include "node_fresnel.h" | #include "node_fresnel.h" | ||||
| shader node_glossy_bsdf( | shader node_glossy_bsdf( | ||||
| color Color = 0.8, | color Color = 0.8, | ||||
| string distribution = "Beckmann", | string distribution = "GGX", | ||||
| float Roughness = 0.2, | float Roughness = 0.2, | ||||
| normal Normal = N, | normal Normal = N, | ||||
| output closure color BSDF = 0) | output closure color BSDF = 0) | ||||
| { | { | ||||
| if (distribution == "Sharp") | if (distribution == "Sharp") | ||||
| BSDF = Color * reflection(Normal); | BSDF = Color * reflection(Normal); | ||||
| else if (distribution == "Beckmann") | else if (distribution == "Beckmann") | ||||
| BSDF = Color * microfacet_beckmann(Normal, Roughness); | BSDF = Color * microfacet_beckmann(Normal, Roughness); | ||||
| else if (distribution == "GGX") | else if (distribution == "GGX") | ||||
| BSDF = Color * microfacet_ggx(Normal, Roughness); | BSDF = Color * microfacet_ggx(Normal, Roughness); | ||||
| else | |||||
| BSDF = Color * ashikhmin_shirley(Normal, vector(0, 0, 0), Roughness, Roughness); | |||||
| } | } | ||||