You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
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]
27 lines
687 B
Plaintext
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 |