Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


RayTracingShader

A shader for GPU ray tracing.
Read time 4 minutesLast updated 5 days ago

Definition

public sealed class RayTracingShader : Object

Remarks

This shader should contain at least a
raygeneration
shader.

Properties

Property

Description

enabledKeywordsAn array containing the local shader keywords that are currently enabled for this ray tracing shader.
keywordSpaceThe local keyword space of this ray tracing shader.
maxRecursionDepthThe maximum number of ray bounces this shader can trace (Read Only).
shaderKeywordsAn array containing names of the local shader keywords that are currently enabled for this ray tracing shader.

Methods

Method

Description

DisableKeywordDisables a local shader keyword for this ray tracing shader.
DispatchDispatches this RayTracingShader.
DispatchIndirectDispatches this RayTracingShader.
EnableKeywordEnables a local shader keyword for this ray tracing shader.
IsKeywordEnabledChecks whether a local shader keyword is enabled for this ray tracing shader.
SetAccelerationStructureSets the value for RayTracingAccelerationStructure property of this RayTracingShader.
SetBoolSets the value of a boolean uniform.
SetBufferBinds an input or output compute buffer.
SetConstantBufferBinds a constant buffer created through a ComputeBuffer or a GraphicsBuffer.
SetFloatSets the value of a float uniform.
SetFloatsSets the values for a float array uniform.
SetIntSets the value of a int uniform.
SetIntsSets the values for a int array uniform.
SetKeywordSets the state of a local shader keyword for this ray tracing shader.
SetMatrixSets the value of a matrix uniform.
SetMatrixArraySets a matrix array uniform.
SetShaderPassSelects which Shader Pass to use when executing ray/geometry intersection shaders.
SetTextureBinds a texture resource. This can be a input or an output texture (UAV).
SetTextureFromGlobalBinds a global texture to a RayTracingShader.
SetVectorSets the value for a vector uniform.
SetVectorArraySets a vector array uniform.

Inheritance

Inherited Members

Operators

Operator

Description

operator ==Compares two object references to see if they refer to the same object.
boolDetermines whether the object exists.
operator !=Compares if two objects refer to a different object.