Restore fog history alpha contract
This commit is contained in:
parent
080e894236
commit
7116847ffb
2 changed files with 9 additions and 5 deletions
|
|
@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue