Restore fog history alpha contract

This commit is contained in:
Meta Vens 2026-07-16 20:40:23 +01:00
commit 7116847ffb
2 changed files with 9 additions and 5 deletions

View file

@ -30,6 +30,12 @@ namespace Aetheria.Editor
if (second < 0)
throw new InvalidOperationException(
"Gravity-fog raymarching and temporal reprojection must both use the historical positive-Z Unity shader camera transform.");
const string directHistoryDensity = "saturate(currSample.a) * _CompositeOpacity";
if (source.IndexOf(directHistoryDensity, StringComparison.Ordinal) < 0 ||
source.IndexOf("unpack(currSample.a", StringComparison.Ordinal) >= 0)
throw new InvalidOperationException(
"Gravity-fog composite must consume the temporal history's direct density alpha without unpacking it as a raymarch payload.");
}
}
}

View file

@ -339,7 +339,6 @@ Shader "Aetheria/CloudShader"
#pragma fragment frag
#include "UnityCG.cginc"
#include "Assets/Shaders/PackFloat.cginc"
sampler2D _CloudTex; //The full resolution cloud tex we generated.
sampler2D _CameraDepthTexture;
@ -369,10 +368,9 @@ Shader "Aetheria/CloudShader"
half4 frag(v2f i) : SV_Target
{
float4 currSample = tex2D(_CloudTex, i.uv);
float distance;
float density;
unpack(currSample.a, distance, density);
return half4(currSample.rgb * _CompositeOpacity, saturate(density) * _CompositeOpacity);
return half4(
currSample.rgb * _CompositeOpacity,
saturate(currSample.a) * _CompositeOpacity);
}
ENDCG
}