Version: 2023.2
언어: 한국어

Shader.SetGlobalRayTracingAccelerationStructure

매뉴얼로 전환
public static void SetGlobalRayTracingAccelerationStructure (string name, Rendering.RayTracingAccelerationStructure value);
public static void SetGlobalRayTracingAccelerationStructure (int nameID, Rendering.RayTracingAccelerationStructure value);

파라미터

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.

설명

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.