Version: Unity 6 Beta (6000.0)
LanguageEnglish
  • C#

Shader.SetGlobalRayTracingAccelerationStructure

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual

Declaration

public static void SetGlobalRayTracingAccelerationStructure(string name, Rendering.RayTracingAccelerationStructure value);

Declaration

public static void SetGlobalRayTracingAccelerationStructure(int nameID, Rendering.RayTracingAccelerationStructure value);

Parameters

name The name of the acceleration structure in shader code.
nameID The name ID of the acceleration structure in shader code. Use Shader.PropertyToID to get this value.
value The acceleration structure to set.

Description

Sets a global RayTracingAccelerationStructure property for all shaders.

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 TraceRay calls in ray tracing shaders. The RayTracingAccelerationStructure object must be built using the RayTracingAccelerationStructure.Build method before calling this command.

Ray 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 #pragma require inlineraytracing directive or by using the built-in shader keyword UNITY_DEVICE_SUPPORTS_INLINE_RAY_TRACING (for example, #pragma multi_compile _ UNITY_DEVICE_SUPPORTS_INLINE_RAY_TRACING).

Additional resources: CommandBuffer.SetGlobalRayTracingAccelerationStructure, SystemInfo.supportsRayTracingShaders, SystemInfo.supportsInlineRayTracing.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961