# US 2021/0287429 A1 · Apparatus and method for performing box queries in ray traversal hardware

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

- Number: US 2021/0287429 A1
- Document ID: US20210287429A1
- Status: Published application
- Kind: A1
- Application number: 16/819,120
- Filed: 2020-03-15
- Published: 2021-09-16
- Earliest claimed: 2020-03-15
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: Karthik VAIDYANATHAN; Carsten BENTHIN; Sven WOOP
- Web page: https://patentgrep.com/patent/US20210287429A1

## CPC

- G06T 17/10: Constructive solid geometry [CSG] using solid primitives, e.g. cylinders, cubes
- G06F 7/24: Sorting, i.e. extracting data from one or more carriers, rearranging the data in numerical or other ordered sequence, and rerecording the sorted data on the original carrier or on a different carrier or set of carriers {sorting methods in general}(G06F7/36 takes precedence)
- G06T 1/20: Processor architectures; Processor configuration, e.g. pipelining
- G06T 15/005: {General purpose rendering architectures}
- G06T 15/06: Ray-tracing
- G06T 15/08: Volume rendering
- G06T 17/205: {Re-meshing}
- G06T 2210/12: Bounding box
- G06T 2210/21: Collision detection, intersection
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Apparatus and method for box-box testing. For example, one embodiment of a processor comprises: a bounding volume hierarchy (BVH) generator to construct a BVH comprising a plurality of hierarchically arranged BVH nodes; traversal circuitry to traverse query boxes through the BVH, the traversal circuitry to read a BVH node from a top of a BVH node stack and to read a query box from a local storage or memory, the traversal circuitry further comprising: box-box testing circuitry and/or logic to compare maximum and minimum X, Y, and Z coordinates of the BVH node and the query box and to generate an overlap indication if overlap is detected for each of the X, Y, and Z dimensions; distance determination circuitry and/or logic to generate a distance value representing an extent of overlap between the BVH node and the query box; and sorting circuitry and/or logic to sort the BVH node within a set of one or more additional BVH nodes based on the distance value.

## Claims

### Claim 1

An apparatus comprising:
a bounding volume hierarchy (BVH) generator to construct a BVH comprising a plurality of hierarchically arranged BVH nodes;
multi-function traversal circuitry to both traverse query boxes through the BVH and to traverse rays through the BVH, the multi-function traversal circuitry to read a BVH node from a top of a BVH node stack and to read a query box from a local storage or memory, the traversal circuitry further comprising:
box-box testing circuitry and/or logic to compare maximum and minimum X, Y, and Z coordinates of the BVH node and the query box and to generate an overlap indication if overlap is detected for each of the X, Y, and Z dimensions;
distance determination circuitry and/or logic to generate a distance value representing an extent of overlap between the BVH node and the query box; and
sorting circuitry and/or logic to sort the BVH node within a set of one or more additional BVH nodes based on the distance value.

### Claim 2 (depends on 1)

The apparatus of claim 1 further comprising:
dequantization circuitry and/or logic to generate the maximum and minimum X, Y, and Z coordinates for the BVH node by dequantizing quantized X, Y and Z coordinates associated with the BVH node.

### Claim 3 (depends on 1)

The apparatus of claim 1 wherein the distance determination circuitry is to generate the distance value by performing the operations of:
determining a first penetration distance from a first axis-aligned direction and a second penetration distance from a second axis-aligned direction for each of the X, Y, and Z coordinates, the first penetration distance indicating overlap when the query box penetrates the BVH node from the first direction and the second penetration distance indicating overlap when the query box penetrates the BVH node from the second direction; and
selecting for each of the X, Y, and Z coordinates a minimum of the first and second penetration distances.

### Claim 4 (depends on 1)

The apparatus of claim 1 wherein the BVH node and the one or more additional BVH nodes comprise nodes at a common level of the BVH.

### Claim 5 (depends on 4)

The apparatus of claim 4 wherein the distance determination circuitry and/or logic is to determine one or more additional distance values associated with the one or more additional BVH nodes, and the sorting circuitry is to generate a sorted order of the BVH node and one or more additional BVH nodes based on the distance value and the one or more additional distance values.

### Claim 6 (depends on 5)

The apparatus of claim 5 wherein the BVH node and the one or more additional BVH nodes are to be stored to the BVH stack in the sorted order.

### Claim 7 (depends on 1)

The apparatus of claim 1 wherein the traversal circuitry further comprises:
ray traversal circuitry to traverse input rays through the BVH, wherein the ray traversal circuitry comprises ray testing circuitry and/or logic to determine whether an input ray hits the BVH node, wherein the ray testing circuitry and/or logic comprises the box-box testing circuitry and/or logic or a portion thereof.

### Claim 8 (depends on 7)

The apparatus of claim 7 wherein if the ray testing circuitry and/or logic determines that the ray hits the BVH node, then the distance determination circuitry is to determine a hit distance value representing a coordinate at which the ray hits the BVH node and the sorting circuitry and/or logic is to sort the BVH node within the set of one or more additional BVH nodes based one or more additional hit distance values associated with the set of one or more additional BVH nodes.

### Claim 9

A method comprising:
constructing a bounding volume hierarchy (BVH) comprising a plurality of hierarchically arranged BVH nodes;
reading, by multi-function traversal circuitry, a BVH node from a top of a BVH node stack, the multi-function traversal circuitry configured to both traverse query boxes through the BVH and to traverse rays through the BVH, wherein to traverse query boxes through the BVH, the multi-function traversal circuitry performs the additional operations of:
reading a query box from a local storage or memory;
comparing maximum and minimum X, Y, and Z coordinates of the BVH node and the query box;
generating an overlap indication if overlap is detected for each of the X, Y, and Z dimensions;
generating a distance value representing an extent of overlap between the BVH node and the query box; and
sorting the BVH node within a set of one or more additional BVH nodes based on the distance value.

