summaryrefslogtreecommitdiffstats
path: root/yum_brdf.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-07-29 14:13:09 -0700
committeryum <yum.food.vr@gmail.com>2025-07-29 14:13:09 -0700
commiteba91b479fb6476fed06b13906d7805f43f879b6 (patch)
tree0075c78dc884d579c884b67cd36372f8af725e39 /yum_brdf.cginc
parentf1ccfe1d74846df120be984cb09d45ec7e17810c (diff)
Add "gradient xz normals" feature
Take in the gradient of a 2D heightmap (y is up) in one or more channels, sum them up, then convert to normal.
Diffstat (limited to 'yum_brdf.cginc')
-rw-r--r--yum_brdf.cginc6
1 files changed, 3 insertions, 3 deletions
diff --git a/yum_brdf.cginc b/yum_brdf.cginc
index daa6793..2d07440 100644
--- a/yum_brdf.cginc
+++ b/yum_brdf.cginc
@@ -126,11 +126,11 @@ float4 YumBRDF(v2f i, const YumLighting light, YumPbr pbr) {
// Compute proper diffuse color with metallic blending
float3 diffuseColor = computeDiffuseColor(pbr.albedo, pbr.metallic);
-
+
// Fd_Burley already includes 1/PI, so multiply by PI to match Unity intensities
float3 Fd = diffuseColor * Fd_Burley(pbr.roughness, NoV, NoL_wrapped_d, LoH) * PI;
Fd *= light.attenuation * pbr.ao;
-
+
// Multiply by PI to match Unity intensities (same as Filament's implementation)
float3 Fr = specularLobe(pbr, f0, h, LoH, NoH, NoV, NoL_wrapped_s) * PI * light.attenuation;
@@ -173,7 +173,7 @@ float4 YumBRDF(v2f i, const YumLighting light, YumPbr pbr) {
// Use proper diffuse color calculation
float3 diffuseColor = computeDiffuseColor(pbr.albedo, pbr.metallic);
float3 Fd = diffuseColor * light.diffuse * (1.0 - E) * pbr.ao;
-
+
float3 Fr = E * light.specular * specularSingleBounceAO;
indirect_standard = Fr + Fd;