Class RayTracingResources
Utility shaders needed by a RayTracingContext to operate.
Inherited Members
Namespace: UnityEngine.Rendering.UnifiedRayTracing
Assembly: Unity.UnifiedRayTracing.Runtime.dll
Syntax
public class RayTracingResources
Remarks
This class holds compute shaders required for unified ray tracing operations, including geometry pool management and BVH construction kernels.
Properties
bitHistogram
Compute shader for radix sort operations.
Declaration
public ComputeShader bitHistogram { get; set; }
Property Value
| Type | Description |
|---|---|
| ComputeShader |
blockReducePart
Compute shader for prefix sum operations.
Declaration
public ComputeShader blockReducePart { get; set; }
Property Value
| Type | Description |
|---|---|
| ComputeShader |
blockScan
Compute shader for prefix sum operations.
Declaration
public ComputeShader blockScan { get; set; }
Property Value
| Type | Description |
|---|---|
| ComputeShader |
buildHlbvh
Compute shader for building a BVH.
Declaration
public ComputeShader buildHlbvh { get; set; }
Property Value
| Type | Description |
|---|---|
| ComputeShader |
copyBuffer
Compute shader for buffer copy operations.
Declaration
public ComputeShader copyBuffer { get; set; }
Property Value
| Type | Description |
|---|---|
| ComputeShader |
copyPositions
Compute shader for copying vertex position data.
Declaration
public ComputeShader copyPositions { get; set; }
Property Value
| Type | Description |
|---|---|
| ComputeShader |
geometryPoolKernels
Compute shader for geometry pool operations.
Declaration
public ComputeShader geometryPoolKernels { get; set; }
Property Value
| Type | Description |
|---|---|
| ComputeShader |
restructureBvh
Compute shader for BVH restructuring.
Declaration
public ComputeShader restructureBvh { get; set; }
Property Value
| Type | Description |
|---|---|
| ComputeShader |
Remarks
Used to optimize the BVH structure after initial construction.
scatter
Compute shader for radix sort operations.
Declaration
public ComputeShader scatter { get; set; }
Property Value
| Type | Description |
|---|---|
| ComputeShader |
Methods
Load()
Intializes the RayTracingResources.
Declaration
public void Load()
Remarks
This API works only in the Unity Editor, not at runtime.
LoadFromAssetBundle(AssetBundle)
Intializes the RayTracingResources by loading its utility shaders from an AssetBundle.
Declaration
public void LoadFromAssetBundle(AssetBundle assetBundle)
Parameters
| Type | Name | Description |
|---|---|---|
| AssetBundle | assetBundle | The AssetBundle to load the shaders from. |
Remarks
The necessary shaders are configured to belong to the unifiedraytracing AssetBundle which can be built by calling BuildAssetBundles(string, BuildAssetBundleOptions, BuildTarget)
LoadFromRenderPipelineResources()
Intializes the RayTracingResources by loading its utility shaders via GraphicsSettings.
Declaration
public bool LoadFromRenderPipelineResources()
Returns
| Type | Description |
|---|---|
| bool | Whether the resources were successfully loaded. |
Remarks
This method only works in projects that use Scriptable Render Pipeline.