From a3c74c361ccba6f0ecee686d7e336cf905246c38 Mon Sep 17 00:00:00 2001 From: yum Date: Sun, 18 Jan 2026 09:02:07 -0800 Subject: Impostors: combine metallic gloss & depth atlases --- impostor.cginc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'impostor.cginc') diff --git a/impostor.cginc b/impostor.cginc index 048eaf6..1afbdea 100755 --- a/impostor.cginc +++ b/impostor.cginc @@ -108,7 +108,7 @@ AtlasUvGrad PrepareAtlasUvGrad(float2 cell, float2 uvInCell, float invGridRes) { float SampleImpostorDepthCell(float2 cell, float2 uvInCell, float invGridRes) { AtlasUvGrad uv = PrepareAtlasUvGrad(cell, uvInCell, invGridRes); - return _Impostors_Depth_Atlas.SampleGrad(bilinear_clamp_s, uv.atlasUv, uv.gradX, uv.gradY).r; + return _Impostors_Metallic_Gloss_Depth_Atlas.SampleGrad(bilinear_clamp_s, uv.atlasUv, uv.gradX, uv.gradY).b; } float SampleImpostorAlphaCell(float2 cell, float2 uvInCell, float invGridRes) { @@ -121,7 +121,8 @@ ImpostorSample SampleImpostorCell(float2 cell, float2 uvInCell, float invGridRes ImpostorSample s; s.albedo = _Impostors_Atlas.SampleGrad(bilinear_clamp_s, uv.atlasUv, uv.gradX, uv.gradY); s.normal = _Impostors_Normal_Atlas.SampleGrad(bilinear_clamp_s, uv.atlasUv, uv.gradX, uv.gradY); - s.metallicGloss = _Impostors_Metallic_Gloss_Atlas.SampleGrad(bilinear_clamp_s, uv.atlasUv, uv.gradX, uv.gradY); + float4 mgd = _Impostors_Metallic_Gloss_Depth_Atlas.SampleGrad(bilinear_clamp_s, uv.atlasUv, uv.gradX, uv.gradY); + s.metallicGloss = float4(mgd.rg, 0, 0); return s; } @@ -331,7 +332,7 @@ ImpostorResult impostor_frag(float3 worldPos) { float3 normalOS = blended.normal.xyz * 2.0 - 1.0; result.normal = normalize(mul((float3x3)unity_ObjectToWorld, normalOS)); result.metallic = blended.metallicGloss.r; - result.smoothness = blended.metallicGloss.a; + result.smoothness = blended.metallicGloss.g; #if defined(_IMPOSTORS_DEPTH) // Reuse depth samples for position reconstruction -- cgit v1.2.3