# US 11,120,608 B2 · Apparatus and method for cross-instance front-to-back traversal for ray tracing heavily-instanced scenes

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,120,608 B2
- Document ID: US11120608B2
- Status: Granted
- Kind: B2
- Application number: 16/145,162
- Filed: 2018-09-27
- Published: 2020-04-02
- Granted: 2021-09-14
- Earliest claimed: 2018-09-27
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: Ingo Wald; Carsten Benthin; Sven Woop
- Web page: https://patentgrep.com/patent/US11120608B2

## CPC

- G06T 15/06: Ray-tracing
- G06T 7/50: Depth or shape recovery
- G06T 15/005: {General purpose rendering architectures}
- G06T 15/506: {Illumination models}
- G06T 1/20: Processor architectures; Processor configuration, e.g. pipelining
- G06T 2210/21: Collision detection, intersection
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

Apparatus and method for programmable ray tracing with hardware acceleration on a graphics processor. For example, one embodiment of a graphics processor comprises shader execution circuitry to execute a plurality of programmable ray tracing shaders. The shader execution circuitry includes a plurality of single instruction multiple data (SIMD) execution units. Sorting circuitry regroups data associated with one or more of the programmable ray tracing shaders to increase occupancy for SIMD operations performed by the SIMD execution units; and fixed-function intersection circuitry coupled to the shader execution circuitry detects intersections between rays and bounding volume hierarchies (BVHs) and/or objects contained therein and to provide results indicating the intersections to the sorting circuitry.

## Claims

### Claim 1

A method comprising:
constructing a hierarchical acceleration structure over a plurality of instances of one or more base geometric objects, the hierarchical acceleration structure comprising a plurality of nodes arranged in a hierarchy, the plurality of instances comprising a first instance and a second instance which at least partially overlaps the first instance, and wherein each of the first and second instance comprises a transform of the one or more base geometric objects; and
performing cross-instance ray traversal on the plurality of instances and the one or more base geometric objects, wherein performing cross-instance ray traversal comprises, following traversal of a first node from the first instance with a first ray, traversing a second node from the second instance with the first ray without traversing the first instance to completion based on that the second node from the second instance immediately follows the first node from the first instance in a traversal queue, wherein the traversal queue orders nodes from the plurality of instances based on the nodes' distances to the ray origin of the first ray.

### Claim 2 (depends on 1)

The method of claim 1 further comprising:
forming the traversal queue comprising identifiers of nodes for which traversal operations are to be performed.

### Claim 3 (depends on 2)

The method of claim 2 further comprising:
if the second node is a leaf node, then performing intersection operations to identify a first ray-surface intersection between the first ray and a primitive associated with the second node.

### Claim 4 (depends on 3)

The method of claim 3 wherein if the second node is an inner node, then performing a depth-first down traversal on the second node as long as possible.

### Claim 5 (depends on 3)

The method of claim 3 further comprising:
generating a first unique hit point identifier (ID) for the first ray-surface intersection; and
if the first ray surface intersection shares a distance with a second ray surface intersection, then disambiguating the order of the first and second ray-surface intersections using the first unique hit point ID and a second unique hit point ID associated with the second ray-surface intersection.

### Claim 6 (depends on 5)

The method as in claim 5 wherein the first unique hit point ID comprises a primitive ID uniquely identifying a primitive of the surface.

### Claim 7 (depends on 6)

The method as in claim 6 further comprising:
generating an absolute order of the first and second ray-surface intersections using a combination of the distances and first and second unique hit point IDs.

### Claim 8 (depends on 4)

The method of claim 4 wherein performing the depth-first down traversal on the second node as long as possible comprises:
intersecting a transformed first ray with one or more children nodes of the second node; and
if no child node was hit by the transformed first ray, then read a next node from the traversal queue to traverse and/or intersect with the first ray.

### Claim 9 (depends on 8)

The method of claim 8 wherein if a child node was hit by the transformed first ray, then:
determining a closest intersected child node; and
inserting other intersected child nodes into the traversal queue.

### Claim 10 (depends on 9)

The method of claim 9 wherein if the closest intersected child node is a leaf node, then inserting it into the traversal queue, and selecting another node from the traversal queue.

### Claim 11 (depends on 9)

The method of claim 9 wherein if the closest intersected child node is not a leaf node, then performing a depth-first down traversal on the closest intersected child node as long as possible.

### Claim 12

A non-transitory machine-readable medium having program code stored thereon which, when executed by a machine, causes the machine to perform the operations of:
constructing a hierarchical acceleration structure over a plurality of instances of one or more base geometric objects, the hierarchical acceleration structure comprising a plurality of nodes arranged in a hierarchy, the plurality of instances comprising a first instance and a second instance which at least partially overlaps the first instance, and wherein each of the first and second instance comprises a transform of the one or more base geometric objects; and
performing cross-instance ray traversal on the plurality of instances and the one or more base geometric objects, wherein performing cross-instance ray traversal comprises following traversal of a first node from the first instance with a first ray, traversing a second node from the second instance with the first ray without traversing the first instance to completion based on that the second node from the second instance immediately follows the first node from the first instance in a traversal queue, wherein the traversal queue orders nodes from the plurality of instances based on the nodes' distances to the ray origin of the first ray.

### Claim 13 (depends on 12)

The non-transitory machine-readable medium of claim 12 further comprising program code to cause the machine to perform the operations of:
forming the traversal queue comprising identifiers of nodes for which traversal operations are to be performed.

### Claim 14 (depends on 13)

The non-transitory machine-readable medium of claim 13 further comprising program code to cause the machine to perform the operations of:
if the second node is a leaf node, then performing intersection operations to identify a first ray-surface intersection between the first ray and a primitive associated with the second node.

