You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb andrew.lauritzen #ROBOMERGE-SOURCE: CL 15878911 in //UE5/Release-5.0-EarlyAccess/... #ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533) [CL 15878950 by charles derousiers in ue5-main branch]
33 lines
1.2 KiB
Plaintext
33 lines
1.2 KiB
Plaintext
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
/*=============================================================================
|
|
ClusteredDeferredShadingVertexShader.usf:
|
|
=============================================================================*/
|
|
|
|
#include "HairStrands/HairStrandsVisibilityCommonStruct.ush"
|
|
#include "Common.ush"
|
|
|
|
struct FHairStrandsSamplesDesc
|
|
{
|
|
nointerpolation uint NodeCount : DISPATCH_NODECOUNT;
|
|
nointerpolation uint2 Resolution : DISPATCH_RESOLUTION;
|
|
};
|
|
|
|
// This vertex shader is only used with hair strands lighting
|
|
void ClusteredShadingVertexShader(
|
|
in uint InVertexId : SV_VertexID,
|
|
out float4 OutPosition : SV_POSITION,
|
|
nointerpolation out uint OutNodeCount : DISPATCH_NODECOUNT,
|
|
nointerpolation out uint2 OutResolution : DISPATCH_RESOLUTION)
|
|
{
|
|
OutNodeCount = HairStrands.HairSampleCount.Load(uint3(0,0,0));
|
|
OutResolution.x = ceil(sqrt(OutNodeCount));
|
|
OutResolution.y = OutResolution.x;
|
|
|
|
const float2 ClipCoord = ((OutResolution + 0.5f) / float2(HairStrands.HairSampleViewportResolution)) * 2;
|
|
|
|
const float2 UV = float2(InVertexId & 1, InVertexId >> 1);
|
|
const float2 Pos = float2(-UV.x, UV.y) * 4 + float2(-1, +1) + float2(ClipCoord.x, -ClipCoord.y);
|
|
OutPosition = float4(Pos, 0.5f, 1);
|
|
}
|