You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Fixed a crash that can happen on exit. Further reduced self shadow artifact when using RTHF shadow. #ROBOMERGE-SOURCE: CL 11077247 via CL 11077248 via CL 11077250 #ROBOMERGE-BOT: (v637-11041722) [CL 11077251 by jian ru in Main branch]
44 lines
1.5 KiB
Plaintext
44 lines
1.5 KiB
Plaintext
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
/*=============================================================================
|
|
HeightFieldAtlasManagement.usf
|
|
=============================================================================*/
|
|
|
|
#include "Common.ush"
|
|
|
|
uint4 UpdateRegionOffsetAndSize;
|
|
float4 SourceScaleBias;
|
|
uint SourceMipBias;
|
|
|
|
Texture2D<float4> SourceTexture;
|
|
SamplerState SourceTextureSampler;
|
|
|
|
RWTexture2D<float2> RWHeightFieldAtlas;
|
|
|
|
[numthreads(THREADGROUP_SIZEX, THREADGROUP_SIZEY, 1)]
|
|
void UploadHeightFieldToAtlasCS(uint3 DispatchThreadId : SV_DispatchThreadID)
|
|
{
|
|
if (all(DispatchThreadId.xy < UpdateRegionOffsetAndSize.zw))
|
|
{
|
|
float2 SourceUV = DispatchThreadId.xy * SourceScaleBias.xy + SourceScaleBias.zw;
|
|
uint2 WriteCoord = DispatchThreadId.xy + UpdateRegionOffsetAndSize.xy;
|
|
|
|
RWHeightFieldAtlas[WriteCoord] = Texture2DSampleLevel(SourceTexture, SourceTextureSampler, SourceUV, SourceMipBias).xy;
|
|
}
|
|
}
|
|
|
|
float4 VisibilityChannelMask;
|
|
RWTexture2D<float> RWVisibilityAtlas;
|
|
|
|
[numthreads(THREADGROUP_SIZEX, THREADGROUP_SIZEY, 1)]
|
|
void UploadVisibilityToAtlasCS(uint3 DispatchThreadId : SV_DispatchThreadID)
|
|
{
|
|
if (all(DispatchThreadId.xy < UpdateRegionOffsetAndSize.zw))
|
|
{
|
|
float2 SourceUV = DispatchThreadId.xy * SourceScaleBias.xy + SourceScaleBias.zw;
|
|
uint2 WriteCoord = DispatchThreadId.xy + UpdateRegionOffsetAndSize.xy;
|
|
|
|
RWVisibilityAtlas[WriteCoord] = dot(Texture2DSampleLevel(SourceTexture, SourceTextureSampler, SourceUV, SourceMipBias), VisibilityChannelMask);
|
|
}
|
|
}
|