summaryrefslogtreecommitdiffstats
path: root/yum_lighting.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-07-30 17:10:34 -0700
committeryum <yum.food.vr@gmail.com>2025-07-30 17:13:36 -0700
commitbe4c8a8ee8eaf892d008835225dfd897d259d793 (patch)
treeeadb32c3c0351a71225a98f0df95e4dcdf359833 /yum_lighting.cginc
parenteba91b479fb6476fed06b13906d7805f43f879b6 (diff)
buncha shit
- overhaul gradient normals to take a (dFy/dx, dFy/dz) input, and optionally two more: (dFx/dx, dFx/dz) and (dFz/dx, dFz/z) - this is what fft water needs - put YumPbr into data.cginc - fix tessellation compiler errors - remove tessellation frustum culling, seems to have been buggy - remove not impactful brdf code
Diffstat (limited to 'yum_lighting.cginc')
-rw-r--r--yum_lighting.cginc9
1 files changed, 3 insertions, 6 deletions
diff --git a/yum_lighting.cginc b/yum_lighting.cginc
index 88e8da7..423f4cf 100644
--- a/yum_lighting.cginc
+++ b/yum_lighting.cginc
@@ -126,9 +126,6 @@ float GetLodRoughness(float roughness) {
float3 getIndirectSpecular(v2f i, YumPbr pbr, float3 view_dir, float diffuse_luminance) {
float3 reflect_dir = reflect(-view_dir, pbr.normal);
-
- // Apply dominant direction modification for rough surfaces
- float3 dominant_reflect_dir = lerp(reflect_dir, pbr.normal, pbr.roughness * pbr.roughness);
UnityGIInput data;
data.worldPos = i.worldPos;
@@ -146,8 +143,8 @@ float3 getIndirectSpecular(v2f i, YumPbr pbr, float3 view_dir, float diffuse_lum
data.probePosition[1] = unity_SpecCube1_ProbePosition;
#endif
- // Pass perceptualRoughness directly - UnityGI_prefilteredRadiance handles remapping internally
- const float3 env_refl = UnityGI_prefilteredRadiance(data, pbr.roughness_perceptual, dominant_reflect_dir);
+ // Apply roughness adjustment to match filamented's behavior
+ float3 env_refl = UnityGI_prefilteredRadiance(data, pbr.roughness_perceptual, reflect_dir);
#if defined(_FALLBACK_CUBEMAP)
// Check if there's no valid scene cubemap
@@ -155,7 +152,7 @@ float3 getIndirectSpecular(v2f i, YumPbr pbr, float3 view_dir, float diffuse_lum
if (!SceneHasReflections() || _Fallback_Cubemap_Force) {
// Set up data for fallback sampling similar to Unity's system
half3 reflectVector = reflect(-view_dir, pbr.normal);
-
+
#ifdef UNITY_SPECCUBE_BOX_PROJECTION
reflectVector = BoxProjectedCubemapDirection(reflectVector, data.worldPos, /*probe_position=*/0, /*box_min=*/-1, /*box_max=*/1);
#endif