Contents

Ray tracing with acceleration structures

Build a representation of your scene’s geometry using triangles and bounding volumes to quickly trace rays through the scene.

Overview

Ray tracing can improve your content’s realism by more accurately modeling the behavior of light than traditional rendering. You can also use ray tracing to implement similar techniques that rely on line-of-sight, such as sound obstruction or visually based AI functions.

To apply ray tracing in your app:

  1. Create acceleration structures that represent objects in a scene.

  2. Define a ray’s behavior when it collides into parts of an acceleration structure by creating either intersectors or intersection queries.

  3. Generate rays into the scene from a new or existing shader.

An intersector uses a table of your intersection functions that define the custom behavior for each intersection type. An intersection query returns to your calling function to handle the custom behavior for all intersection types.

Intersectors work with compute kernels on all GPUs, and with render shaders only on Apple silicon GPUs. Alternatively, your app can use intersection queries on non-Apple GPUs, or for porting code from other graphics APIs.

Topics

Ray tracing samples

Acceleration structures

Acceleration structures passes

Geometry descriptors

Motion geometry descriptors

Instance descriptors

Intersection function tables

Supporting types

See Also

Command encoders