From cb101b9bd1f0e9dbfcfe45d114d1a63af3e85d82 Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 11 Nov 2025 17:26:35 -0800 Subject: fix energy conservation issues; notably smooth=0 metallic=1 matches filamented now --- filamented.cginc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'filamented.cginc') diff --git a/filamented.cginc b/filamented.cginc index f6bd67a..62ec4c3 100644 --- a/filamented.cginc +++ b/filamented.cginc @@ -254,6 +254,10 @@ UnityGIInput InitialiseUnityGIInput(float3 worldPos, float3 view_dir) return d; } +float3 getSpecularDominantDirection(const float3 n, const float3 r, float roughness) { + return lerp(r, n, roughness * roughness); +} + inline half3 UnityGI_prefilteredRadiance(const UnityGIInput data, const float perceptualRoughness, const float3 r) { half3 specular; -- cgit v1.2.3