You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
ViewWorldOrigin -> WorldViewOrigin CameraWorldOrigin -> WorldCameraOrigin CameraTranslatedWorldOrigin -> TranslatedWorldCameraOrigin CameraWorldOriginDelta -> WorldCameraMovementSinceLastFrame PrevCameraWorldOrigin -> PrevWorldCameraOrigin PrevViewWorldOrigin -> PrevWorldViewOrigin #code_review: Martin.Mittring [CL 2666624 by Guillaume Abadie in Main branch]
29 lines
996 B
Plaintext
29 lines
996 B
Plaintext
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
/*=============================================================================
|
|
HeightFogPixelShader.usf: Scene fogging pixel shader.
|
|
=============================================================================*/
|
|
|
|
#include "Common.usf"
|
|
#include "SHCommon.usf"
|
|
#include "HeightFogCommon.usf"
|
|
|
|
Texture2D OcclusionTexture;
|
|
SamplerState OcclusionSampler;
|
|
|
|
void ExponentialPixelMain(
|
|
float2 TexCoord : TEXCOORD0,
|
|
float4 ScreenVector : TEXCOORD1,
|
|
out float4 OutColor : SV_Target0
|
|
)
|
|
{
|
|
float SceneDepth = CalcSceneDepth(TexCoord);
|
|
|
|
float3 CameraToReceiver = ScreenVector.xyz * SceneDepth;
|
|
float3 ReceiverPosition = CameraToReceiver + View.WorldCameraOrigin;
|
|
|
|
float LightShaftMask = Texture2DSample(OcclusionTexture, OcclusionSampler, TexCoord).x;
|
|
float4 ExponentialFog = GetExponentialHeightFog(ReceiverPosition, View.WorldCameraOrigin);
|
|
OutColor = RETURN_COLOR(float4(ExponentialFog.rgb * LightShaftMask, ExponentialFog.w));
|
|
}
|