You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
VCloud on translucent fading in region depth can now be controled via a cvar.
#rb none #preflight https://horde.devtools.epicgames.com/job/637617a43248425305c21519 [CL 23174402 by Sebastien Hillaire in ue5-main branch]
This commit is contained in:
@@ -1338,7 +1338,7 @@ void FPixelShaderInOut_MainPS(
|
||||
NDCPosition, LWCHackToFloat(MaterialParameters.AbsoluteWorldPosition), LWCHackToFloat(ResolvedView.WorldCameraOrigin),
|
||||
TranslucentBasePass.VolumetricCloudColor, TranslucentBasePass.VolumetricCloudColorSampler,
|
||||
TranslucentBasePass.VolumetricCloudDepth, TranslucentBasePass.VolumetricCloudDepthSampler,
|
||||
OneOverPreExposure, Fogging);
|
||||
OneOverPreExposure, Fogging, TranslucentBasePass.SoftBlendingDistanceKm);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -108,7 +108,7 @@ void Main(
|
||||
Output.Position, WorldPosition.xyz, ResolvedView.TranslatedWorldCameraOrigin,
|
||||
TranslucentBasePass.VolumetricCloudColor, TranslucentBasePass.VolumetricCloudColorSampler,
|
||||
TranslucentBasePass.VolumetricCloudDepth, TranslucentBasePass.VolumetricCloudDepthSampler,
|
||||
OneOverPreExposure, Output.BasePassInterpolants.VertexFog);
|
||||
OneOverPreExposure, Output.BasePassInterpolants.VertexFog, TranslucentBasePass.SoftBlendingDistanceKm);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ float4 GetCloudLuminanceTransmittanceOverFog(
|
||||
float4 NDC, float3 SampledWorldPos, float3 CameraWorldPos,
|
||||
Texture2D<float4> VolumetricCloudColor, SamplerState VolumetricCloudColorSampler,
|
||||
Texture2D<float4> VolumetricCloudDepth, SamplerState VolumetricCloudDepthSampler,
|
||||
float OneOverPreExposure, float4 CurrentVertexFog)
|
||||
float OneOverPreExposure, float4 CurrentVertexFog, float SoftBlendingDistanceKm)
|
||||
{
|
||||
float2 ScreenUv = (NDC.xy / NDC.ww) * float2(0.5f, -0.5f) + 0.5f;
|
||||
|
||||
@@ -99,7 +99,6 @@ float4 GetCloudLuminanceTransmittanceOverFog(
|
||||
float4 CloudFog = Texture2DSample(VolumetricCloudColor, VolumetricCloudColorSampler, ScreenUv);
|
||||
CloudFog.rgb *= OneOverPreExposure;
|
||||
|
||||
const float SoftBlendingDistanceKm = 0.5f;// 500 meters
|
||||
const float BlendFactor = saturate(DepthInsideKm / SoftBlendingDistanceKm);
|
||||
const float4 FogToApplyUnder = CurrentVertexFog;
|
||||
const float4 FogToApplyOver = lerp(float4(0.0, 0.0, 0.0, 1.0), CloudFog, BlendFactor);
|
||||
|
||||
Reference in New Issue
Block a user