diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-06-08 14:46:12 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-06-14 15:49:57 +0400 |
commit | b12151eceb76cab4a49f9df661ce6156bbeaaa21 (patch) | |
tree | c2815e24e4bc45e840efc6ff1069684c5c4a3049 /intern/cycles/kernel/shaders | |
parent | ceb68e809edf37ea3fd010692dc3f4367b78cf61 (diff) |
Cycles: glossy and anisotropic BSDF changes
* Anisotropic BSDF now supports GGX and Beckmann distributions, Ward has been
removed because other distributions are superior.
* GGX is now the default distribution for all glossy and anisotropic nodes,
since it looks good, has low noise and is fast to evaluate.
* Ashikhmin-Shirley is now available in the Glossy BSDF.
Diffstat (limited to 'intern/cycles/kernel/shaders')
-rw-r--r-- | intern/cycles/kernel/shaders/node_anisotropic_bsdf.osl | 12 | ||||
-rw-r--r-- | intern/cycles/kernel/shaders/node_glossy_bsdf.osl | 4 | ||||
-rw-r--r-- | intern/cycles/kernel/shaders/stdosl.h | 3 |
3 files changed, 13 insertions, 6 deletions
diff --git a/intern/cycles/kernel/shaders/node_anisotropic_bsdf.osl b/intern/cycles/kernel/shaders/node_anisotropic_bsdf.osl index 3ecf5b46bef..da1e4f77107 100644 --- a/intern/cycles/kernel/shaders/node_anisotropic_bsdf.osl +++ b/intern/cycles/kernel/shaders/node_anisotropic_bsdf.osl @@ -18,7 +18,7 @@ shader node_anisotropic_bsdf( color Color = 0.0, - string distribution = "Ward", + string distribution = "GGX", float Roughness = 0.0, float Anisotropy = 0.0, float Rotation = 0.0, @@ -45,9 +45,13 @@ shader node_anisotropic_bsdf( RoughnessV = Roughness / (1.0 - aniso); } - if (distribution == "Ashikhmin-Shirley") - BSDF = Color * ashikhmin_shirley(Normal, T, RoughnessU, RoughnessV); + if (distribution == "Sharp") + BSDF = Color * reflection(Normal); + else if (distribution == "Beckmann") + BSDF = Color * microfacet_beckmann_aniso(Normal, T, RoughnessU, RoughnessV); + else if (distribution == "GGX") + BSDF = Color * microfacet_ggx_aniso(Normal, T, RoughnessU, RoughnessV); else - BSDF = Color * ward(Normal, T, RoughnessU, RoughnessV); + BSDF = Color * ashikhmin_shirley(Normal, T, RoughnessU, RoughnessV); } diff --git a/intern/cycles/kernel/shaders/node_glossy_bsdf.osl b/intern/cycles/kernel/shaders/node_glossy_bsdf.osl index b4e0fe62223..5c727ca6917 100644 --- a/intern/cycles/kernel/shaders/node_glossy_bsdf.osl +++ b/intern/cycles/kernel/shaders/node_glossy_bsdf.osl @@ -19,7 +19,7 @@ shader node_glossy_bsdf( color Color = 0.8, - string distribution = "Beckmann", + string distribution = "GGX", float Roughness = 0.2, normal Normal = N, output closure color BSDF = 0) @@ -30,6 +30,8 @@ shader node_glossy_bsdf( BSDF = Color * microfacet_beckmann(Normal, Roughness); else if (distribution == "GGX") BSDF = Color * microfacet_ggx(Normal, Roughness); + else + BSDF = Color * ashikhmin_shirley(Normal, vector(0, 0, 0), Roughness, Roughness); } diff --git a/intern/cycles/kernel/shaders/stdosl.h b/intern/cycles/kernel/shaders/stdosl.h index 20ee4a3df32..e39db8097f2 100644 --- a/intern/cycles/kernel/shaders/stdosl.h +++ b/intern/cycles/kernel/shaders/stdosl.h @@ -483,11 +483,12 @@ closure color reflection(normal N) BUILTIN; closure color refraction(normal N, float eta) BUILTIN; closure color transparent() BUILTIN; closure color microfacet_ggx(normal N, float ag) BUILTIN; +closure color microfacet_ggx_aniso(normal N, vector T, float ax, float ay) BUILTIN; closure color microfacet_ggx_refraction(normal N, float ag, float eta) BUILTIN; closure color microfacet_beckmann(normal N, float ab) BUILTIN; +closure color microfacet_beckmann_aniso(normal N, vector T, float ax, float ay) BUILTIN; closure color microfacet_beckmann_refraction(normal N, float ab, float eta) BUILTIN; closure color ashikhmin_shirley(normal N, vector T,float ax, float ay) BUILTIN; -closure color ward(normal N, vector T,float ax, float ay) BUILTIN; closure color ashikhmin_velvet(normal N, float sigma) BUILTIN; closure color emission() BUILTIN; closure color background() BUILTIN; |