Files
UnrealEngineUWP/Engine/Shaders/Private/RayTracing/RayTracingShaderUtils.ush
chris kulla 37c6fda89c Materials: Implement GetShadowReplaceState for raytraced shadows
Raytracing shaders are shared across raytraced effects, so introduce a global variable that gets set from the ray payload flags to implement this function. This is similar to how the path tracing ray specific behavior is implemented.


#jira UE-186726
#rb Aleksander.Netzel
#preflight 646d4afa2c0a5da0dcb310a9

[CL 25596730 by chris kulla in ue5-main branch]
2023-05-23 20:37:23 -04:00

27 lines
687 B
Plaintext

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
// This file contains utility methods that can be used by ray tracing shaders (such as the CHS/AHS pairs, light miss shaders, etc ...)
#ifndef RAYHITGROUPSHADER
#error "This header should only be included in raytracing contexts"
#endif
#ifndef PATH_TRACING // Path Tracing has a similar implemental with a slightly different set of flags
#include "RayTracingCommon.ush"
static int CurrentPayloadInputFlags = 0;
bool GetShadowReplaceState()
{
return (CurrentPayloadInputFlags & RAY_TRACING_PAYLOAD_INPUT_FLAG_SHADOW_RAY) != 0;
}
float IsShadowDepthShader()
{
return GetShadowReplaceState() ? 1.0f : 0.0f;
}
#endif