Started the project... finally...

Started the project. This right now only includes Meta XR and Android setup with VR template. More improvements to come!
This commit is contained in:
2024-05-06 20:03:14 +03:00
parent 372d02a195
commit e55214a398
1201 changed files with 181249 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "/Engine/Public/Platform.ush"
#define NUM_VIEWS 2
// PS Textures Parameters
Texture2DArray EnvironmentDepthTexture;
SamplerState EnvironmentDepthSampler;
float2 DepthFactors;
float4x4 ScreenToDepthMatrices[NUM_VIEWS];
int DepthViewId;
void HardOcclusionsPS(
noperspective float4 UVAndScreenPos : TEXCOORD0,
float4 SvPosition : SV_POSITION,
#if INSTANCED_STEREO
in uint InstanceId : SV_InstanceID,
#elif MOBILE_MULTI_VIEW
in uint ViewId : SV_ViewID,
#endif
out float4 OutColor : SV_Target0,
out float OutDepth : SV_DEPTH)
{
#if INSTANCED_STEREO
uint ViewId = InstanceId & 1;
#elif !MOBILE_MULTI_VIEW
uint ViewId = DepthViewId;
#endif
float4 TexCoordH = mul(ScreenToDepthMatrices[ViewId], float4(UVAndScreenPos.x, 1.0f - UVAndScreenPos.y, 0.0, 1.0));
float3 TexCoord = float3(TexCoordH.x / TexCoordH.w, TexCoordH.y / TexCoordH.w, ViewId);
float InputDepthEye = EnvironmentDepthTexture.Sample(EnvironmentDepthSampler, TexCoord).r;
float DepthEye = InputDepthEye * DepthFactors.x + DepthFactors.y;
OutDepth = DepthEye;
OutColor = float4(0.0, 0.0, 0.0, 1.0);
}

View File

@@ -0,0 +1,25 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "/Engine/Private/Common.ush"
Texture2DArray InTexture;
SamplerState InTextureSampler;
int MipLevel;
int ArraySlice;
void MainMipLevel(
FScreenVertexOutput Input,
out float4 OutColor : SV_Target0
)
{
OutColor = InTexture.SampleLevel(InTextureSampler, float3(Input.UV, ArraySlice), MipLevel);
}
void MainsRGBSourceMipLevel(
FScreenVertexOutput Input,
out float4 OutColor : SV_Target0
)
{
OutColor = InTexture.SampleLevel(InTextureSampler, float3(Input.UV, ArraySlice), MipLevel);
OutColor.rgb = pow( OutColor.rgb, 1.0f / 2.2f );
}