diff options
Diffstat (limited to 'brdf.cginc')
| -rw-r--r-- | brdf.cginc | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -12,6 +12,10 @@ float pow5(float x) { return x2 * x2 * x; } +float Fd_Lambertian(float NoL) { + return NoL; +} + // Schlick "An Inexpensive BRDF Model for Physically-based Rendering". // Equation 24. // f0: Reflectance at normal incidence. Typically around 0.04. @@ -209,7 +213,11 @@ float4 brdf(Pbr pbr, LightData data) { direct_specular = max(0, direct_specular); specular += direct_specular; +#if defined(F_OREN_NAYAR) float Fd = Fd_OrenNayar(pbr.roughness, data.common.NoV, data.direct.NoL, data.direct.LoV); +#else + float Fd = Fd_Lambertian(data.direct.NoL); +#endif float3 direct_diffuse = Fd * (1.0f - pbr.metallic) * pbr.albedo.xyz * data.direct.color; direct_diffuse *= layer_attenuation; direct_diffuse = max(0, direct_diffuse); |
