bSupportsRayTracing
bSupportsRayTracing
#Overview
name: bSupportsRayTracing
The value of this variable can be defined or overridden in .ini config files. 7
.ini config files referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bSupportsRayTracing is to indicate whether a specific shader platform supports ray tracing capabilities in Unreal Engine 5. This variable is crucial for the rendering system, particularly for advanced lighting and visual effects.
The bSupportsRayTracing variable is primarily used within the RHI (Rendering Hardware Interface) module of Unreal Engine. It’s part of the FGenericDataDrivenShaderPlatformInfo class, which provides information about shader platform capabilities.
The value of this variable is set during the parsing of data-driven shader information, as seen in the ParseDataDrivenShaderInfo function in DataDrivenShaderPlatformInfo.cpp.
Several other variables interact with bSupportsRayTracing, including:
- bSupportsRayTracingShaders
- bSupportsInlineRayTracing
- bSupportsRayTracingCallableShaders
- bSupportsRayTracingProceduralPrimitive
- bSupportsRayTracingTraversalStatistics
- bSupportsRayTracingIndirectInstanceData
- bSupportsHighEndRayTracingEffects
- bSupportsPathTracing
These variables are used in combination with bSupportsRayTracing to determine specific ray tracing capabilities for a given platform.
Developers must be aware that this variable is platform-specific and its value can affect the availability of various ray tracing features in their game or application. It’s essential to check this variable before attempting to use any ray tracing functionality.
Best practices when using this variable include:
- Always check if ray tracing is supported before using related features.
- Use the provided static functions (like GetSupportsRayTracing) to query ray tracing support, rather than accessing the variable directly.
- Consider providing fallback rendering methods for platforms that don’t support ray tracing.
- Be aware of the performance implications of using ray tracing, especially on platforms where it’s newly supported or less optimized.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/Android/DataDrivenPlatformInfo.ini:110, section: [ShaderPlatform VULKAN_SM5_ANDROID]
- INI Section:
ShaderPlatform VULKAN_SM5_ANDROID
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/Mac/DataDrivenPlatformInfo.ini:55, section: [ShaderPlatform METAL_SM5]
- INI Section:
ShaderPlatform METAL_SM5
- Raw value:
false
- Is Array:
False
Location: <Workspace>/Engine/Config/Mac/DataDrivenPlatformInfo.ini:95, section: [ShaderPlatform METAL_SM6]
- INI Section:
ShaderPlatform METAL_SM6
- Raw value:
false
- Is Array:
False
Location: <Workspace>/Engine/Config/VulkanPC/DataDrivenPlatformInfo.ini:50, section: [ShaderPlatform VULKAN_SM5]
- INI Section:
ShaderPlatform VULKAN_SM5
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/VulkanPC/DataDrivenPlatformInfo.ini:174, section: [ShaderPlatform VULKAN_SM6]
- INI Section:
ShaderPlatform VULKAN_SM6
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/Windows/DataDrivenPlatformInfo.ini:41, section: [ShaderPlatform PCD3D_SM5]
- INI Section:
ShaderPlatform PCD3D_SM5
- Raw value:
true
- Is Array:
False
Location: <Workspace>/Engine/Config/Windows/DataDrivenPlatformInfo.ini:92, section: [ShaderPlatform PCD3D_SM6]
- INI Section:
ShaderPlatform PCD3D_SM6
- Raw value:
true
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/DataDrivenShaderPlatformInfo.cpp:219
Scope (from outer to inner):
file
function void FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo
Source code excerpt:
GET_SECTION_BOOL_HELPER(bSupportsShaderBundleDispatch);
GET_SECTION_BOOL_HELPER(bSupportsRenderTargetWriteMask);
GET_SECTION_BOOL_HELPER(bSupportsRayTracing);
GET_SECTION_BOOL_HELPER(bSupportsRayTracingShaders);
GET_SECTION_BOOL_HELPER(bSupportsInlineRayTracing);
GET_SECTION_BOOL_HELPER(bSupportsRayTracingCallableShaders);
GET_SECTION_BOOL_HELPER(bSupportsRayTracingProceduralPrimitive);
GET_SECTION_BOOL_HELPER(bSupportsRayTracingTraversalStatistics);
GET_SECTION_BOOL_HELPER(bSupportsRayTracingIndirectInstanceData);
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/DataDrivenShaderPlatformInfo.h:45
Scope (from outer to inner):
file
class class FGenericDataDrivenShaderPlatformInfo
Source code excerpt:
uint32 bSupportsShaderBundleDispatch : 1;
uint32 bSupportsRenderTargetWriteMask : 1;
uint32 bSupportsRayTracing : 1;
uint32 bSupportsRayTracingCallableShaders : 1;
uint32 bSupportsRayTracingProceduralPrimitive : 1;
uint32 bSupportsRayTracingTraversalStatistics : 1;
uint32 bSupportsRayTracingIndirectInstanceData : 1; // Whether instance transforms can be copied from the GPU to the TLAS instances buffer
uint32 bSupportsHighEndRayTracingEffects : 1; // Whether fully-featured RT effects can be used on the platform (with translucent shadow, etc.)
uint32 bSupportsPathTracing : 1; // Whether real-time path tracer is supported on this platform (avoids compiling unnecessary shaders)
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/DataDrivenShaderPlatformInfo.h:341
Scope (from outer to inner):
file
class class FGenericDataDrivenShaderPlatformInfo
function static const bool GetSupportsRayTracing
Source code excerpt:
{
check(IsValid(Platform));
return Infos[Platform].bSupportsRayTracing;
}
static FORCEINLINE_DEBUGGABLE const bool GetSupportsRayTracingShaders(const FStaticShaderPlatform Platform)
{
check(IsValid(Platform));
return Infos[Platform].bSupportsRayTracing && Infos[Platform].bSupportsRayTracingShaders;
}
static FORCEINLINE_DEBUGGABLE const bool GetSupportsInlineRayTracing(const FStaticShaderPlatform Platform)
{
check(IsValid(Platform));
return Infos[Platform].bSupportsRayTracing && Infos[Platform].bSupportsInlineRayTracing;
}
static FORCEINLINE_DEBUGGABLE const bool GetSupportsRayTracingCallableShaders(const FStaticShaderPlatform Platform)
{
check(IsValid(Platform));
return Infos[Platform].bSupportsRayTracing && Infos[Platform].bSupportsRayTracingCallableShaders;
}
static FORCEINLINE_DEBUGGABLE const bool GetSupportsRayTracingProceduralPrimitive(const FStaticShaderPlatform Platform)
{
check(IsValid(Platform));
return Infos[Platform].bSupportsRayTracing && Infos[Platform].bSupportsRayTracingProceduralPrimitive;
}
static FORCEINLINE_DEBUGGABLE const bool GetSupportsRayTracingTraversalStatistics(const FStaticShaderPlatform Platform)
{
check(IsValid(Platform));
return Infos[Platform].bSupportsRayTracing && Infos[Platform].bSupportsRayTracingTraversalStatistics;
}
static FORCEINLINE_DEBUGGABLE const bool GetSupportsRayTracingIndirectInstanceData(const FStaticShaderPlatform Platform)
{
check(IsValid(Platform));
return Infos[Platform].bSupportsRayTracing && Infos[Platform].bSupportsRayTracingIndirectInstanceData;
}
static FORCEINLINE_DEBUGGABLE const bool GetSupportsPathTracing(const FStaticShaderPlatform Platform)
{
check(IsValid(Platform));
return Infos[Platform].bSupportsRayTracing && Infos[Platform].bSupportsPathTracing;
}
static FORCEINLINE_DEBUGGABLE const bool GetSupportsHighEndRayTracingEffects(const FStaticShaderPlatform Platform)
{
check(IsValid(Platform));
return Infos[Platform].bSupportsRayTracing && Infos[Platform].bSupportsHighEndRayTracingEffects;
}
static FORCEINLINE_DEBUGGABLE const bool GetSupportsComputeFramework(const FStaticShaderPlatform Platform)
{
check(IsValid(Platform));
return Infos[Platform].bSupportsComputeFramework;