SetGlobalRayTracingAccelerationStructure
Sets a global RayTracingAccelerationStructure property for all shaders.
Read time 2 minutesLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
SetGlobalRayTracingAccelerationStructure(string, RayTracingAccelerationStructure)
Sets a global RayTracingAccelerationStructure property for all shaders.
public static void SetGlobalRayTracingAccelerationStructure(string name, RayTracingAccelerationStructure value)
Parameters
The name of the acceleration structure in shader code.
The acceleration structure to set.
Remarks
This command binds a RayTracingAccelerationStructure object to all shader stages. You can use the acceleration structure for inline ray tracing (ray queries) or as an argument in calls in ray tracing shaders. The RayTracingAccelerationStructure object must be built using the RayTracingAccelerationStructure.Build method before calling this command.
TraceRayRay queries can be used to perform acceleration structure traversal and geometry intersection tests. To access this functionality, the HLSL code must be compiled using the directive or by using the built-in shader keyword (for example, #pragma multi_compile _ UNITY_DEVICE_SUPPORTS_INLINE_RAY_TRACING).
#pragma require inlineraytracingUNITY_DEVICE_SUPPORTS_INLINE_RAY_TRACINGAdditional Resources: CommandBuffer.SetGlobalRayTracingAccelerationStructure, SystemInfo.supportsRayTracingShaders, SystemInfo.supportsInlineRayTracing.
SetGlobalRayTracingAccelerationStructure(int, RayTracingAccelerationStructure)
Sets a global RayTracingAccelerationStructure property for all shaders.
public static void SetGlobalRayTracingAccelerationStructure(int nameID, RayTracingAccelerationStructure value)
Parameters
The name ID of the acceleration structure in shader code. Use Shader.PropertyToID to get this value.
The acceleration structure to set.
Remarks
This command binds a RayTracingAccelerationStructure object to all shader stages. You can use the acceleration structure for inline ray tracing (ray queries) or as an argument in calls in ray tracing shaders. The RayTracingAccelerationStructure object must be built using the RayTracingAccelerationStructure.Build method before calling this command.
TraceRayRay queries can be used to perform acceleration structure traversal and geometry intersection tests. To access this functionality, the HLSL code must be compiled using the directive or by using the built-in shader keyword (for example, #pragma multi_compile _ UNITY_DEVICE_SUPPORTS_INLINE_RAY_TRACING).
#pragma require inlineraytracingUNITY_DEVICE_SUPPORTS_INLINE_RAY_TRACING