Version: 2019.3
LanguageEnglish
  • C#

CommandBuffer.DispatchRays(RayTracingShader,string,int,int,int,Camera)

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

Parameters

raytracingShader RayTracingShader to execute.
rayGenShaderNameName of the ray generation shader.
rayGenShaderNameIDProperty name ID. Use Shader.PropertyToID to get this ID.
widthThe width of the ray generation shader thread grid.
heightThe height of the ray generation shader thread grid.
depthThe depth of the ray generation shader thread grid.
cameraThe Camera to be used as environment to dispatch RayTracingShader.

Description

Add a command to execute a RayTracingShader.

When the command buffer executes, a RayTracingShader is dispatched and launches the threads of ray generation shader. Width, height and depth must be above zero and width*height*depth <= 2^30.

Did you find this page useful? Please give it a rating: