@@ -146,4 +146,9 @@ vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in Ge
return F * ( G * D );
-} // validated
+} // validated
+
+// source: http://simonstechblog.blogspot.ca/2011/12/microfacet-brdf.html
+float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {
+ return ( 2.0 / square( ggxRoughness + 0.0001 ) - 2.0 );
+}
@@ -32,6 +32,6 @@ void PhysicalMaterial_RE_SpecularIndirectLight( const in vec3 indirectSpecularCo
}
-#define Material_BlinnShininessExponent( material ) ( 2.0 / square( material.specularRoughness + 0.0001 ) - 2.0 )
+#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )
#define Material_RE_IndirectSpecularLight PhysicalMaterial_RE_SpecularIndirectLight