Files
UnrealEngine/Engine/Shaders/Private/HeightFogVertexShader.usf
2025-05-18 13:04:45 +08:00

26 lines
805 B
HLSL

// Copyright Epic Games, Inc. All Rights Reserved.
/*=============================================================================
HeightFogVertexShader.usf: Scene fogging vertex shader.
=============================================================================*/
#include "Common.ush"
void Main(
in float2 InPosition : ATTRIBUTE0,
out float2 OutTexCoord : TEXCOORD0,
out float3 OutScreenVector : TEXCOORD1,
out float4 OutPosition : SV_POSITION
)
{
ResolvedView = ResolveView();
// screenspace position from vb
OutPosition = float4(InPosition,0,1);
// texture coord from vb
OutTexCoord = InPosition * ResolvedView.ScreenPositionScaleBias.xy + ResolvedView.ScreenPositionScaleBias.wz;
// deproject to world space
OutScreenVector = ScreenVectorFromScreenRect(float4(InPosition,1,0));
}