### Claim 15 (depends on 14)

The non-transitory machine-readable medium of claim 14 wherein if the second node is an inner node, then performing a depth-first down traversal on the second node as long as possible.

### Claim 16 (depends on 14)

The non-transitory machine-readable medium of claim 14 further comprising program code to cause the machine to perform the operations of:
generating a first unique hit point identifier (ID) for the first ray-surface intersection; and
if the first ray surface intersection shares a distance with a second ray surface intersection, then disambiguating the order of the first and second ray-surface intersections using the first unique hit point ID and a second unique hit point ID associated with the second ray-surface intersection.

### Claim 17 (depends on 16)

The non-transitory machine-readable medium as in claim 16 wherein the first unique hit point ID comprises a primitive ID uniquely identifying a primitive of the surface.

### Claim 18 (depends on 17)

The non-transitory machine-readable medium as in claim 17 further comprising program code to cause the machine to perform the operations of:
generating an absolute order of the first and second ray-surface intersections using a combination of the distances and first and second unique hit point IDs.

### Claim 19 (depends on 15)

The non-transitory machine-readable medium of claim 15 wherein performing the depth-first down traversal on the second node as long as possible comprises:
intersecting a transformed first ray with one or more children nodes of the second node; and
if no child node was hit by the transformed first ray, then read a next node from the traversal queue to traverse and/or intersect with the first ray.

### Claim 20 (depends on 19)

The non-transitory machine-readable medium of claim 19 wherein if a child node was hit by the transformed first ray, then the program code is to cause the machine to perform the operations of:
determining a closest intersected child node; and
inserting other intersected child nodes into the traversal queue.

### Claim 21 (depends on 20)

The non-transitory machine-readable medium of claim 20 wherein if the closest intersected child node is a leaf node, then inserting it into the traversal queue, and selecting another node from the traversal queue.

### Claim 22 (depends on 20)

The non-transitory machine-readable medium of claim 20 wherein if the closest intersected child node is not a leaf node, then performing a depth-first down traversal on the closest intersected child node as long as possible.

### Claim 23

A graphics processing apparatus comprising:
ray tracing circuitry to construct a hierarchical acceleration structure over a plurality of instances of one or more base geometric objects, the hierarchical acceleration structure comprising a plurality of nodes arranged in a hierarchy, the plurality of instances comprising a first instance and a second instance which at least partially overlaps the first instance, and wherein each of the first and second instance comprises a transform of the one or more base geometric objects; and
traversal circuitry to perform cross-instance ray traversal on the plurality of instances and the one or more base geometric objects, wherein performing cross-instance ray traversal comprises, following traversal of a first node from the first instance with a first ray, traversing a second node from the second instance with the first ray without traversing the first instance to completion based on that the second node from the second instance immediately follows the first node from the first instance in a traversal queue, wherein the traversal queue orders nodes from the plurality of instances based on the nodes' distances to the ray origin of the first ray.

### Claim 24 (depends on 23)

The graphics processing apparatus of claim 23 wherein the traversal queue is to be formed, the traversal queue comprising identifiers of nodes for which traversal operations are to be performed.

### Claim 25 (depends on 24)

The graphics processing apparatus of claim 24 wherein the cross-instance ray traversal further comprises:
if the second node is a leaf node, then performing intersection operations to identify a first ray-surface intersection between the first ray and a primitive associated with the second node.

### Claim 26 (depends on 25)

The graphics processing apparatus of claim 25 wherein if the second node is an inner node, then performing a depth-first down traversal on the second node as long as possible.

### Claim 27 (depends on 25)

The graphics processing apparatus of claim 25 wherein the cross-instance ray traversal further comprises:
generating a first unique hit point identifier (ID) for the first ray-surface intersection; and
if the first ray surface intersection shares a distance with a second ray surface intersection, then disambiguating the order of the first and second ray-surface intersections using the first unique hit point ID and a second unique hit point ID associated with the second ray-surface intersection.

### Claim 28 (depends on 27)

The graphics processing apparatus as in claim 27 wherein the first unique hit point ID comprises a primitive ID uniquely identifying a primitive of the surface.

### Claim 29 (depends on 28)

The graphics processing apparatus as in claim 28 wherein the cross-instance ray traversal further comprises:
generating an absolute order of the first and second ray-surface intersections using a combination of the distances and first and second unique hit point IDs.

### Claim 30 (depends on 26)

The graphics processing apparatus of claim 26 wherein performing the depth-first down traversal on the second node as long as possible comprises:
intersecting a transformed first ray with one or more children nodes of the second node; and
if no child node was hit by the transformed first ray, then read a next node from the traversal queue to traverse and/or intersect with the first ray.

### Claim 31 (depends on 30)

The graphics processing apparatus of claim 30 wherein if a child node was hit by the transformed first ray, then:
determining a closest intersected child node; and
inserting other intersected child nodes into the traversal queue.

### Claim 32 (depends on 31)

The graphics processing apparatus of claim 31 wherein if the closest intersected child node is a leaf node, then inserting it into the traversal queue, and selecting another node from the traversal queue.

### Claim 33 (depends on 31)

The graphics processing apparatus of claim 31 wherein if the closest intersected child node is not a leaf node, then performing a depth-first down traversal on the closest intersected child node as long as possible.

### Claim 34 (depends on 23)

The graphics processing apparatus of claim 23, wherein the second node from the second instance is to incur the ray-surface intersection for the first ray less than another node from the first instance, and wherein less than is either a distance of the ray-surface intersection of the second node to the ray origin is smaller than that of the another node, or a hit point identifier (ID) of the ray-surface intersection is less than that of the another node when the distance is equal.
