diff options
| author | yum <yum.food.vr@gmail.com> | 2025-11-11 21:03:58 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-11-11 21:03:58 -0800 |
| commit | 883e50070aca6017c9d71945c2c6e685938d12c4 (patch) | |
| tree | 472cda3216e65d443f894ce79b11b5fd1622a956 /brdf.cginc | |
| parent | 73686635d2e82659853a227338f0a826e32c3ab2 (diff) | |
switch to lambertian diffuse
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); |