### Claim 10 (depends on 9)

The method of claim 9 wherein the multi-function traversal circuitry is to perform the operations of:
dequantizing quantized X, Y and Z coordinates associated with the BVH node to generate the maximum and minimum X, Y, and Z coordinates.

### Claim 11 (depends on 9)

The method of claim 9 wherein distance value is generated by performing the operations of:
determining a first penetration distance from a first axis-aligned direction and a second penetration distance from a second axis-aligned direction for each of the X, Y, and Z coordinates, the first penetration distance indicating overlap when the query box penetrates the BVH node from the first direction and the second penetration distance indicating overlap when the query box penetrates the BVH node from the second direction; and
selecting for each of the X, Y, and Z coordinates a minimum of the first and second penetration distances.

### Claim 12 (depends on 9)

The method of claim 9 wherein the BVH node and the one or more additional BVH nodes comprise nodes at a common level of the BVH.

### Claim 13 (depends on 12)

The method of claim 12 further comprising:
determining one or more additional distance values associated with the one or more additional BVH nodes, and
generating a sorted order of the BVH node and one or more additional BVH nodes based on the distance value and the one or more additional distance values.

### Claim 14 (depends on 13)

The method of claim 13 wherein the BVH node and the one or more additional BVH nodes are to be stored to the BVH stack in the sorted order.

### Claim 15 (depends on 9)

The method of claim 9 further comprising:
traversing, the by multi-function traversal circuitry, an input ray through the BVH by comparing coordinates of the input ray with the maximum and minimum X, Y, and Z coordinates of the BVH node, wherein a common set of testing circuitry and/or logic is used to determine whether the input ray hits the BVH node and is also used for comparing the maximum and minimum X, Y, and Z coordinates of the BVH node and the query box.

### Claim 16 (depends on 15)

The method of claim 15 wherein if the input ray is determined to hit the BVH node, then the method further comprises:
determining a hit distance value representing a coordinate at which the ray hits the BVH node; and
sorting the BVH node within the set of one or more additional BVH nodes based one or more additional hit distance values associated with the set of one or more additional BVH nodes.

### Claim 17

A machine-readable medium having program code stored thereon which, when executed by a machine, causes the machine to perform the operations of:
constructing a bounding volume hierarchy (BVH) comprising a plurality of hierarchically arranged BVH nodes;
reading, by multi-function traversal circuitry, a BVH node from a top of a BVH node stack, the multi-function traversal circuitry configured to both traverse query boxes through the BVH and to traverse rays through the BVH, wherein to traverse query boxes through the BVH, the multi-function traversal circuitry performs the additional operations of:
reading a query box from a local storage or memory;
comparing maximum and minimum X, Y, and Z coordinates of the BVH node and the query box;
generating an overlap indication if overlap is detected for each of the X, Y, and Z dimensions;
generating a distance value representing an extent of overlap between the BVH node and the query box; and
sorting the BVH node within a set of one or more additional BVH nodes based on the distance value.

### Claim 18 (depends on 17)

The machine-readable medium of claim 17 further comprising program code to cause the multi-function traversal circuitry to perform the operations of:
dequantizing quantized X, Y and Z coordinates associated with the BVH node to generate the maximum and minimum X, Y, and Z coordinates.

### Claim 19 (depends on 17)

The machine-readable medium of claim 17 wherein distance value is generated by the machine performing the operations of:
determining a first penetration distance from a first axis-aligned direction and a second penetration distance from a second axis-aligned direction for each of the X, Y, and Z coordinates, the first penetration distance indicating overlap when the query box penetrates the BVH node from the first direction and the second penetration distance indicating overlap when the query box penetrates the BVH node from the second direction; and
selecting for each of the X, Y, and Z coordinates a minimum of the first and second penetration distances.

### Claim 20 (depends on 17)

The machine-readable medium of claim 17 wherein the BVH node and the one or more additional BVH nodes comprise nodes at a common level of the BVH.

### Claim 21 (depends on 20)

The machine-readable medium of claim 20 further comprising program code to cause the machine to perform the operations of:
determining one or more additional distance values associated with the one or more additional BVH nodes, and
generating a sorted order of the BVH node and one or more additional BVH nodes based on the distance value and the one or more additional distance values.

### Claim 22 (depends on 21)

The machine-readable medium of claim 21 wherein the BVH node and the one or more additional BVH nodes are to be stored to the BVH stack in the sorted order.

### Claim 23 (depends on 17)

The machine-readable medium of claim 17 further comprising program code to cause the machine to perform the operations of:
traversing, by the multi-function traversal circuitry, an input ray through the BVH by comparing coordinates of the input ray with the maximum and minimum X, Y, and Z coordinates of the BVH node, wherein a common set of testing circuitry and/or logic is used to determine whether the input ray hits the BVH node and is also used for comparing the maximum and minimum X, Y, and Z coordinates of the BVH node and the query box.

### Claim 24 (depends on 23)

The machine-readable medium of claim 23 wherein if the input ray is determined to hit the BVH node, then the machine-readable medium further comprises program code to cause the machine to perform the operations of:
determining a hit distance value representing a coordinate at which the ray hits the BVH node; and
sorting the BVH node within the set of one or more additional BVH nodes based one or more additional hit distance values associated with the set of one or more additional BVH nodes.
