Version: 2023.2

CommandBuffer.SetRayTracingMatrixParam

切换到手册
public void SetRayTracingMatrixParam (Rendering.RayTracingShader rayTracingShader, string name, Matrix4x4 val);
public void SetRayTracingMatrixParam (Rendering.RayTracingShader rayTracingShader, int nameID, Matrix4x4 val);

参数

rayTracingShader 要为其设置参数的 RayTracingShader
name 着色器代码中的变量的名称。
nameID 属性名称 ID。使用 Shader.PropertyToID 可获取此 ID。
val 要设置的值。

描述

添加用于在 RayTracingShader 中设置矩阵参数的命令。

Only shaders defined in the .raytrace file can access the matrix you designate as the argument for this method. To make this matrix accessible to all ray tracing shader types (closest hit, any hit, or miss, for example), call the CommandBuffer.SetGlobalMatrix method instead.