We are happy to announce that as of Unity 2023.1.0a13, the Ray Tracing API is officially out of experimental. This change is introduced after recent improvements to the Ray Tracing API, ranging from stability and performance to additional compatibility with the engine’s existing feature set.
Unity’s Ray Tracing API is utilized by the High Definition Render Pipeline, in order to implement a collection of cutting-edge raytracing effects such as:
- Ambient Occlusion
- Contact Shadow
- Global Illumination
- Reflections
- Shadows
- Subsurface Scattering
- Recursive Ray Tracing
- Path Tracing
“Enemies” - HDRP Ray Tracing in Unity 2022.2
In order to experiment with HDRP’s raytracing effects, you can now utilize the HDRP Sample Scene which has been updated to provide new raytracing quality settings. The new settings assets are introduced for the 2022.2 beta in “3D Sample Scene (HDRP) v14.1.0”, and for the 2023.1 alpha in “3D Sample Scene (HDRDP) v15.1.0”:
“HDRP Sample Scene” - Raytraced GI, Reflections, Shadows and AO enabled
As of 2022.2, we now provide full desktop and console support for RT capable hardware including Xbox Series. In the same release, we also implemented Terrain Heightmap compatibility with raytracing when utilizing the Terrain system.
Unity 2023.1 further advances Unity’s Ray Tracing support by fully integrating with VFX Graph in order to allow authoring complex particle effects that are compatible with HDRP’s Ray Tracing effects.
This release also expands the Ray Tracing API in order to simplify the configuration of meshes added to the Ray Tracing Acceleration Structure (RTAS). This is achieved by introducing a new overload for “RaytracingAccelerationStructure.AddInstance”:
RaytracingAceelerationStructure.AddInstance(ref Rendering.RayTracingMeshInstanceConfig config, Matrix4x4 matrix, Nullable<Matrix4x4> prevMatrix = null, uint id);
The new API allows to pass the new “RaytracingMeshInstanceConfig” struct in order to conveniently configure the mesh and material parameters of instances to be included in the RTAS. For example, using this new API it is now straightforward to process/animate the geometry of ray-traced meshes by retrieving the mesh vertex buffer using “Mesh.GetVertexBuffer” and binding it to a compute shader using “ComputeShader.SetBuffer”.
Update:
RayTracingAccelerationStructure.AddInstances is also introduced in 2023.1a18, and provides full instancing support to the Ray Tracing API, allowing to add large amounts of mesh instances to the RTAS, and to use the instance ID in hit shaders for accessing per-instance data.
Using instancing, it is now possible to more efficiently ray-trace large and dense scenes that include high-frequency repeating meshes and detail. For more information on Raytracing Instancing, including performance testing figures and a reference sample project, please check out the following slides.
With the Ray Tracing API out of experimental in 2023.1, we can’t wait to see the amazing results you achieve using HDRP’s comprehensive ray tracing effects! Your feedback is crucial, so please let us know if you encounter any issues, and share any features and changes you would like to see. You can contact us directly in this thread, or by submitting a feature/change request using the official Roadmap Request Form.