You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#jira UE-144726, UE-137516 #preflight 62228e4eb066ef60bbbefa5e #rb ben.ingram [CL 19297515 by michael balzer in ue5-main branch]
53 lines
1.4 KiB
Plaintext
53 lines
1.4 KiB
Plaintext
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
/*=============================================================================
|
|
SimpleElementVertexShader.hlsl: Vertex shader for drawing simple elements.
|
|
=============================================================================*/
|
|
|
|
#include "Common.ush"
|
|
|
|
#ifndef ALLOW_SWITCH_VERTICALAXIS
|
|
#define ALLOW_SWITCH_VERTICALAXIS 0
|
|
#endif
|
|
|
|
#ifndef ENABLE_LWC
|
|
#define ENABLE_LWC 0
|
|
#endif
|
|
|
|
float4x4 Transform;
|
|
#if ENABLE_LWC
|
|
float3 TransformTilePosition;
|
|
#endif
|
|
|
|
float SwitchVerticalAxis;
|
|
|
|
void Main(
|
|
in float4 InRelativePosition : ATTRIBUTE0,
|
|
in float4 InTilePosition : ATTRIBUTE1,
|
|
in float2 InTextureCoordinate : ATTRIBUTE2,
|
|
in float4 InColor : ATTRIBUTE3,
|
|
in float4 InHitProxyId : ATTRIBUTE4,
|
|
out float2 OutTextureCoordinate : TEXCOORD0,
|
|
out float4 OutColor : TEXCOORD1,
|
|
out float4 OutHitProxyId : TEXCOORD2,
|
|
out float4 OutPosition : SV_POSITION
|
|
)
|
|
{
|
|
#if ENABLE_LWC
|
|
FLWCVector4 InPosition = MakeLWCVector4(InTilePosition, InRelativePosition);
|
|
FLWCInverseMatrix WorldToClip = MakeLWCInverseMatrix(TransformTilePosition, Transform);
|
|
OutPosition = LWCMultiply(InPosition, WorldToClip);
|
|
OutPosition.z = max(OutPosition.z, 0);
|
|
#else
|
|
OutPosition = mul(InRelativePosition, Transform);
|
|
#endif
|
|
|
|
#if ALLOW_SWITCH_VERTICALAXIS
|
|
OutPosition.y *= SwitchVerticalAxis;
|
|
#endif
|
|
|
|
OutTextureCoordinate = InTextureCoordinate;
|
|
OutColor = InColor;
|
|
OutHitProxyId = InHitProxyId;
|
|
}
|