Techniques for generating bounding volume hierarchies
By predefining triangle sets and using centroid boxes to determine candidate splits, the BVH construction process is accelerated, addressing the computational inefficiencies of traditional methods and enhancing ray tracing performance.
Patent Information
- Application Number
- JP2025533684
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-12-16
- Filing Date
- 2023-11-27
- Publication Date
- 2025-12-05
Smart Images

Figure 2025539547000001_ABST
Abstract
Description
[Technical Field]
[0001] (CROSS-REFERENCE TO RELATED APPLICATIONS) This application claims the benefit of pending U.S. Patent Application No. 18 / 083,298, filed December 16, 2022, the entire contents of which are incorporated herein by reference. [Background technology]
[0002] In image synthesis, ray tracing is used to find the closest intersection of a given ray with a scene in which light propagation is simulated.
[0003] A more detailed understanding may be had from the following description, given by way of example in conjunction with the accompanying drawings, in which: [Brief explanation of the drawings]
[0004] [Figure 1] FIG. 1 is a block diagram of an example device that may implement one or more features of the present disclosure. [Figure 2] 2 is a block diagram of the device of FIG. 1 showing additional details according to an example. [Figure 3] FIG. 1 illustrates a ray tracing pipeline for rendering graphics using ray tracing techniques, according to an example. [Figure 4] FIG. 1 is a diagram of a bounding volume hierarchy (BVH) according to an example. [Figure 5] FIG. 1 illustrates the generation of a BVH from scene geometry by a BVH builder, according to an example. [Figure 6A] FIG. 1 illustrates how a BVH is generated using a top-down technique, according to an example. [Figure 6B] FIG. 10 illustrates a set of candidate splits for a BVH node according to an example. [Figure 7] FIG. 1 illustrates an exemplary primitive set collection. [Figure 8]FIG. 1 illustrates different partition resolutions according to an example. [Figure 9] FIG. 10 illustrates an example of finding a group of box nodes in the triangle set collection that correspond to all primitives that are descendants of a candidate box node in the BVH being constructed. [Figure 9A] FIG. 10 illustrates different candidate splits according to an example. [Figure 9B] FIG. 10 illustrates different candidate splits according to an example. [Figure 9C] FIG. 10 illustrates different candidate splits according to an example. [Figure 10] FIG. 10 illustrates additional operations associated with constructing a BVH, according to an example. [Figure 11] 1 is a flow diagram of a method for constructing a BVH according to an example. DETAILED DESCRIPTION OF THE INVENTION
[0005] Techniques for constructing a bounding volume hierarchy are disclosed that include refining a candidate box node based on a resolution to generate a plurality of cells for the candidate box node, identifying a plurality of nodes of a primitive set collection that fall within the cell, generating a plurality of candidate splits based on the plurality of nodes, selecting the candidate splits based on a selection criterion to obtain selected candidate splits, and generating child box nodes for the box node of the bounding volume hierarchy being constructed based on the selected candidate splits.
[0006] 1 is a block diagram of an example device 100 that may implement one or more features of the present disclosure. Device 100 may include, for example, a computer, a gaming device, a handheld device, a set-top box, a television, a mobile phone, or a tablet computer. Device 100 includes a processor 102, a memory 104, a storage device 106, one or more input devices 108, and one or more output devices 110. Device 100 may also optionally include an input driver 112 and an output driver 114. It should be understood that device 100 may include additional components not shown in FIG. 1 .
[0007] In various alternatives, processor 102 includes a central processing unit (CPU), a graphics processing unit (GPU), a CPU and a GPU located on the same die, or one or more processor cores, each of which may be a CPU or a GPU. In various alternatives, memory 104 is located on the same die as processor 102 or is located separately from processor 102. Memory 104 may include volatile or non-volatile memory (e.g., random access memory (RAM), dynamic RAM, cache).
[0008] Storage 106 includes fixed or removable storage devices (e.g., hard disk drives, solid state drives, optical disks, flash drives). Input devices 108 include, but are not limited to, keyboards, keypads, touchscreens, touchpads, detectors, microphones, accelerometers, gyroscopes, biometric scanners, or network connections (e.g., wireless local area network cards for transmitting and / or receiving wireless IEEE 802 signals). Output devices 110 include, but are not limited to, displays, speakers, printers, haptic feedback devices, one or more optics, antennas, or network connections (e.g., wireless local area network cards for transmitting and / or receiving wireless IEEE 802 signals).
[0009] The input driver 112 communicates with the processor 102 and the input device 108, allowing the processor 102 to receive input from the input device 108. The output driver 114 communicates with the processor 102 and the output device 110, allowing the processor 102 to send output to the output device 110. Note that the input driver 112 and the output driver 114 are optional components, and the device 100 operates in the same manner without the input driver 112 and the output driver 114. The output driver 114 includes an Accelerated Processing Device (APD) 116 coupled to a display device 118. The APD accepts computational and graphics rendering commands from the processor 102, processes the computational and graphics rendering commands, and provides pixel output to the display device 118 for display. As described in further detail below, the APD 116 includes one or more parallel processing units that perform computations according to the single-instruction-multiple-data (SIMD) paradigm. Thus, although various functions are described herein as being performed by or in conjunction with APD 116, in various alternatives, the functions described as being performed by APD 116 may additionally or alternatively be performed by other computing devices having similar capabilities that are not driven by a host processor (e.g., processor 102) and provide graphical output to display device 118. For example, it is contemplated that any processing system that performs processing tasks according to the SIMD paradigm may perform the functions described herein. Alternatively, it is contemplated that computing systems that do not perform processing tasks according to the SIMD paradigm perform the functions described herein.
[0010] FIG. 2 is a block diagram of device 100 showing additional details regarding the execution of processing tasks on APD 116, according to one example. Processor 102 maintains, within system memory 104, one or more control logic modules for execution by processor 102. The control logic modules include operating system 120, drivers 122, and applications 126. These control logic modules control various aspects of the operation of processor 102 and APD 116. For example, operating system 120 communicates directly with hardware and provides an interface to the hardware for other software executing on processor 102. Driver 122 controls the operation of APD 116, for example, by providing an application programming interface (API) for software executing on processor 102 (e.g., applications 126) to access various features of APD 116. Driver 122 also includes a just-in-time compiler that compiles programs executed by processing components of APD 116 (such as SIMD unit 138, described in more detail below).
[0011] APD 116 executes commands and programs for selected functions, such as graphics and non-graphics operations that may be suitable for parallel processing. APD 116 may be used to perform graphics pipeline operations, such as pixel operations, geometry calculations, and rendering of images to display device 118, based on commands received from processor 102. APD 116 also performs computational operations not directly related to graphics processing, such as operations related to video, physics simulation, computational fluid dynamics, or other tasks, based on instructions received from processor 102.
[0012] The APD 116 includes compute units 132, each of which includes one or more SIMD units 138 that perform processing in a parallel manner according to the SIMD paradigm at the request of the processor 102. The compute units 132 are sometimes referred to herein as “parallel processing units 202.” Each compute unit 132 includes a local data share (LDS) 137 that is accessible to wavefronts executing on the compute unit 132 but not to wavefronts executing on other compute units 132. A global memory 139 stores data accessible to wavefronts executing on all compute units 132. In some examples, the local data share 137 has faster access characteristics (e.g., lower latency and / or higher bandwidth) than the global memory 139. Although shown in the APD 116, the global memory 139 may be located partially or completely within other elements, such as the system memory 104 or another memory not shown or described. The SIMD paradigm allows multiple processing elements to share a single program control flow unit and program counter, thus executing the same program but using different data. In one example, each SIMD unit 138 includes 16 lanes, each of which executes the same instruction simultaneously with other lanes in the SIMD unit 138 but can execute the instruction using different data. Lanes can be switched off using predication when not all lanes need to execute a given instruction. Predication can also be used to execute programs with branching control flows. More specifically, for programs with conditional branch instructions or other instructions where control flow is based on calculations performed by individual lanes, predication of lanes corresponding to currently unexecuted control flow paths and serial execution of different control flow paths allows arbitrary control flow.
[0013] The basic unit of execution in the compute unit 132 is the work item. Each work item represents a single instantiation of a program executing in parallel on a particular lane. Work items may execute simultaneously on a single SIMD processing unit 138 as a “wavefront.” One or more wavefronts are included in a “workgroup,” which includes a collection of work items designated to execute the same program. A workgroup may be executed by executing each of the wavefronts that make up the workgroup. Alternatively, a wavefront may execute serially on a single SIMD unit 138, or partially or fully in parallel on different SIMD units 138. A wavefront may be thought of as the largest collection of work items that can execute simultaneously on a single SIMD unit 138. Thus, if commands received from the processor 102 indicate that a particular program should be parallelized to an extent that the program cannot be run simultaneously on a single SIMD unit 138, the program is divided into wavefronts that are either parallelized on two or more SIMD units 138 or serialized on the same SIMD unit 138 (or both parallelized and serialized, as appropriate). The scheduler 136 performs operations related to scheduling various wavefronts on the different compute units 132 and SIMD units 138 .
[0014] The parallel processing provided by the compute units 132 is well suited to graphics-related operations such as pixel value calculations, vertex transformations, and other graphics operations. Thus, in some cases, a graphics pipeline that accepts graphics processing instructions from the processor 102 provides computational tasks to the compute units 132 for execution in parallel.
[0015] Computation unit 132 is also used to perform non-graphics related computational tasks or computational tasks that are not performed as part of the "normal" processing of the graphics pipeline (e.g., custom processing performed to supplement processing performed for the graphics pipeline). Applications 126 or other software executing on processor 102 send programs defining such computational tasks to APD 116 for execution.
[0016] The APD 116 is configured to implement features of the present disclosure by performing multiple functions, as described in more detail below. For example, the APD 116 is configured to receive an image including one or more three-dimensional (3D) objects, partition the image into tiles, perform a visibility pass on primitives of the image, divide the image into tiles, perform coarse-level tiling on the tiles of the image, partition the tiles into fine tiles, and perform fine-level tiling of the image. Optionally, front-end geometry processing of primitives determined to be within a first one of the tiles can be performed concurrently with the visibility pass.
[0017] Figure 3 illustrates a ray tracing pipeline 300 for rendering graphics using ray tracing techniques, according to an example. The ray tracing pipeline 300 provides an overview of the processes and entities involved in rendering a scene using ray tracing. A ray generation shader 302, an any hit shader 306, a closest hit shader 310, and a miss shader 312 are shader implementation stages that represent ray tracing pipeline stages whose functions are performed by shader programs executing in the SIMD units 138. The specific shader programs at each specific shader implementation stage are defined by application-provided code (i.e., by code provided by the application developer that is pre-compiled by the application compiler and / or compiled by the driver 122). An acceleration structure traversal stage 304 performs a ray intersection test to determine whether a ray hits a triangle.
[0018] The various programmable shader stages (ray generation shader 302, any hit shader 306, closest hit shader 310, miss shader 312) are implemented as shader programs executing on SIMD unit 138. Acceleration structure traversal stage 304 is implemented in software (e.g., as a shader program executing on SIMD unit 138), in hardware, or as a combination of hardware and software. Hit or miss unit 308 is implemented in any technically feasible manner, such as as part of any of the other units, or as a hardware acceleration structure, or as a shader program executing on SIMD unit 138. Ray tracing pipeline 300 may be orchestrated partially or fully in software, or partially or fully in hardware, by processor 102, scheduler 136, by a combination thereof, or partially or fully by any other hardware and / or software unit. As used herein, the term "ray tracing pipeline processor" refers to a processor that executes software to perform the operations of ray tracing pipeline 300, a hardwired hardware circuit to perform the operations of ray tracing pipeline 300, or a combination of hardware and software that together perform the operations of ray tracing pipeline 300.
[0019] The ray tracing pipeline 300 operates in the following manner: A ray generation shader 302 is executed, which sets up data for the ray to test against triangles and requests the acceleration structure traversal stage 304 to test the ray's intersection with the triangle.
[0020] The acceleration structure traversal stage 304 traverses an acceleration structure, which is a data structure that describes the scene volume and objects (such as triangles) in the scene, and tests rays against triangles in the scene. In various examples, the acceleration structure is a bounding volume hierarchy. In some embodiments, a hit or miss unit 308, which is part of the acceleration structure traversal stage 304, determines whether the results of the acceleration structure traversal stage 304 (which may include raw data such as barycentric coordinates and possible hit times) actually indicate a hit. For hit triangles, the ray tracing pipeline 300 triggers the execution of any hit shaders 306. Note that multiple triangles may be hit by a single ray. It is not guaranteed that the acceleration structure traversal stage traverses the acceleration structure in order from closest to the ray origin to furthest from the ray origin. The hit or miss unit 308 triggers the execution of the closest hit shader 310 for the triangle closest to the ray origin that the ray hits, or triggers a miss shader if the triangle was not hit.
[0021] Note that any hit shader 306 can "reject" a hit from the ray intersection test unit 304; thus, the hit or miss unit 308 triggers execution of the miss shader 312 if a hit is not found or accepted by the ray intersection test unit 304. An exemplary situation in which any hit shader 306 may "reject" a hit is when at least a portion of the triangle that the ray intersection test unit 304 reports as a hit is completely transparent. Because the ray intersection test unit 304 tests only geometry and not transparency, any hit shader 306 that is invoked by a hit to a triangle that has at least some transparency may determine that the reported hit is not a hit because it actually "hit" a transparent portion of the triangle. A typical use of the closest hit shader 310 is to color a material based on the material's texture. A typical use of the miss shader 312 is to color a pixel with a color set by a skybox. It should be understood that the shader programs defined for the closest hit shader 310 and miss shader 312 may implement a wide variety of techniques for coloring pixels and / or performing other operations.
[0022] A typical way that the ray generation shader 302 generates rays is using a technique called inverse ray tracing. In inverse ray tracing, the ray generation shader 302 generates rays that have their origin at the camera's location. The point at which the ray intersects a plane defined to correspond to the screen defines a pixel on the screen that is used to determine the ray's color. If the ray hits an object, the pixel is colored based on the closest hit shader 310. If the ray does not hit an object, the pixel is colored based on the miss shader 312. Multiple rays may be cast per pixel, and the pixel's final color is determined by some combination of the colors determined for each of the pixel's rays. As described elsewhere herein, each ray can generate multiple samples, with each sample indicating whether the ray hits a triangle or not. In one example, a ray is cast with four samples: two such samples hit the triangle and two do not. Thus, the color of a triangle only partially contributes (e.g., 50%) to the pixel's final color, with the remaining portion of the color being determined based on triangles hit by other samples or, if no triangles are hit, by a miss shader. In some examples, rendering a scene involves casting at least one ray for each of multiple pixels of an image to obtain a color for each pixel. In some examples, for multisample render targets, multiple rays are cast per pixel to obtain multiple colors per pixel. In some such examples, at some later time, the multisample render target is compressed through color blending to obtain a single-sample image for display or further processing. While it is possible to obtain multiple samples per pixel by casting multiple rays per pixel, techniques are provided herein for obtaining multiple samples per ray, such that multiple samples per pixel can be obtained by casting only one ray. Such a task can be performed multiple times to obtain additional samples per pixel.More specifically, multiple rays can be cast per pixel, and multiple samples obtained per ray such that the total number of samples obtained per pixel is the number of samples per ray multiplied by the number of rays per pixel.
[0023] Any of the hit shader 306, closest hit shader 310, and miss shader 312 can generate their own rays that enter the ray tracing pipeline 300 at the ray test point. These rays can be used for any purpose. One common use is to implement ambient lighting or reflections. In one example, when the nearest hit shader 310 is invoked, it generates rays in various directions. For each object or light hit by the invoked ray, the nearest hit shader 310 adds lighting intensity and color to the pixel corresponding to the nearest hit shader 310. While several example methods for rendering a scene using various components of the ray tracing pipeline 300 have been described, it should be understood that any of a wide variety of techniques may alternatively be used.
[0024] As mentioned above, determining whether a ray hits an object is referred to herein as a "ray intersection test." A ray intersection test involves firing a ray from an origin, determining whether the ray hits a triangle, and if so, determining the distance of the hit triangle from the origin. For efficiency, the ray tracing test uses a representation of space called a bounding volume hierarchy. This bounding volume hierarchy is the "acceleration structure" mentioned above. In a bounding volume hierarchy, each non-leaf node represents an axis-aligned bounding box that bounds the geometry of all of its children. In one example, a base node represents the maximum extent of the entire region over which ray intersection testing is being performed. In this example, the base node has two children, each representing a mutually exclusive axis-aligned bounding box that subdivides the entire region. Each of those two children has two child nodes that represent axis-aligned bounding boxes that subdivide their parent's space, and so on. Leaf nodes represent triangles over which ray testing may be performed. It should be understood that when a first node points to a second node, the first node is considered to be the parent of the second node.
[0025] A bounding volume hierarchical data structure can reduce the number of ray-triangle intersections (which are complex and therefore expensive in terms of processing resources) compared to a scenario in which such a data structure is not used and therefore every triangle in a scene needs to be tested against the ray. Specifically, if a ray does not intersect with a particular bounding box and that bounding box bounds many triangles, all triangles within that box can be eliminated from testing. Thus, ray intersection testing is performed as a series of tests of the ray against axis-aligned bounding boxes, followed by tests against the triangles.
[0026] 4 is a diagram of a bounding volume hierarchy, according to an example. For simplicity, the hierarchy is shown in 2D (two dimensions). However, it should be understood that extension to 3D is straightforward and the tests described herein are generally performed in three dimensions.
[0027] A spatial representation 402 of the bounding volume hierarchy is shown on the left side of Figure 4, and a tree representation 404 of the bounding volume hierarchy is shown on the right side of Figure 4. In both the spatial representation 402 and the tree representation 404, non-leaf nodes are represented by the letter "N" and leaf nodes are represented by the letter "O." A ray intersection test is performed by traversing through the tree 404, and for each non-leaf node tested, if the box test for that non-leaf node fails, the branch below that node is eliminated. For leaf nodes that are not eliminated, a ray-triangle intersection test is performed to determine if the ray intersects the triangle at that leaf node.
[0028] In one example, the ray intersects O5 but not any other triangles. The test tests against N1 and determines that the test succeeds. The test tests against N2 and determines that the test fails (because O5 is not in N1). Note that the test eliminates all subnodes of N2 and tests against N3 and that test succeeds. The test tests N6 and N7 and note that N6 succeeds but N7 fails. The test tests O5 and O6 and note that O5 succeeds but O6 fails. Instead of testing eight triangle tests, two triangle tests (O5 and O6) and five box tests (N1, N2, N3, N6, N7) are performed.
[0029] 1-4 above illustrate embodiments in which top-down construction for a bounding volume hierarchy may be performed. Top-down construction of a bounding volume hierarchy generates a bounding volume hierarchy for a scene, accepting the scene's geometry (e.g., a collection of triangles) as input and generating a BVH as output. Generally, top-down construction involves iteratively generating nodes for the BVH. At each node, candidate splits of triangles within the node are determined, and the children of the node are determined based on an evaluation of the candidate splits. Additional details are now provided.
[0030] FIG. 5 illustrates the generation of a BVH 505 from scene geometry by a BVH builder 501, according to one example. The BVH builder 501 accepts scene geometry 503 and generates a bounding volume hierarchy 505 using a top-down technique. The scene geometry 503 includes geometric objects corresponding to objects in the scene to be rendered. The BVH 505 is a bounding volume hierarchy that allows for quick determination of whether a ray intersects with the scene geometry of the scene, as described with respect to FIGS. 1-4. In various examples, the BVH builder 501 is implemented entirely in software, entirely in hardware (e.g., as a circuit), or a combination thereof. In different examples, the BVH builder 501 is within the device 100 where ray tracing is performed or within a different system. In one example, an application developer creates a scene with geometry, uses the BVH builder 501 to generate a BVH corresponding to the scene, and then ships the application to a user for execution. In another example, an application developer uses the BVH builder 501 to generate a BVH corresponding to a scene and uses the BVH to run a ray-tracing enabled application. In another example, the BVH builder 501 residing in the device 100 (e.g., in the APD 116) generates a BVH from the application's scene geometry, and the APD 116 then uses the generated BVH to render the scene's geometry. While several example usage scenarios are described, these examples should not be construed as limiting.
[0031] FIG. 6A illustrates an example of generating a BVH using a top-down technique. The top-down technique iteratively constructs the BVH. The top-down technique starts with a box node having a bounding volume. In the example geometry 600 of FIG. 6A, bounding volume 601 bounds triangle 603. A centroid 605 is shown for each triangle. The centroid represents a vertex location that characterizes the triangle's position. In some examples, the centroid of a triangle is the intersection point between a line that bisects each edge and terminates at the edge and the opposite vertex.
[0032] For a given box node (e.g., root node 602 or box node 604), the BVH builder 501 identifies a set of candidate splits for the bounding volume of that box node, evaluates all candidate splits, determines a cost metric for each candidate split, and selects one of the candidate splits based on a comparison of the cost metrics. Any technically feasible cost metric can be used. In some examples, the cost metric is the sum of the areas of the faces of the bounding boxes that tightly fit the triangles of each portion of the candidate split, while in other examples, other cost metrics are used, such as a cost metric based on the bounding volume surface area of the bounding boxes for the portions of the candidate split. In one example, if a candidate split defines a first set of triangles and a second set of triangles, a bounding box is formed that tightly bounds each set. Next, the area of each face of each bounding box is determined, and thus the sum of those areas for each bounding box is determined and summed. This metric is the cost metric, and is generated for each candidate split. The smallest such cost metric indicates which split should be selected. Again, although a particular cost metric is described, any technically feasible cost metric for selecting candidate splits is possible.
[0033] The selected candidate split indicates which triangles in the bounding volume 601 of a box node should be included in each of the child box nodes 604. More specifically, the candidate split defines which geometric portions of that bounding volume 601 are associated with which child box nodes 604. Each child box node 604 is assigned a different geometric portion.
[0034] 6A, the selected candidate split 600 indicates that one side of the split includes triangles 603-1 and 603-2, and the other side of the split includes triangles 603-3, 603-4, and 603-5. Thus, in this example, one child box node 604 of the root node 602 is generated using a bounding box that bounds the triangles on one side (603-1, 603-2), and another child box node 604 of the root node 602 is generated using a bounding box that bounds the triangles on the other side (603-3, 603-4, 603-5).
[0035] FIG. 6B illustrates a set of candidate splits for a box node, according to one example. Nine candidate splits are shown (650-1 through 650-9). For each candidate split, a different boundary 652 between different sides of the split is shown. It can be seen that different sets of triangles fall within different sides of each candidate split. Thus, for each candidate split, a different set of triangles will be contained within a different bounding box. Thus, each different candidate split represents a different way of subdividing triangles among the children of the box node. Furthermore, each set of triangles on each side of each candidate split is associated with a different bounding volume. Thus, each candidate split has children with different bounding boxes. While FIG. 6B illustrates a technique for grouping primitives based on their position in three-dimensional space, other techniques for grouping primitives together are also possible. Such other techniques may or may not consider the location and / or extent of such primitives, and may additionally or alternatively consider other aspects of such primitives, such as primitive size, etc.
[0036] FIG. 6B shows nine different candidate splits. This number is small for clarity of explanation. However, it is possible to have a very large number of candidate splits. For example, three candidate splits 650-1, 650-2, and 650-3 are shown, which partition the geometry horizontally at three different points. A typical bounding volume hierarchy may contain a huge number of triangles. For such a bounding volume hierarchy, the number of possible candidate splits can be very large. In addition to the above, in a naive approach to constructing a top-down bounding volume hierarchy, for each candidate split, the BVH builder 501 must access each triangle to determine which side of the split it is on. In this naive approach, such a determination must be made for each node and each candidate split, resulting in a large number of calculations that must be performed. This means that constructing a bounding volume hierarchy in a top-down manner can be very time-consuming.
[0037] For at least these reasons, techniques useful for reducing the amount of time required to construct a BVH in a top-down manner are provided herein. Generally, these techniques involve predefining triangle sets at different levels of detail and centroid boxes for each triangle set before constructing the BVH. Generally, the size of the centroid box for a triangle set at a particular level of detail will differ from the size of the centroid boxes for triangle sets at different levels of detail, but the actual size of these centroid boxes will vary based on the actual geometry within each triangle set. As noted above, the techniques involve generating centroid boxes for each triangle set. A centroid box is a box that bounds the centroids of the triangles in the triangle set. Note that a triangle set's centroid box is generally smaller than the triangle set's bounding volume, since a bounding volume bounds the complete geometry of a triangle, whereas a triangle's centroid box bounds the triangle's centroid. The result of the above is a data structure (sometimes referred to herein as a "triangle set collection") that includes multiple levels of detail, each having a triangle set. Each triangle set specifies a bounding box that bounds the triangles in that triangle set and a centroid box that bounds the centroids of those triangles. While "triangle set collection" is sometimes described herein, in some instances "primitive set collection" may be used instead. Any instance of the term "triangle set collection" can be replaced with "primitive set collection" in this document. Primitive set collections are similar to triangle set collections, except that primitive set collections have primitives instead of triangles. Primitives are broader than triangles and include triangles or other geometry that can be found in leaf nodes of a BVH. Such other geometry includes procedurally defined geometry, which is geometry whose intersection with a ray is determined based on the execution of a shader program or through some other technique. Other geometry can also include non-triangle primitives that are not procedural.The primitives in the primitive set collection do not include the bounding box found in the box node of the BVH. In addition to the above, where triangles are discussed herein, such discussions also apply to non-triangle primitives. In other words, the term "triangle" can be substituted for the term "primitive" in this specification.
[0038] Triangle set collection enables top-down creation of BVHs with a certain speedup. More specifically, as described above, in a simple implementation of the top-down approach for every node, for every candidate split, the BVH builder must determine where each triangle is located within that candidate split (i.e., which side of the split the triangle is on). Thus, in such an implementation, the BVH builder must iterate over each triangle for each candidate split. By building triangle set collection using the information described above, determining which side of a candidate split each centroid box is on allows the determination of which side of a candidate split each BVH node of the BVH being built is on, rather than for each triangle. By having a fixed number of such centroid boxes, the BVH builder iterates over a fixed number of centroid boxes rather than over the number of triangles, thereby reducing the time complexity of the BVH. In other words, by pre-constructing a triangle set collection with centroid boxes and then determining which side each centroid box is on, rather than which side each individual triangle is on, the amount of time required for BVH construction is reduced. While triangles must still be placed in centroid boxes initially, this process occurs early in BVH construction, rather than for each node of the BVH being constructed. Thus, rather than determining for each node of the BVH being constructed which triangles are on each side of the split, for each node of the BVH being constructed, it is determined which centroid boxes are on each side. The time complexity improvement arises from the fact that evaluating all triangles for each node takes significantly more time than evaluating candidate sets for each node. Specifically, once a triangle set collection is constructed, a fixed number of centroid boxes exist in such triangle set collection. Therefore, for the BVH being constructed, the number of items evaluated for placement on sides of candidate splits is constant.In contrast, in simple embodiments, the number of items evaluated is not constant; rather, the number scales with the number of triangles represented by the BVH being constructed. Since time complexity represents how much time is consumed by an algorithm as a function of the number of objects processed by the algorithm, an algorithm that replaces a variable number of items (triangles) with a fixed number of items (centroid boxes) will have a lower time complexity. It should be understood that a centroid box may contain multiple triangles, and that there may be a fixed number of centroid boxes, such that the number of centroid boxes may be fixed rather than varying based on the number of primitives. Additional details are provided here.
[0039] FIG. 7 illustrates an exemplary triangle set collection 700. Triangle set collection 700 includes several box nodes 704. Root node 702 is also a box node 704. Each box node is a set of triangles. Thus, each box node has an associated set of triangles, an associated bounding volume, and an associated centroid box. For a given box node, the associated triangles are shown below reference number 704. For example, box node 704-1 is associated with triangles 710-1 through 710-10. Thus, box node 704-1 has a bounding volume that bounds all of triangles 1 through 10, and box node 704-1 has a centroid box that bounds the centroids of all of triangles 1 through 10. In some instances, the phrase "bounding" as used herein means tightly bounding the referenced object, meaning that the box is large enough to encompass all of the referenced items, but not larger.
[0040] It should be understood that the illustrated triangle set collection 700 is itself a BVH. This BVH is used to construct a different, more performant BVH. In other words, the techniques described herein generate a first BVH that is used to spatially classify the triangles of a scene, and the spatial classification from this first BVH is used to help generate a second, more performant BVH that is the final result of the technique. In some examples, the first BVH 700 is constructed using a relatively simple BVH construction algorithm, such as a parallel linear BVH (LBVH). Any BVH construction algorithm can be used to generate the BVH used to generate the triangle set used in the BVH construction technique of the present disclosure, as long as there is no overlap in the centroid boxes of each split. In other words, the BVH construction technique of the present disclosure can be thought of as a means to refine a different BVH into a more performant BVH. It should be understood that the topology of a BVH can significantly affect the performance of BVH traversal. The parallel linear BVH is particularly suitable for generating the first BVH because it generates the BVH in a manner based on a virtual grid of centroids using Morton codes. For this reason, the centroid boxes used for the primitive set are integer-based bounding boxes created from the Morton codes that form the virtual grid. This aspect allows for easy calculation of the centroid box range corresponding to each bounding box of the LBVH and the primitives that fall within such centroid boxes. In other words, the LBVH defines a grid in which each cell corresponds to a different integer Morton code value. Furthermore, the centroid of any particular primitive has one of such integer Morton code values. Therefore, it is easy to determine which centroid box a primitive falls within and, therefore, to generate a centroid box for each bounding box of the LBVH that indicates the range of the centroid within such a centroid box. While an example of generating a triangle set by constructing a BVH is described, the techniques presented herein are not limited to utilizing a triangle set generated from a BVH.
[0041] The levels 706 of the BVH represent different levels of detail of the triangle set. For example, level 706-1 represents a higher level of detail than level 706-2. Again, higher levels of detail generally contain more triangles, generally more than lower levels of detail.
[0042] Referring now to the generation of a second, more performant BVH, as described with respect to FIG. 6A , building such a BVH in a top-top manner involves iteratively generating BVH node children for the BVH by evaluating candidate splits of triangles bounded by that box node. In one example, the BVH builder 501 generates children of a box node (e.g., box node 602) for the BVH being constructed. To perform this operation, the BVH builder 501 identifies triangles within the bounding volume of the box node 602 and generates multiple candidate splits for those triangles. Each candidate split indicates a specific number of "sides" and the triangles belonging to each side. The BVH builder 501 selects the candidate splits as allowed splits and generates box node children for each side of the allowed split. The BVH builder 501 then continues to perform these operations to generate the complete BVH. For example, the BVH builder 501 generates children of a newly created box node in a manner similar to the way it generates children of the root node 602, etc. In some examples, the BVH builder 501 stops generation when the BVH is complete.
[0043] As described above, generating a BVH involves determining which triangles fall within each candidate split. In the techniques described herein, this step is performed by determining which centroid boxes of the triangle set collection lie within each candidate split. Because each centroid box contains one or more triangles, determining which centroid boxes lie within each candidate split necessarily involves determining which triangles lie within each candidate split. More specifically, for any given BVH node of the BVH being constructed, the technique involves determining which centroid boxes lie within each side of the candidate split. The technique then includes selecting a candidate split based on a cost metric and generating child nodes of the BVH node of the BVH being constructed based on the candidate split, as described elsewhere herein.
[0044] For a given BVH node of the BVH being constructed, the BVH builder 501 performs the following operations: The BVH builder 501 determines an appropriate partitioning resolution. The partitioning resolution specifies the size of the cells of the centroid box that bounds all of the centroids of the primitives derived from the BVH node. The cells, as described in more detail below, define how to evaluate the triangle set collection to determine which triangle sets are in which partitions of the non-leaf node of the BVH being constructed. Figure 8 illustrates different partitioning resolutions, according to an example. At a first partitioning resolution 802-1, the size of cell 804-1 is larger than the size of cell 804-2 at a second partitioning resolution 802-2.
[0045] In some examples, the appropriate partition resolution is an adjustable parameter provided as input to the BVH builder 501 (e.g., by an application running on the CPU 102 or by another software entity (such as a shader program) or hardware entity (such as hardware in the APD 116)). In some examples, this resolution specifies the number of cells that divide the centroid boxes corresponding to non-leaf nodes of the BVH being constructed. Thus, in these examples, the partition resolution specifies the number of cells that divide the centroid boxes corresponding to box nodes of the BVH being constructed, but does not necessarily specify the absolute size of those boxes. For a given box node of the BVH being constructed, the partition resolution determines the possible number of candidate splits. More specifically, the boundaries of the partition resolution cells 804 indicate the boundaries of the candidate splits. In one example, the BVH builder 501 determines multiple candidate splits, each such candidate split having at least one side different from all sides of the remaining candidate splits, and the boundaries of each candidate split are aligned with the boundaries of the cells 804 of the partition resolution. In one example, a candidate split for partition resolution 802-1 may include a lower side including the bottom four cells 804-1 and an upper side including the top four cells 804-1. A different candidate split for that partition resolution may include a left side including the left four cells 804-1 and a right side including the right four cells 804-1. For partition resolution 802-2, more candidate splits may result. For example, the bottom plane of cell 804-2 may form one side of the split, and the top three planes of cell 804-2 may form a different side. Alternatively, the bottom two planes of cells 804-2 can form one side of a split, and the top two planes can form the other side. By "plane" we mean a set of cells 804-2 that have the same vertical position (but vary by depth and horizontal position). As shown, it can be seen that the partition resolution for the centroid box in which candidate splits are determined determines the number of possible candidate splits to evaluate.A finer resolution (eg, partition resolution 802-2) will result in more candidate splits, and a coarser resolution (eg, partition resolution 802-1) will result in fewer candidate splits.
[0046] To generate candidate splits for candidate BVH nodes of the BVH being constructed, the BVH builder 501 uses the triangle set collection 700. Specifically, the BVH builder 501 traverses the triangle set collection 700 downward from the candidate BVH node to find a group of BVH nodes that represent all triangles that are descendants of the candidate BVH node. Each BVH node in the group of BVH nodes has a centroid box that falls within a cell 802 of the selected partition resolution 802.
[0047] It should be understood that within the triangle set collection 700, box nodes have pointers to their child box nodes. Traversing down the triangle set collection 700 means following these pointers. Traversing down the triangle set collection 700 to find a group of BVH nodes means finding the top-most BVH nodes 704 whose centroid boxes fall within the cell 802, and finding the BVH nodes 704 that together "cover" all the triangles bounded by the candidate BVH nodes of the BVH being constructed.
[0048] 9 shows an example of finding a group of box nodes representing all triangles that are descendants of a candidate box node, as described above. In this example, the candidate box node is box node 702. BVH builder 501 searches down the tree for the highest box node 704 whose centroid box falls within cell 902 (for the partition resolution already selected, as shown). BVH builder 501 identifies further box nodes 704 until the set of identified box nodes together bounds all of the triangles bounded by candidate box node 702.
[0049] 9, the BVH builder 501 examines box node 704-1 and determines that its centroid box (i.e., the box that tightly bounds all of the centroids of all of the triangles bounded by the box's bounding volume) does not fit within a single cell 902. The BVH builder 501 examines box node 704-1's two children, box nodes 704-3 and 704-4. The BVH builder 501 determines that the centroid box of box node 704-3 fits within cell 902, but the centroid box of box node 704-4 does not fit within cell 902. The BVH builder 501 identifies box node 704-3 as any of a group of box nodes that represent all of the triangles that are descendants of the candidate box node 702. The BVH builder 501 examines the children of box node 704-4 and determines that the centroid boxes of box nodes 704-9 and 704-10 each fall within their respective cells 902. Similarly, the BVH builder 501 determines that the centroid box of node 704-2 does not fall within cell 902, but the centroid boxes of nodes 704-5 and 705-6 do fall within their respective cells 902. The identified box nodes are 704-3, 704-9, 704-10, 704-5, and 704-6. This group further encloses all of triangles 1 through 16, all triangles enclosed by candidate box node 702. The result is a group of identified box nodes in triangle set collection 700. This group can be used to determine which triangles fall within each candidate split in a more performant manner than if every triangle had to be checked individually.
[0050] 9 illustrates the placement of centroid boxes 904 within centroid box cells 902 of candidate box node 702. Centroid box 904-1 is associated with node 704-3 and falls within cell 902-1. Centroid box 904-2 is associated with node 704-9 and falls within cell 902-2. Centroid box 904-3 is associated with node 704-10 and falls within cell 902-3. Centroid box 904-4 is associated with node 704-5 and falls within cell 902-6. Centroid box 904-6 is associated with node 704-6 and falls within cell 902-7. As can be seen, a set of nodes 704 has been found that span all triangles that are descendants of the candidate node of the BVH being constructed (not shown in FIG. 9) and fall within cell 902.
[0051] After finding the nodes 704 of the triangle set collection that fall within the cell for the node of the BVH being constructed, it is relatively straightforward to determine which triangles fall on which side of the candidate split. More specifically, because the extent of the cell 902 is known and the candidate split is defined relative to the cell boundary, determining on which side of the triangle set collection a particular node 704 that falls within the cell is straightforward because each node 704 has a corresponding centroid box. For example, to determine on which side of the candidate split a centroid box falls, the bounding volume hierarchy generator 501 compares the boundary of the centroid box with the boundaries on both sides of the candidate split and identifies the side of the centroid box as the side on which the centroid box falls. Thus, for any particular candidate split, it is relatively straightforward to determine the side associated with each of the nodes 704 determined to fall within the cell. The relatively few simple comparisons involved in this technique are much less work than comparing the actual geometry of each triangle against the boundaries of each side. This technique can therefore produce an output similar to a top-down "binning-based" BVH builder (e.g., one in which the builder evaluates, for each box node, which side of a candidate split each triangle is on), but at a much lower computational cost.
[0052] 9A-9C illustrate different candidate splits 900 according to an example. In FIG. 9A, boundary 908-1 divides the geometry into an upper side (associated with centroid box 910-1) and a lower side (associated with centroid box 910-2). Centroid box 910 bounds the centroid of centroid box 904. The upper side includes centroid box 904-1, centroid box 904-2, and centroid box 904-3, while the lower side includes centroid box 904-4 and centroid box 904-5. Bounding volume hierarchy generator 501 determines which side centroid box 904 lies on by comparing the extent of centroid box 904 to boundary 908-1. This determination results in a determination of which side each of the triangles corresponding to centroid box 904 lies on. Therefore, there is no need to test each such triangle against boundary 908-1.
[0053] In Figure 9B, boundary 908-2 divides centroid box 904 as shown, resulting in centroid box 910-3 and centroid box 910-4. Similarly, in Figure 9C, boundary 908-3 divides centroid box 904 as shown, resulting in centroid box 910-5 and centroid box 910-6. To determine the BVH node children corresponding to the geometry of Figures 9A-9C, bounding volume hierarchy builder 501 evaluates these candidate splits 900, selects one candidate split 900 based on selection criteria, and generates child BVH nodes from both sides of the split, as described elsewhere herein.
[0054] Figure 10 illustrates additional operations related to the construction of a BVH, according to one example. More specifically, Figure 10 illustrates the generation of a BVH under construction 1001 based on a triangle set collection 700 (in some examples, constructed using an algorithm such as LBVH, as described elsewhere herein, and in some examples, including a centroid box at each BVH node 704). Stage 1 1000-1 results in the generation of BVH nodes 1000-2 and 1000-3 from BVH nodes 1002-1. Specifically, the BVH builder 501 starts with the root node 702 of the triangle set collection 700 and forms node 1002-1 in the BVH under construction 1001 based on that root node 702. Node 1002-1 has a centroid box that bounds all of the centroids of the root node 702 and has a bounding box that bounds all of the triangles of the root node 702. At this point, node 1002-1 is a candidate box node for which a split is being generated.
[0055] The BVH builder 501 traverses down the triangle set collection 700 to identify a top-level node 704 whose centroid box falls entirely within a single cell 902 ( FIG. 9 ) and encloses all of the triangles enclosed by the root node 702. In stage 1000-1, the BVH builder 501 determines that the centroid box of each of nodes 704-3, 704-9, 704-10, 704-5, and 704-6 falls within a single cell. As described elsewhere herein, the size of the cell may be a tunable parameter. In some examples, the size of the cell is determined by dividing the centroid box of a candidate BVH node by a resolution parameter that is a tunable parameter or is derived from a tunable parameter. In one example, the resolution parameter specifies that the centroid box should be divided into 64 cells. Thus, different BVH nodes will have different cell sizes. In examples where the resolution parameter is a tunable parameter, the cell size is determined indirectly based on the resolution parameter. The adjustable parameters can be the same for different levels of the BVH being constructed, or can be different for different levels. In one example, the adjustable parameters are held constant until a certain level is filled, thus keeping the cell size constant. Any technically feasible means for setting the adjustable parameters to specify the resolution, and thus the cell size, of any particular box node 704 in the BVH 1001 being constructed is possible.
[0056] The BVH builder 501 generates candidate splits using identified BVH nodes that fall within a single cell, evaluates the candidate splits, and selects a candidate split based on any technically feasible criteria (e.g., minimum sum of bounding volume surface areas). The BVH builder 501 generates children based on the candidate splits, with each side corresponding to a new node in the BVH. Each such node has a bounding volume that bounds all primitives on the corresponding side and a centroid box that bounds the centroids of all primitives that are descendants of that node. In stage 1000-1, the generated BVH nodes include BVH node 1002-2 and BVH node 1002-3.
[0057] In stage 1000-2, the BVH builder 501 determines the children of the current candidate node, BVH node 1002-2. The BVH builder 501 starts with one or more BVH nodes in the triangle set collection 700 that together bound all triangles that are descendants of candidate node 1002-2. In this case, BVH node 704-1 bounds all such triangles. The BVH builder 501 traverses downward through the triangle set collection 700 to find the topmost BVH nodes that fit within a particular resolution cell and together enclose all triangles of candidate node 1002-2. In the illustrated example, such BVH nodes 704 include BVH nodes 704-7, 704-8, 704-15, and 704-16. The BVH builder 501 generates candidate splits from these BVH nodes, selects one of the candidate splits, and generates a child BVH node 1002-2 of the BVH under construction 1001 according to the selected candidate split. The BVH builder 501 repeats these steps until a complete BVH is constructed.
[0058] 11 is a flow diagram of a method 1100 for constructing a BVH, according to an example. Although described with respect to the systems of FIGS. 1-10, any system configured to perform the steps of method 1100 in any technically feasible order is within the scope of this disclosure.
[0059] In step 1102, the BVH builder 501 determines the cell size of the centroid box of the triangle set collection 700 based on the resolution for generating the cells. As mentioned above, the resolution may be associated with an adjustable parameter that indicates the number of cells into which the box node is divided.
[0060] In step 1104, the BVH builder 501 identifies a node in the triangle set collection that falls within the subdivided cell. More specifically, the BVH builder 501 finds the topmost box node in the triangle set collection 700 whose centroid box falls within the subdivided cell.
[0061] In step 1106, the BVH builder 501 generates candidate splits based on the identified nodes. Specifically, the BVH builder 501 selects multiple boundaries for different candidate splits, with each boundary on a cell face. The BVH builder then places the centroid box of each of the box nodes identified in step 1104 on one side of the candidate split by comparing the extents of the centroid box with the boundaries. The result for any particular candidate split indicates which centroid boxes (and therefore which nodes identified in step 1104) are on each side of the candidate split.
[0062] In step 1108, the BVH builder 501 selects one of the candidate splits based on a selection criterion. In various examples, the selection criterion specifies how to evaluate the different candidate splits to select the one deemed "best." In one example, the selection criterion is the surface area of the triangle's bounding volume multiplied by the number of primitives on each side.
[0063] In step 1110, the BVH builder 501 generates children of the box node of the BVH being constructed based on the selected candidate splits. Specifically, the BVH builder 501 generates one child for each side of the selected candidate split, with each child having a bounding volume that bounds all the geometry of the associated side.
[0064] The BVH builder 501 repeats method 1100 any number of times to construct the BVH. After step 1110, the BVH builder 501 selects a node of the BVH being constructed and generates a child node. For this node, step 1102 calculates the cell size for dividing the centroid box. Step 1104 identifies nodes of the triangle set collection that fall within the cell of the subdivided node and that together bound all of the triangles bounded by the subdivided node. The BVH builder 501 proceeds to steps 1106, 1108, and 1110, continuing for additional nodes of the BVH being constructed.
[0065] It should be understood that many variations are possible based on the disclosure herein, and although features and elements are described above in particular combinations, each feature or element can be used alone without other features and elements, or in various combinations, with or without other features and elements.
[0066] The various functional units illustrated in the figures and / or described herein (including, but not limited to, the processor 102, input drivers 112, input devices 108, output drivers 114, output devices 110, acceleration processing device 116, scheduler 136, computation unit 132, and SIMD unit 138) may be implemented as a general-purpose computer, processor, or processor core, or as a program, software, or firmware stored on a non-transitory computer-readable storage medium or another storage medium executable by the general-purpose computer, processor, or processor core. The provided methods may be implemented in a general-purpose computer, processor, or processor core. Suitable processors include, by way of example, a general-purpose processor, a special-purpose processor, a conventional processor, a digital signal processor (DSP), multiple microprocessors, one or more microprocessors associated with a DSP core, a controller, a microcontroller, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) circuit, any other type of integrated circuit (IC), and / or a state machine. Such a processor may be fabricated by configuring a fabrication process using the results of processed hardware description language (HDL) instructions and other intermediate data, including netlists (instructions that may be stored on a computer-readable storage medium). The result of such processing may be a maskwork that is used in subsequent semiconductor fabrication processes to produce a processor embodying features of the present disclosure.
[0067] The methods or flowcharts provided herein may be implemented in a computer program, software, or firmware embodied in a non-transitory computer-readable storage medium for execution by a general purpose computer or processor. Examples of non-transitory computer-readable storage media include read only memory (ROM), random access memory (RAM), registers, cache memory, semiconductor memory devices, magnetic media such as internal hard disks and removable disks, magneto-optical media, and optical media such as CD-ROM disks and digital versatile disks (DVDs).
Claims
1. 1. A method for constructing a bounding volume hierarchy, comprising: subdividing the candidate box node based on a resolution to generate a plurality of cells of the candidate box node; identifying a plurality of nodes of a primitive set collection that fall within the cell; generating a plurality of candidate splits based on the plurality of nodes; selecting candidate splits based on a selection criterion to obtain selected candidate splits; generating child box nodes for the box nodes of the bounding volume hierarchy being constructed based on the selected candidate splits; method.
2. The resolution indicates the number of cells into which the candidate box node is subdivided.
10. The method of claim 1.
3. identifying the plurality of nodes that fall within the cell includes identifying nodes whose centroid boxes fall within a single one of the candidate box node cells; 10. The method of claim 1.
4. the centroid box comprises a box bounding the centroid of the node's primitives; The method of claim 3.
5. generating the plurality of candidate splits includes dividing a bounding volume of the candidate box node based on boundaries aligned with the plurality of cells; 10. The method of claim 1.
6. selecting the candidate splits includes evaluating the plurality of candidate splits according to the selection criteria; and selecting one of the candidate splits.
10. The method of claim 1.
7. The selection criterion is a minimum total bounding box surface area criterion.
10. The method of claim 1.
8. generating the child box nodes includes generating a child box node for each side of the selected candidate split, each child box node having a bounding box that bounds each primitive on the side corresponding to the child box node.
10. The method of claim 1.
9. repeating the subdividing, the identifying, generating the plurality of candidate splits, the selecting, and generating child box nodes for a plurality of box nodes in the bounding volume hierarchy being constructed; 10. The method of claim 1.
10. 1. A system for constructing a bounding volume hierarchy, comprising: a memory configured to store a bounding volume hierarchy; a bounding volume hierarchy builder configured to build the bounding volume hierarchy by performing operations; The operation is subdividing the candidate box node of the bounding volume hierarchy based on a resolution to generate a plurality of cells of the candidate box node; identifying a plurality of nodes of a primitive set collection that fall within the cell; generating a plurality of candidate splits based on the plurality of nodes; selecting candidate splits based on a selection criterion to obtain selected candidate splits; generating child box nodes for the box nodes of the bounding volume hierarchy being constructed based on the selected candidate splits; system.
11. The resolution indicates the number of cells into which the candidate box node is subdivided. The system of claim 10.
12. identifying the plurality of nodes that fall within the cell includes identifying nodes whose centroid boxes fall within a single one of the candidate box node cells; The system of claim 10.
13. the centroid box comprises a box bounding the centroid of the node's primitives; The system of claim 12.
14. generating the plurality of candidate splits includes dividing a bounding volume of the candidate box node based on boundaries aligned with the plurality of cells; The system of claim 10.
15. selecting the candidate splits includes evaluating the plurality of candidate splits according to the selection criteria; and selecting one of the candidate splits. The system of claim 10.
16. The selection criterion is a minimum total bounding box surface area criterion. The system of claim 10.
17. generating the child box nodes includes generating a child box node for each side of the selected candidate split, each child box node having a bounding box that bounds each primitive on the side corresponding to the child box node. The system of claim 10.
18. the bounding volume hierarchy builder is configured to repeat the subdividing, the identifying, generating the plurality of candidate splits, the selecting, and generating child box nodes for a plurality of box nodes of the bounding volume hierarchy being constructed. The system of claim 10.
19. A computer-readable storage medium storing instructions, comprising: The instructions, when executed by a processor, subdividing the candidate box node based on a resolution to generate a plurality of cells of the candidate box node; identifying a plurality of nodes of a primitive set collection that fall within the cell; generating a plurality of candidate splits based on the plurality of nodes; selecting candidate splits based on a selection criterion to obtain selected candidate splits; generating child box nodes for the box nodes of the bounding volume hierarchy being constructed based on the selected candidate splits; causing the processor to perform A computer-readable storage medium.
20. The resolution indicates the number of cells into which the candidate box node is subdivided.
20. The computer-readable storage medium of claim 19.