lygia
/lighting
/diffuse
/lambert
)Calculate diffuse contribution using lambert equation
Dependencies:
lygia
/math
/const
.glsl
lygia
/lighting
/shadingData
/shadingData
.glsl
Use:
<float> diffuseLambert(<vec3> light, <vec3> normal [, <vec3> view, <float> roughness])
<float> diffuseLambert(<vec3> L, <vec3> N, <vec3> V, <float> NoV, <float> NoL, <float> roughness)
#ifndef FNC_DIFFUSE_LAMBERT
#define FNC_DIFFUSE_LAMBERT
float diffuseLambertConstant() { return INV_PI; }
float diffuseLambertConstant(ShadingData shadingData) { return diffuseLambertConstant(); }
float diffuseLambert(const in vec3 L, const in vec3 N) { return max(0.0, dot(N, L)); }
float diffuseLambert(ShadingData shadingData) { return max(0.0, shadingData.NoL); }
#endif
Dependencies:
lygia
/math
/const
.glsl
lygia
/lighting
/shadingData
/shadingData
.glsl
Use:
<float> diffuseLambert(<float3> light, <float3> normal [, <float3> view, <float> roughness] )
<float> diffuseLambert(<float3> L, <float3> N, <float3> V, <float> NoV, <float> NoL, <float> roughness)
#ifndef FNC_DIFFUSE_LAMBERT
#define FNC_DIFFUSE_LAMBERT
float diffuseLambertConstant() { return INV_PI; }
float diffuseLambertConstant(ShadingData shadingData) { return diffuseLambertConstant(); }
float diffuseLambert(const in float3 L, const in float3 N) { return max(0.0, dot(N, L)); }
float diffuseLambert(ShadingData shadingData) { return max(0.0, shadingData.NoL); }
#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