lygia
/lighting
/diffuse
/burley
)Calculate diffuse contribution using burley equation
Dependencies:
Use:
<float> diffuseBurley(<vec3> light, <vec3> normal [, <vec3> view, <float> roughness])
<float> diffuseBurley(<vec3> L, <vec3> N, <vec3> V, <float> NoV, <float> NoL, <float> roughness)
#ifndef FNC_DIFFUSE_BURLEY
#define FNC_DIFFUSE_BURLEY
float diffuseBurley(const in float NoV, const in float NoL, const in float LoH, const in float linearRoughness) {
// Burley 2012, "Physically-Based Shading at Disney"
float f90 = 0.5 + 2.0 * linearRoughness * LoH * LoH;
float lightScatter = schlick(1.0, f90, NoL);
float viewScatter = schlick(1.0, f90, NoV);
return lightScatter * viewScatter;
}
float diffuseBurley(ShadingData shadingData) {
float LoH = dot(shadingData.L, shadingData.H);
return diffuseBurley(shadingData.NoV, shadingData.NoL, LoH, shadingData.linearRoughness);
}
#endif
Dependencies:
Use:
<float> diffuseBurley(<float3> light, <float3> normal [, <float3> view, <float> roughness] )
<float> diffuseBurley(<float3> L, <float3> N, <float3> V, <float> NoV, <float> NoL, <float> roughness)
#ifndef FNC_DIFFUSE_BURLEY
#define FNC_DIFFUSE_BURLEY
float diffuseBurley(float NoV, float NoL, float LoH, float linearRoughness) {
// Burley 2012, "Physically-Based Shading at Disney"
float f90 = 0.5 + 2.0 * linearRoughness * LoH * LoH;
float lightScatter = schlick(1.0, f90, NoL);
float viewScatter = schlick(1.0, f90, NoV);
return lightScatter * viewScatter;
}
float diffuseBurley(ShadingData shadingData) {
float LoH = dot(shadingData.L, shadingData.H);
return diffuseBurley(shadingData.NoV, shadingData.NoL, LoH, shadingData.linearRoughness);
}
#endif
LYGIA is dual-licensed under the Prosperity License and the Patron License for sponsors and contributors.
Sponsors and contributors are automatically added to the Patron License and they can ignore the any non-commercial rule of the Prosperity Licensed software (please take a look to the exception).
It's also possible to get a permanent comercial license hook to a single and specific version of LYGIA.
Sign up for the news letter bellow, joing the LYGIA's channel on Discord or follow the Github repository