Methods of performing intersection tests, ray tracing systems, and storage media

By introducing a beam intersection test method into the ray tracing system and optimizing the ray processing flow, the problems of high computational load and limited resources in the existing technology are solved, and the effect of efficiently rendering complex 3D scenes on mobile devices is achieved.

CN114119841BActive Publication Date: 2026-03-31IMAGINATION TECH LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-24
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In ray tracing systems, existing technologies involve large computational demands when performing intersection tests, making it difficult to meet the needs of real-time rendering of complex 3D scenes, especially on resource-constrained mobile devices, where there is a trade-off between performance, power consumption, and area.

Method used

By introducing beam intersection testing methods, including AllHit and AnyHit tests, into the ray tracing system, the system uses the contour edge vector of the bounding box to determine whether the ray beam intersects with or misses the bounding box, reducing the number of intersection tests. Furthermore, the ray processing workflow is optimized through ray beam builder and tester modules.

Benefits of technology

It improves the performance and efficiency of ray tracing systems, reduces the consumption of computing resources, and is suitable for real-time rendering of complex 3D scenes without significantly increasing power consumption and area, especially on mobile devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114119841B_ABST
    Figure CN114119841B_ABST
Patent Text Reader

Abstract

The invention relates to a method, a ray tracing system and a storage medium for performing an intersection test. A ray tracing system and a computer-implemented method for performing an intersection test for a ray bundle with respect to a box are described. Contour edges of the box are identified from a perspective of the ray bundle. For each of the identified contour edges, a component of a vector providing a boundary to the ray bundle is obtained and it is determined whether the vector passes inside or outside the contour edge. A result of the intersection test for the ray bundle with respect to the box is determined using the result of the determination whether the vector passes inside or outside the contour edge for each of the identified contour edges.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to techniques for performing intersection tests in a ray tracing system. Background Technology

[0002] Ray tracing is a computational rendering technique used to generate an image of a scene (e.g., a 3D scene) by tracing the paths of light (“rays”) through the scene from a camera’s viewpoint. Each ray is modeled as originating from the camera and entering the scene through pixels. As a ray traverses the scene, it may intersect with objects within the scene. Intersections between rays and their intersecting objects can be modeled to create realistic visual effects. For example, in response to determining that a ray intersects with an object, a shader program (i.e., part of the computer code) can be executed for the intersection. Programmers can write shader programs to define how the system reacts to intersections (which, for example, might result in the emission of one or more secondary rays into the scene), for example, to represent the reflection of light from the intersecting object or the refraction of light through the object (e.g., if the object is transparent or translucent). As another example, a shader program can cause one or more rays to be emitted into the scene to determine whether an object is in shadow at the intersection point. The result of executing the shader program (and processing the associated secondary rays) can be the calculation of the color values ​​of the pixels through which the ray passes.

[0003] To reduce the number of intersection tests that need to be performed, ray tracing systems can generate accelerated structures, where each node of the accelerated structure represents a region within the scene. Accelerated structures are typically hierarchical (e.g., tree-like), containing multiple levels of nodes, where nodes near the top of the accelerated structure represent relatively large regions in the scene (e.g., the root node could represent the entire scene), and nodes near the bottom of the accelerated structure represent relatively small regions. A "tree node" is a node that has pointers to other nodes in the hierarchical accelerated structure (i.e., a tree node has child nodes in the hierarchical accelerated structure). A "leaf node" is a node that has one or more pointers to one or more primitives (i.e., a leaf node does not have child nodes in the hierarchical accelerated structure). In other words, the leaf nodes of an accelerated structure represent regions in the scene that define one or more objects. Accelerated structures can have different structures in different examples, such as grid structures, octree structures, spatially separated structures (e.g., kd-trees), or bounding volume hierarchies. Nodes can represent suitable shapes or regions in the scene (which may be referred to as "boxes" in this document). In some examples, nodes represent axis-aligned bounding boxes (AABBs) in the scene.

[0004] An accelerated structure can be used to perform intersection tests on rays by first testing their intersection with the root node of the accelerated structure (e.g., recursively). If a ray is found to intersect with a parent node (e.g., the root node), the test can proceed to the child nodes of that parent node. In contrast, if a ray is found not to intersect with a parent node, intersection tests on the child nodes of that parent node can be avoided, thus saving computational effort. If a ray is found to intersect with a leaf node, then the ray can be tested against objects(s) within the area represented by the leaf node to determine which(s) the ray intersects with. If a ray is found to have more than one intersection point, then the intersection point closest to the ray's origin (i.e., the first intersection the ray encounters in the scene) can be identified, and the ray can be determined to have intersected at this identified closest intersection point. Using an accelerated structure (instead of directly testing rays with objects in the scene) reduces the number of intersection tests that need to be performed and simplifies the intersection testing process. Intersection testing is simpler because the nodes of the accelerated structure represent basic shapes (e.g., axis-aligned bounding boxes or spheres), for which intersection testing is simpler than for more complex object shapes, such as those defined by triangular primitives whose orientation is not predetermined. Summary of the Invention

[0005] This summary is provided to introduce some concepts that are further described in the following detailed description. This summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter.

[0006] A computer-implemented method for performing an intersection test in a ray tracing system is provided, the method comprising:

[0007] Receive the light beam that intersects with the frame to be tested;

[0008] The outline edge of the frame is identified from the perspective of the light beam;

[0009] For each of the outline edges of the identifier:

[0010] Obtain the components of the vector that provides the boundary to the light beam; and

[0011] Determine whether the vector passes through the inside or outside of the contour edge; and

[0012] Using the result of determining whether the vector passes inside or outside the contour edge for each of the identified contour edges, the intersection test result of the light beam relative to the frame is determined.

[0013] For each of the outline edges of the identifier, the components of the obtained vector may include the components of a single vector that provides a single boundary to the light beam.

[0014] For each of the identified contour edges, determining whether the vector passes inside or outside the contour edge, the vector may be a unique vector for determining whether the vector passes inside or outside the contour edge for the light beam.

[0015] The intersection test result of the light beam relative to the frame can be determined using the result of determining whether the vector passes inside or outside the contour edge for each of the identified contour edges, without using any other result of determining whether any other vector passes inside or outside the contour edge.

[0016] For each of the outline edges of the identifier, the vector may provide an outer boundary to the ray beam relative to the outline edge of the identifier, such that if the vector does not pass outside the outline edge of the identifier, then it is known that none of the rays in the beam pass outside the outline edge of the identifier. If it is determined that the vector passes inside the outline edge of the corresponding identifier for each of the outline edges of the identifier, then the intersection test result of the ray beam relative to the frame may be that all the rays in the ray beam intersect the frame. If it is determined that the vector passes outside the outline edge of the corresponding identifier for one or more of the outline edges of the identifier, then the intersection test result of the ray beam relative to the frame may not be that all the rays in the ray beam intersect the frame. If the intersection test result of the ray beam relative to the frame is not that all the rays in the ray beam intersect the frame, then the method may further include determining whether any one of the rays in the ray beam intersects the frame.

[0017] For each of the outline edges of the identifier, the vector may provide an inner boundary to the ray beam relative to the outline edge of the identifier, such that if the vector does not pass inside the outline edge of the identifier, then it is known that none of the rays in the beam pass inside the outline edge of the identifier. If it is determined that the vector passes inside the outline edge of the corresponding identifier for each of the outline edges of the identifier, then the intersection test result of the ray beam relative to the box may not be that all the rays in the ray beam miss the box. If it is determined that the vector passes outside the outline edge of the corresponding identifier for one or more of the outline edges of the identifier, then the intersection test result of the ray beam relative to the box may be that all the rays in the ray beam miss the box. If the intersection test result of the ray beam relative to the box is not that all the rays in the ray beam miss the box, then the method may further include determining which of the rays in the ray beam intersect the box.

[0018] The frame can be an axis-aligned bounding box.

[0019] The method may further include:

[0020] Perform a direction check to determine whether the frame is behind the origin of the light beam, wherein if the direction check determines that the frame is behind the origin of the light beam, the intersection test result is that the light beam misses the frame; and / or

[0021] A distance check is performed to determine whether the light beam terminates at a point in front of the frame, wherein if the distance check determines that the light beam terminates at a point in front of the frame, the intersection test result is that the light beam misses the frame.

[0022] The obtained component of the vector that provides the boundary to the light beam can be the same as the component of the direction vector of one of the light rays in the beam.

[0023] The obtained component of the vector that provides the boundary to the light beam can be selected from a set of component values, which includes the minimum and maximum component values ​​in each dimension of the direction vector of the light beam in the light beam.

[0024] All rays of the light beam can have the same origin. For each of the identified contour edges, determining whether the vector passes inside or outside the contour edge can include performing a comparison according to the following formula: (p o,i -o i )d j <(p o,j -o j )d i , where p o,i p represents the i-th component of a point on the first plane of the first side of the frame forming the outline edge. o,j It is the j-th component of a point on the second plane of the second side of the frame forming the outline edge, o i and o j These are the i-th and j-th components of the light rays at the origin of the light beam, and d i and d j These are the i-th and j-th components of the vector that provides the boundary to the light beam. "According to" (p o,i -o i )d j <(p o,j -o j )d i Performing a comparison includes using mathematical equations, such as...

[0025] It is possible that not all rays in the light beam have the same origin. For each of the identified contour edges, determining whether the vector passes inside or outside the contour edge may include performing a comparison according to the following formula: (p o,i -o i,[min,max] )d j <(p o,j -o j,[min,max] )d i , where p o,i p represents the i-th component of a point on the first plane of the first side of the frame forming the outline edge. o,j It is the j-th component of a point on the second plane of the second side of the frame forming the outline edge, o i[min,max] It is the minimum or maximum value of the i-th component of the light ray at the origin of the light ray beam, o j[min,max] It is the minimum or maximum value of the j-th component of the light ray at the origin of the light ray beam, and d i and d j These are the i-th and j-th components of the vector that provides the boundary to the light beam. As described above, "according to" (p o,i -o i,[min,max] )d j <(p o,j -o j,[min,max] )d i Performing a comparison includes using mathematical equations, such as...

[0026] The method may further include: receiving light rays; and constructing a light beam based on the received light rays to test intersection with the frame. Constructing the light beam may include grouping the received light rays together based on the similarity of the received light rays.

[0027] The constructed light beam may include:

[0028] Maintain a set of open beams into which new light can be added; and

[0029] For each of the received light rays:

[0030] Determine the similarity level between the received light and each of the open beams;

[0031] Based on a determined similarity level, the best-matching open beam in the set of open beams is identified for the received light; and

[0032] If the received light has a similarity level with the determined best-matching open bundle that is higher than a threshold, then the received light is added to the best-matching open bundle.

[0033] The method may further include specific steps for each of the received light rays:

[0034] If the determined similarity level of the best-matching open beam is lower than the threshold, a new beam is created and the received light is added to the new beam.

[0035] The received light rays constituting the bundle may: (i) include new light rays that have not previously been included in the light bundle, but (ii) not include light rays that have previously been included in the light bundle.

[0036] The received light rays constituting the beam may include:

[0037] New rays that were not previously included in the ray beam, and

[0038] The light rays that were previously contained within the already deconstructed beam of light.

[0039] The data for the light beam can be stored in a data structure and can include:

[0040] The origin data of the light beam;

[0041] Vector data describing the components of the vector that provides the boundary to the light beam; and

[0042] One or more pointers to the light data of the light beam pointing to the light beam.

[0043] The method may further include:

[0044] Forming groups, said groups comprising one or both ray indicators and ray beam indicators, said rays and ray beams requiring access to the same memory block to perform an intersection test; and

[0045] Data is extracted from the memory block to perform an intersection test on one or both of the rays and ray bundles indicated by the indication in the group.

[0046] The method may further include separating the light beam into individual light rays while satisfying a separation metric, wherein the separation metric may be based on one or more of the following:

[0047] The number of light rays in the light beam;

[0048] The dispersion of the light rays in the light beam;

[0049] The size of the region defined by the outline edge of the frame;

[0050] Is the source of the light rays in the light beam a frame shader or a ray shader?

[0051] Data provided by the shader that creates the light rays in the light beam.

[0052] A ray tracing system is provided, comprising:

[0053] A tester module configured to receive a beam of light intersecting with a frame to be tested, wherein the tester module includes:

[0054] A set of one or more test blocks, configured to perform an intersection test on a received light beam relative to the frame by:

[0055] The outline edge of the frame is identified from the perspective of the light beam;

[0056] For each of the outline edges of the identifier:

[0057] Obtain the components of the vector that provides the boundary to the light beam; and

[0058] Determine whether the vector passes through the inside or outside of the contour edge; and

[0059] Using the result of determining whether the vector passes inside or outside the contour edge for each of the identified contour edges, the intersection test result of the light beam relative to the frame is determined.

[0060] The test blocks in the set of one or more test blocks can be configured to perform intersection tests on light beams and on single light beams.

[0061] The tester module may further include a result processor configured to process the intersection test results of the light beam relative to the frame.

[0062] The tester module may also include a memory configured to store data describing the frame, the data having been retrieved from the memory to perform the intersection test relative to the frame.

[0063] The ray tracing system may further include a beambuilder, the beambuilder being configured to:

[0064] Receive light; and

[0065] The received light rays are grouped together based on their similarity, thereby constructing a beam of light that intersects with the frame to be tested.

[0066] A ray tracing system is provided that can be configured to perform any of the methods described herein.

[0067] This paper describes a ray tracing system, including:

[0068] A tester module configured to receive a beam of light intersecting with a frame to be tested, wherein the tester module includes:

[0069] A first test block is configured to perform a first beam intersection test to determine whether all the rays of the beam intersect the frame, wherein if the first beam intersection test determines that all the rays of the beam intersect the frame, then the beam intersection test result relative to the frame is that all the rays of the beam intersect the frame; and

[0070] A second test block is configured to perform a second beam intersection test to determine whether all the rays of the beam miss the frame, wherein if the second beam intersection test determines that all the rays of the beam miss the frame, the intersection test result of the beam relative to the frame is that all the rays of the beam miss the frame, and

[0071] The tester module is configured to operate in the following situations: First, a beam intersection test is uncertain if all rays of the beam intersect the frame; second, a beam intersection test is uncertain if all rays of the beam miss the frame.

[0072] Separating the light beam into individual light rays; and

[0073] An intersection test is performed on the individual rays relative to the frame to determine which of the individual rays intersect with the frame.

[0074] This paper describes a computer-implemented method for performing intersection tests in a ray tracing system, the method comprising:

[0075] Receive the light beam that intersects with the frame to be tested;

[0076] Perform a first beam intersection test to determine whether all the rays of the beam intersect the frame, wherein if the first beam intersection test determines that all the rays of the beam intersect the frame, then the beam intersection test result relative to the frame is that all the rays of the beam intersect the frame; and

[0077] If the first beam intersection test is uncertain whether all rays of the beam intersect the frame, the result of a second beam intersection test is used to determine the beam's intersection test result relative to the frame. This second beam intersection test determines whether all rays of the beam miss the frame.

[0078] Wherein, if the result of performing the second beam intersection test indicates that all the rays of the beam miss the frame, then the beam intersection test result relative to the frame is that all the rays of the beam miss the frame, and

[0079] If the first beam intersection test is uncertain that all rays of the beam intersect the frame, and if the result of performing the second beam intersection test does not indicate that all rays of the beam miss the frame, then the method further includes:

[0080] Separating the light beam into individual light rays; and

[0081] An intersection test is performed on the individual rays relative to the frame to determine which of the individual rays intersect with the frame.

[0082] The ray tracing system described herein can be embodied in hardware on an integrated circuit. A method for manufacturing a ray tracing system at an integrated circuit manufacturing system is provided. An integrated circuit definition dataset is provided that, when processed in an integrated circuit manufacturing system, configures the system to manufacture a ray tracing system. A non-transient computer-readable storage medium is provided that stores a computer-readable description of a ray tracing system thereon, which, when processed in an integrated circuit manufacturing system, causes the integrated circuit manufacturing system to manufacture an integrated circuit embodying the ray tracing system.

[0083] An integrated circuit manufacturing system may be provided, comprising: a non-transient computer-readable storage medium storing a computer-readable description of a ray tracing system thereon; a layout processing system configured to process the computer-readable description to generate a circuit layout description of an integrated circuit embodying the ray tracing system; and an integrated circuit generation system configured to manufacture the ray tracing system according to the circuit layout description.

[0084] Computer program code for performing any of the methods described herein may be provided. A non-transitory computer-readable storage medium may be provided having computer-readable instructions stored thereon, which, when executed at a computer system, cause the computer system to perform any of the methods described herein.

[0085] As will be apparent to those skilled in the art, the above features can be appropriately combined, and can be combined with any aspect of the examples described herein. Attached Figure Description

[0086] The invention is described by way of example with reference to the accompanying drawings. In the drawings:

[0087] Figure 1 A schematic diagram of an edge test used to determine whether a ray intersects with a 2D frame is shown.

[0088] Figure 2 A schematic diagram of the three-dimensional frame targeted by the light intersection test is shown;

[0089] Figure 3 A first example ray tracing system is shown;

[0090] Figure 4 This is a flowchart of the first method for performing an intersection test in a ray tracing system;

[0091] Figure 5 Three example ray beams are shown for testing intersection with respect to a 2D box;

[0092] Figure 6 Three example ray beams are shown for testing intersection with respect to a 3D box;

[0093] Figure 7 Another example of testing intersecting ray beams relative to a two-dimensional frame is shown;

[0094] Figure 8a and Figure 8b Two more examples of 3D boxes viewed from different perspectives are shown;

[0095] Figure 9 A second example ray tracing system is shown;

[0096] Figure 10 This is a flowchart of a method for processing intersecting rays in a ray tracing system;

[0097] Figure 11 This is a flowchart of a method for performing an intersection test on a ray beam relative to a frame in a ray tracing system;

[0098] Figure 12 This is a flowchart of another method for performing an intersection test on a beam relative to a frame in a ray tracing system;

[0099] Figure 13a An example data structure for storing light data is shown;

[0100] Figure 13b An example data structure for storing data of a beam of light is shown;

[0101] Figure 14The computer system implementing the ray tracing system is shown;

[0102] Figure 15 An integrated circuit manufacturing system for generating integrated circuits embodying the ray tracing system described herein is shown;

[0103] Figure 16a This illustrates the test of intersecting light beams with different origins relative to the boxes in the 2D example;

[0104] Figure 16b This demonstrates how to test intersections relative to a frame in the AnyHit test by increasing the effective size of the frame. Figure 16a The light beam shown;

[0105] Figure 16c This demonstrates how to test intersections relative to a box in the AllHit test by reducing the effective size of the box. Figure 16a The light beam shown; and

[0106] Figure 17 Three example ray beams are shown for testing the intersection of two 2D boxes.

[0107] The accompanying drawings illustrate various examples. Those skilled in the art will understand that the element boundaries (e.g., boxes, groups of boxes, or other shapes) shown in the drawings represent one example of a boundary. In some examples, it may be that one element can be designed as multiple elements, or multiple elements can be designed as one element. Where appropriate, common reference numerals are used throughout the drawings to indicate similar features. Detailed Implementation

[0108] The following description is given by way of example to enable those skilled in the art to make and use the invention. The invention is not limited to the embodiments described herein, and various modifications to the disclosed embodiments will be readily apparent to those skilled in the art. Embodiments are described by way of example only.

[0109] Even with accelerated architectures, the workload involved in performing intersection tests in a ray tracing system remains substantial. For example, ray tracing is used to render images of 3D scenes, which may have approximately one million pixels. Rays can be traced once for each sample location. In some examples, there may be one sample location per pixel, while in others, multiple sample locations may exist per pixel (e.g., to allow for processes such as multi-sample anti-aliasing (MSAA) when rendering the final pixel values). When a ray intersects with an object in the scene, a shader can be executed, which can cause another ray (i.e., a "secondary ray") to be emitted into the scene. Each primary ray can cause several secondary rays to be emitted, all of which are traced through the scene to determine their intersection point. Therefore, it is not uncommon to render images by tracing tens or hundreds of millions of rays through the scene. As graphics rendering techniques have advanced, the scenes to be rendered often become more complex, so it is not uncommon for scenes to contain thousands of objects, each of which can be represented by several primitives. Furthermore, the image being rendered may represent a frame in a series of frames to be displayed to the user in real time. For example, a user might be playing a game, where the rendered image represents the user's 3D view of the scene while playing the game. To make a series of frames appear as a continuous stream of video data, several frames per second can be rendered, such as 24, 30, or 60 frames per second, as some examples. Therefore, it's understandable that performing intersection tests in a ray tracing system to render the scene to be output in real time involves a significant amount of work.

[0110] One way to overcome this problem and perform ray tracing to render the scene to be output in real time is to have one or more supercomputers perform all the processing. This can be considered a “powerful” approach. However, in addition to the goal of high performance (performing ray tracing to render the scene to be output in real time), there are competing goals of reducing the size (e.g., silicon area) and power consumption of ray tracing systems. For example, there may be a goal of implementing ray tracing systems on mobile devices such as tablets or smartphones, with acceptable sizes and power consumption far lower than supercomputers. Therefore, when designing a ray tracing system, there may be trade-offs between performance, power consumption, and area. Depending on how this trade-off is implemented, the examples described herein can allow for improved performance without a significant increase in power consumption and area (compared to the prior art described above in the background section). Alternatively, in different implementations of the trade-off, the examples described herein can allow for reduced power consumption and / or size of the ray tracing system without a significant decrease in the performance of the ray tracing system (compared to the prior art described above in the background section). Different implementations can be designed to address different points in the trade-offs between performance, power consumption, and silicon area.

[0111] Typically, when performing intersection tests on rays within a scene, the intersections of many rays with respect to the same frame (e.g., where the frame represents a node in a hierarchical acceleration structure) are tested. In some cases, rays can be grouped together into ray bundles, and intersection tests can be performed on these bundles. Where the intersection test results for all rays within a bundle are identical, it is possible to perform fewer intersection tests (e.g., one or two) on the entire ray bundle and use the results to infer the intersection test results for all rays in the bundle, rather than performing all intersection tests for each individual ray within the bundle. In this case, the test used to infer the intersection test results for all rays in the bundle is called a bundle intersection test. It should be understood that the term "bundle intersection test" does not refer to simply performing a separate test for each individual ray in the bundle. Instead, a bundle intersection test performed on a ray bundle provides the bundle intersection test results for the entire bundle, which can be used to infer the intersection test results applicable to all rays within the bundle. For example, if we can guarantee that all rays in a beam have the same intersection test result relative to the box (e.g., hit or miss), we can determine the result for the entire beam and use that result as the intersection test result for all rays in the beam. In this way, it is possible to avoid performing separate intersection tests on individual rays within at least some beams. Therefore, performing intersection tests on beams reduces the total number of intersection tests performed and reduces the number of times memory is accessed to retrieve ray data. As described in more detail below, the beam intersection test in the example described herein allows testing a single vector relative to each contour edge of the box, thus providing the beam intersection test result. For example, for each contour edge of the box, a vector providing the boundary to the beam is obtained, and it can be determined whether the vector passes inside or outside the contour edge. From the perspective of a ray traveling from its origin, the contour of the box is a 2D projection of the box. If a vector passes outside the contour edge, then the vector does not pass within the perimeter of the contour. If a vector passes inside all contour edges, then the vector passes within the perimeter of the contour. The intersection test result of the ray beam relative to the box can be determined by using the result of determining whether the corresponding vector passes inside or outside the contour edge for each contour edge. Each contour edge is a straight edge, such as the edge between two vertices of the contour. By reducing the number of calculations required to determine whether the ray beam intersects the box (compared to existing techniques), the intersection test result can be determined faster, i.e., the latency of the ray tracing system can be reduced (or in other words, the performance of the ray tracing system can be improved), and the power consumption of the ray tracing system can be reduced.

[0112] As described in more detail below, this paper describes two types of bundle intersection tests:

[0113] (i) The first beam intersection test (which may be referred to herein as the “AllHit” intersection test) determines whether all rays of the beam intersect the frame. The first beam intersection test can provide binary results, such that the first beam intersection test has only two possible outcomes: (i) the first beam intersection test determines that all rays of the beam intersect the frame, or (ii) the first beam intersection test does not determine whether all rays of the beam intersect the frame.

[0114] (ii) The second beam intersection test (which may be referred to herein as the “AnyHit” test) determines whether all rays of the beam miss the frame. In other words, the second beam intersection test determines whether any ray of the beam hits the frame. The second beam intersection test can provide binary results, such that the second beam intersection test has only two possible outcomes: (i) the second beam intersection test determines that all rays of the beam miss the frame, or (ii) the second beam intersection test does not determine whether all rays of the beam miss the frame.

[0115] These two different types of beam intersection tests can be implemented using very similar logic, but the bounding vectors relative to the corresponding contour edge tests of the box are different. If the vector providing the boundary to the beam does not cross one side of the contour edge, then any ray of the known beam does not cross this side of the contour edge. In other words, either: (i) the vector is at least as likely as any ray in the beam to cross inside the contour edge, or (ii) the vector is at least as likely as any ray in the beam to cross outside the contour edge. Note that different boundary vectors can be used for different contour edges. Furthermore, in the example described below, the logic configured to perform both types of beam intersection tests can also correctly perform intersection tests on individual rays (each of which can be considered as a beam consisting of only one ray). In this way, the ray tracing system does not require different dedicated test blocks to perform intersection tests on individual rays and beams; that is, the same test block can be used to test individual rays and beams. This is particularly useful when the test blocks are implemented in hardware (e.g., a fixed-function circuit system), as it reduces the possibility of bottlenecks in the system due to one type of test block being saturated while another type is idle.

[0116] The first and second beam intersection tests can be performed separately, and each can offer an advantage in reducing the number of intersection tests that need to be performed (where all rays within a beam will get the same result (hit or miss)). However, in some examples, both types of beam intersection tests can be performed in the same ray tracing system. This can be particularly advantageous because it avoids performing separate intersection tests on individual rays in cases where all rays of a beam hit the frame and all rays of a beam miss the frame. In some examples, an AllHit test can be performed relative to the frame against the beam, and if the AllHit test determines that all rays of a beam hit the frame, the intersection test result is that all rays of a beam hit the frame. If the AllHit test is uncertain that all rays of a beam hit the frame, an AnyHit test can be performed relative to the frame against the beam. If the AnyHit test determines that all rays of a beam miss the frame, the intersection test result is that all rays of a beam miss the frame. If no intersection test result has been found, a separate intersection test can be performed relative to the frame against each ray of the beam. In this example, the AnyHit test is performed conditionally based on the result of the AllHit test. This is an example of how the method can be implemented in software. In different examples (e.g., when the method is implemented in hardware such as a fixed-function circuit system), the AllHit test and the AnyHit test can be performed in parallel. In these examples, the AnyHit test will be performed regardless of the outcome of the AllHit test. Performing the AllHit and AnyHit tests in parallel can reduce the latency of the method.

[0117] A general example method for performing intersection testing will now be described, where a single ray is tested against a box. This can be used to further explain how ray bundles can be tested against boxes. In the 3D example, the box is a 3D volume. In the 3D example, the box can be any suitable shape, such as a cuboid (e.g., a cube), sphere, cylinder, cone, pyramid, prism, etc. In the 2D example, the box is a 2D region. In these 2D examples, the box can be any suitable shape, such as a rectangle (e.g., a square), circle, triangle, hexagon, etc. In the example described in detail here, the edges of the box are aligned with the axes of the space in which ray tracing is performed. For example, the box can be an axis-aligned bounding box (AABB) and can correspond to nodes in a hierarchical acceleration structure.

[0118] In mathematics, light rays can be represented as vectors as follows:

[0119] r=o+Td (1)

[0120] Where r is the ray, o is the ray relative to the origin of the coordinate system being used, d is the direction vector of the ray, and T is a scalar.

[0121] The plane can be represented as a set of points p in vector form, such that:

[0122] (p-p0).n=0 (2)

[0123] Where p o Let p be a known point on the plane, and n be the normal vector of the plane. In other words, the set of points p that satisfy equation (2) lies on the plane.

[0124] At the intersection of the ray and the plane, r = p. The intersection distance between the ray origin and the plane (i.e., the distance between the ray origin and the intersection of the ray and the plane) can be found by combining equations (1) and (2) with r = p and rearranging them for T. In the example explained below, it is assumed that the plane is axis-aligned, i.e., aligned with the coordinate system, and therefore the normal vector n contains only one non-zero component, which is equal to 1 for a normalized vector (but it should be noted that in other examples, the plane defining the frame edge may not be axis-aligned). For generality, the non-zero component of the normal vector is represented as the i-th component (as is the case for the three-dimensional example, i ∈ x, y, z), and the combination of equations (1) and (2) can be rewritten as:

[0125] o i +Td i -p oi =0 (3)

[0126] And therefore:

[0127]

[0128] Figure 1 An example of two rays 101 and 103 and a frame 105 is shown. In this example, for ease of illustration, the frame is two-dimensional (2D) and is defined by a space bounded by four boundary edges. As shown, ray 101 intersects frame 105, while ray 103 does not intersect frame 105.

[0129] To determine whether the ray intersects the 2D frame 105, a side test is performed on points A and B, where A and B are at exactly opposite corners of frame 105. Each side test is performed to determine which side of the measured point the ray passes through. In different examples, when the frame is a 3D frame, the side test determines which side of the edge the ray passes through.

[0130] To perform an intersection test for point A, determine the two intersection distances for each ray. Figure 1 In the diagram, these intersection distances are denoted as T. x and T y T x It is the distance between the origin of the ray and the point where the ray has the same x-component as point A; T yIt is the distance between the origin of the ray and the point on which the ray has the same y-component as point A.

[0131] For intersecting rays, for example, for intersecting ray 101 tested relative to point A:

[0132] T y ≤T x (5)

[0133] For the non-intersecting ray 103 tested relative to point A:

[0134] T x <T y (6)

[0135] Using the equation for T given in (4), it can be seen that the generalized inequality to be evaluated to determine which side the ray passes through (in the 3D example) or (in the 2D example) at the edge is given by the following equation:

[0136]

[0137] To avoid the cost of performing division, inequality (7) can be rewritten as:

[0138] (p oi -o i )d j ≤(p oj -o j )d i (8)

[0139] exist Figure 1 In the example shown, point A is the bottom right corner of the box, i = y and j = x, and if inequality (8) (or inequality (7)) is true, the ray passes inside point A, and if inequality (8) (or inequality (7)) is false, the ray passes outside point A. A similar test is performed relative to corner point B, which is the top left corner of box 105 (i.e., exactly opposite point A). For point B, the values ​​can be set to i = x and j = y (the opposite of the test for point A), and if inequality (8) (or inequality (7)) is true, the ray passes inside point B, and if inequality (8) (or inequality (7)) is false, the ray passes outside point B. To determine if the ray intersects box 105, both inequalities for points A and B must be true, and if either inequality is false, the ray does not intersect box 105.

[0140] Figure 2An example of a 3D box 201 as seen from the origin of the intersecting rays to be tested relative to box 201 is shown. In this example, box 201 is an axis-aligned bounding box (AABB). Because box 201 is axis-aligned, each edge of box 201 is parallel to one of the x, y, or z axes. The box is shown as including a set of contour edges, labeled 1 to 6. Contour edges are edges that define a portion of the contour of the box. Contour edges are determined from the line of sight along the direction of the ray vector; that is, the box is depicted as seen from, for example, a viewpoint located at the origin of the ray and pointing in the direction of the ray. In other words, in Figure 2 The outline edges marked 1 to 6 are the edges of the 2D projection of box 201 as seen from the perspective of light rays traveling from the origin. Box 201 is Figure 2 The cuboid in the example shown gives box 201 four or six outline edges, depending on the viewpoint from which the box is viewed. Figure 2 The box 201 shown is for illustration only and may, for example, represent the volume corresponding to the root node, parent node, child node and / or leaf node in the acceleration structure.

[0141] In this 3D example, the two planes intersect to form a line, rather than a point as in the 2D case. Therefore, a side test performed on the 3D box is used to determine which side of the contour edge (in the form of a line) the ray passes through, which may be referred to herein as the “edge test”. To determine whether the ray intersects with box 201, an intersection test is performed on each of the contour edges 1 to 6. Each intersection test includes performing a comparison of the values ​​specified in inequality (8).

[0142] Box 201 is formed by six planes, where for each axis (x, y, z), two of the planes have normals parallel to the axis, such that the component values ​​of those planes with respect to the axis are constant within each plane. Of the two parallel planes, one will have a higher component value along the relevant axis. Therefore, for each axis, there exist a maximum and a minimum component value defined by the planes defining box 201. Along each axis (x, y, z) min ,y min and z min The minimum value of ) can be defined by defining the "minimum" position as vector p. min , where p min =(x min ,y min ,z min ), and along each axis (x max ,y max and z max The maximum value of ) can be defined by defining the "maximum" position as vector p. max , where p max =(x max ,ymax ,z max Therefore, p min and p max It is the exact opposite corner position of box 201, and can be used in inequality (8) for edge comparison testing.

[0143] To simplify the edge comparison test, vector p′ min and p′ max It can be defined (and, for example, pre-computed) as follows:

[0144] p′ min =p min -o (9)

[0145] p′ max =p max -o (10)

[0146] Vector p′ min and p′ max Representing the origin (o) and p respectively min and p max The displacement between them. As described above, since box 201 is axis-aligned, it is evident that there are two planes of the bounding box on each axis: two "x" planes (planes with constant x components), two "y" planes (planes with constant y components), and two "z" planes (planes with constant z components). Vector p′ min The components represent the displacements of the x, y, and z components from the origin of the ray to the smallest x, y, and z plane. Vector p′ max The components represent the displacements of the x, y, and z components from the origin of the ray to the plane of maximum x, y, and z.

[0147] The choice between the minimum and maximum planes for evaluating inequality (8) will depend on which two planes intersect at the edge of the tested profile.

[0148] Equations (9) and (10) can be used to rewrite inequality (8) as:

[0149] p′ i d j ≤p′ j d i (11)

[0150] Where p′ i =p min,i -o i or p′ i =p max,i -o i , and p′ j =p min,j -o j or p′j =p max,j -o j .

[0151] For example, Figure 2 The outline edge 6 shown is along the intersection line between the minimum x-plane (i.e., the plane with the smaller x-value among two planes with constant x-values) and the maximum z-plane (i.e., the plane with the larger z-value among two planes with constant z-values). If the ray intersects the maximum z-plane before intersecting the minimum x-plane, i.e., if p′ max,z d x ≤p′ min,x d z , where p′ max,z =p max,z -o z And p′ min,x =p min,x -o x Then the light rays will pass through the intersection test based on edge 6.

[0152] As another example, Figure 2 The outline edge 2 shown is along the intersection line between the maximum x-plane (i.e., the plane with the larger x-value among two planes with constant x-values) and the maximum y-plane (i.e., the plane with the larger y-value among two planes with constant y-values). If the ray intersects the maximum x-plane before intersecting the maximum y-plane, i.e., if p′ max,x d y ≤p′ max,y d x (where p′) max,x =p max,x -o x And p′ max,y =p max,y -o y If the light rays pass through the intersection test based on edge 2, then the light rays will pass through the intersection test based on edge 2.

[0153] How to target Figure 2 The execution of each of the six contour edges marked 1 to 6 will be obvious. If all six tests are passed, it is determined that the ray intersects with frame 201. However, if any one or more of the six tests are failed, it is determined that the ray does not intersect with frame 201, that is, the ray passes outside one or more of the six contour edges.

[0154] Therefore, in order to perform a ray intersection test on frame 201, an edge test is performed for each contour edge 1 to 6 to determine which side of each of those edges the ray passes through, wherein each edge test involves performing an evaluation to determine whether the condition specified in equation (11) is true for the two planes forming the edge being tested.

[0155] As described in more detail below, distance and direction checks can also be performed to check whether the origin and direction of the ray are causing the ray to travel away from the box, or whether the ray endpoint is not reaching the box. If the ray is traveling away from the box, or the ray endpoint is not reaching the box, the ray does not intersect the box, and edge testing of the box's outline is not required.

[0156] Figure 3 An example of a ray tracing system for performing intersection tests is shown. Ray tracing system 300 is configured to perform intersection tests between rays and frames (e.g., axis-aligned frames).

[0157] The ray tracing system 300 includes a scheduler 301, a request queue 303, a memory 305, and a tester module 307. The tester module 307 includes a test queue 309, a set of one or more test blocks (generally indicated by 311), and a result processor 313. The request queue 303 and the test queue 309 may take the form of a buffer, such as a stack (i.e., a FILO buffer) or a FIFO buffer. The test blocks may be implemented as hardware units (e.g., using a fixed-function circuit system) or as software implementations, such as shader code executed by a processing unit.

[0158] Scheduler 301 receives instructions to track one or more groups of rays (i.e., to perform intersection tests on them). The scheduler may collect rays before sending them to request queue 303. Scheduler 301 may do this to group rays that need to access the same block or portion of memory 305. A block or portion of memory 305 may be a contiguous block of memory at a set of memory addresses that can be retrieved together from memory 305. A group of rays referencing the same block of memory 305 may be referred to as a group. For example, rays to be tested relative to the same frame or object may be grouped such that data for the frame or object can be retrieved from memory 305 once for intersection testing of all rays in the group. As an example, for the initial stage of an intersection test, it is possible that all rays will intersect with the root node and therefore need to access the same block of memory 305, thus falling into one group. Once the scheduler has aggregated one or more rays into a group, it issues the group and adds it to request queue 303 to request the group's node data (i.e., data describing the boxes corresponding to the appropriate nodes of the acceleration structure for testing the intersection of the group's rays against the boxes) from memory 305. The node data of the group is then retrieved from memory 305 and passed to tester module 307.

[0159] At tester module 307, packet node data is received at test queue 309. Packet ray data is also received at the tester module. Packet ray data can be received from memory (e.g., memory 305), or in other examples, via... Figure 3 The link (not shown) receives ray data from request queue 303 to associate it with corresponding node data at test queue 309. Tester module 307 distributes rays from groups to test blocks 311. Tester module 307 can distribute rays sequentially. When rays from a group have been distributed to a test block, the test block performs an intersection test to, for example, pass through appropriate edges of the frame (e.g., as described above, for...). Figure 2 An edge test is performed on the six contour edges of the marked box 201 to determine whether the ray intersects with the box corresponding to the node targeted by the ray test.

[0160] Each test block outputs the results of the intersection tests it has performed to the result processor 313. The result processor 313 processes the results of the intersection tests. Specifically, if it is found that a ray does not intersect with the node it is testing, the processor 313 does not schedule an intersection test for the ray relative to the child nodes of the non-intersecting node. If the result processor 313 determines that a ray does intersect with the node it is testing, then the ray is output from the tester module 307 back to the scheduler 301, where the ray is grouped and scheduled to perform intersection tests relative to the child nodes of the intersecting node.

[0161] The above process is repeated iteratively until no more light rays hit the target. In response to a light ray intersecting a leaf node, objects within that leaf node (e.g., triangles) are scheduled to perform an intersection test with the light ray. Tester module 307 may include object test blocks ( Figure 3(Not shown in the image), the object test block is configured to perform intersection tests on rays intersecting with the leaf node relative to objects within the leaf node. An object can be described as having triangular primitives, such that the object test block is configured to test the intersection of rays with triangles in the scene. Those skilled in the art will know how to test the intersection of rays with triangular primitives, and the details of this process are not described in detail herein. If the result of all intersection tests for a ray is that the ray does not intersect any object in the scene, then a "missed" result is returned and can be processed accordingly. If the result of all intersection tests for a ray is that the ray intersects a single object, then the data for this intersection and a "hit" result can be returned and processed accordingly. If the result of all intersection tests for a ray is that the ray intersects more than one object, then the intersection distances (i.e., the distance from the ray's origin to the intersection point) are compared to find the "closest hit," i.e., the intersection point closest to the ray's origin (i.e., the intersection point with the smallest T value). The data for this closest hit intersection and the "hit result" can be returned and processed accordingly.

[0162] As described above, in the examples presented herein, light rays can be grouped into bundles, and then bundle intersection tests can be performed on the light bundles. This reduces the number of intersection tests that need to be performed. The number of light rays in a bundle can vary. There can be a maximum number of light rays that can be included in a bundle, and this maximum number of light rays can differ in different examples. For example, the maximum number of light rays in a bundle could be 4, 16, or 32, as just three examples.

[0163] The method described above for performing intersection tests relative to a frame pair of individual rays can be extended to perform intersection tests relative to a frame pair of ray bundles. For example, Figure 4 This is a flowchart of a method for performing an intersection test on a light beam, which can be performed by the tester module 307.

[0164] In step S402, a light beam is received at the tester module 307. The test light beam intersects with the frame. See below for reference. Figure 10 The flowchart shown describes an example process for grouping light rays together to form a bundle. In the first example, all rays within the bundle have the same origin (but in other examples, rays within the bundle can have different origins). Rays within the bundle can have different ray direction vectors. Vectors can define the bundle to provide boundaries to the ray bundle, i.e., define the edges of the bundle. The boundary vectors of the bundle can tightly define the rays within the bundle. For example, Figure 5 This shows that three light beams will be tested. Figure 5The image is generally represented as 504, 506, and 508, showing a 2D example of the intersection with the 2D frame 502. The first ray beam 504 has two vectors 5041 and 5042 providing the boundary to the first ray beam; the second ray beam 506 has two vectors 5061 and 5062 providing the boundary to the second ray beam; and the third ray beam 508 has two vectors 5081 and 5082 providing the boundary to the third ray beam. Indications for the ray beams and the frame are provided to test block 311. Steps S404 to S416 can be performed by one of the test blocks 311.

[0165] In step S404, a distance check and a direction check are performed on the light beam relative to the frame. In step S406, it is determined whether the light beam passes the distance check and the direction check. The direction check determines whether the frame is behind the origin of the light beam. In other words, when viewed from the origin of the light beam along a direction range defined by the boundary vector of the light beam, the direction check determines whether the frame is behind the origin. For example, the direction check may involve, for each component (i.e., each of the x, y, and z components, generally denoted as the i-th component), if the beam (d i If a specific boundary vector component in the boundary vector of a given set is positive, then check the component value (o) at the origin of the bundle. i Is it greater than the maximum component value of the box (p)? max,i ); and if the bundle (d) i If a specific boundary vector component in the boundary vector of a given point is negative, then check the component value (o) at the origin of the bundle. i Is it less than the minimum component value of the box (p)? min,i If either of these two conditions is met for one or more of the components, it can be determined that the ray will not intersect the box, and an edge test is not required on the outline edge of the box. The specific boundary vector among the boundary vectors of the bundle selected in the direction check can depend on whether the bundle intersection test is a first bundle intersection test (i.e., the "AllHit" test) designed to determine whether all rays of the bundle hit the box, or a second bundle intersection test (i.e., the "AnyHit" test) designed to determine whether all rays of the bundle miss the box.

[0166] Figure 17 The following are 2D examples of two axis-aligned boxes: Box 1702 (which has the minimum component p) min,a and the maximum component p max,a ) and box 1704, which has the minimum component p min,b and the maximum component p max,b ). Figure 17Three beams are also shown: beam 1706, with boundary vectors 17061 and 17062 (both with negative x-components); beam 1708, with boundary vectors 17081 (with negative x-components) and 17082 (with positive x-components); and beam 1710, with boundary vectors 17101 and 17102 (both with positive x-components). The origin of all beams 1706, 1708, and 1710 is located at position o. For example, for the AnyHit test, the direction test is useful when all (e.g., both) the i-th components of the beam's boundary vectors have the same sign (e.g., when the i-th component is an x-component, which is true for beams 1706 and 1710, but not for beam 1708). For example, if the boundary vector with the smallest i-th component has a positive i-th component, which means that the i-th component of all boundary vectors has a positive value (e.g., the boundary vectors of bundle 1710 all have positive x-components), then the boundary vector with the smallest i-th component (e.g., boundary vector 17101) is the "specific boundary vector" among the aforementioned boundary vectors. Because the i-th component of the "specific boundary vector" among the boundary vectors is positive, the direction check involves checking the component value (o) at the bundle origin. i Is it greater than the maximum component value of the box (p)? max,i For example, the x-component of boundary vector 17101 is positive, therefore the direction check involves checking the x-component (o) of the bundle origin. x Is it greater than the x component p? max,a (For box 1702) and p max,b (For box 1704). In Figure 17 In the example shown, bundle 1710 will pass the orientation check of the AnyHit test relative to box 1704, but will not pass the orientation check of the AnyHit test relative to box 1702. If the boundary vector with the largest i-th component has a negative i-th component, which means that the i-th component of all boundary vectors has a negative value (e.g., the boundary vectors of bundle 1706 all have negative x-components), then the boundary vector with the largest i-th component (e.g., boundary vector 17062) is the "specific boundary vector" among the aforementioned boundary vectors. Because the i-th component of the "specific boundary vector" among the boundary vectors is negative, the orientation check involves checking the component value (o) at the bundle origin. i Is it less than the minimum component value of the box (p)? min,i For example, the x-component of boundary vector 17062 is negative, therefore the direction check involves checking the x-component (o) of the bundle origin. x Is it less than the x component p? min,a (For box 1702) and p min,b (For box 1704). In Figure 17In the example shown, bundle 1706 will pass the orientation check of the AnyHit test relative to box 1702, but will not pass the orientation check of the AnyHit test relative to box 1704. For the AnyHit test, the orientation check does not determine whether an intersection with the box is possible if none of the i-th components of the boundary vectors have the same sign (e.g., for bundle 1708, the boundary vector with the smallest x-component does not have a positive x-component and the boundary vector with the largest x-component does not have a negative x-component). In contrast, for the AllHit test, the orientation test can be useful even if the signs of the i-th components of the boundary vectors are not all the same. For example, for the AllHit test, the boundary vector with the largest i-th component has a positive i-th component (e.g., when the i-th component is an x-component (true for bundles 1708 and 1710)), then the boundary vector with the largest i-th component (e.g., boundary vector 17082 for bundle 1708 and boundary vector 17102 for bundle 1710) is a “specific boundary vector” among the aforementioned boundary vectors. Because the i-th component of the "specific boundary vector" in the boundary vector is positive, the direction check involves checking the component value (o) at the origin of the bundle. i Is it greater than the maximum component value of the box (p)? max,i For example, the x-components of boundary vectors 17082 and 17102 are positive, therefore the orientation check of bundles 1708 and 1710 involves checking the x-component (o) of the bundle origin. x Is it greater than the x component p? max,a (For box 1702) and p max,b (For box 1704). In Figure 17 In the example shown, bundles 1708 and 1710 will pass the first direction check of the AllHit test relative to box 1704, but will not pass the first direction check of the AllHit test relative to box 1702. Similarly, for the AllHit test, if the boundary vector with the smallest i-th component has a negative i-th component (e.g., when the i-th component is the x-component, which is true for bundles 1706 and 1708), then the boundary vector with the smallest i-th component (e.g., boundary vector 17061 for bundle 1706 and boundary vector 17081 for bundle 1708) is the “specific boundary vector” among the aforementioned boundary vectors. Because the i-th component of the “specific boundary vector” among the boundary vectors is negative, the direction check involves checking the component value (o) at the origin of the bundle. i Is it less than the minimum component value of the box (p)? min,i For example, the x-components of boundary vectors 17061 and 17081 are negative, therefore the orientation check of bundles 1706 and 1708 involves checking the x-component (o) of the bundle origin. x Is it less than the x component p? min,a (For box 1702) and p min,b(For box 1704). In Figure 17 In the example shown, bundles 1706 and 1708 will pass the second direction check of the AllHit test relative to box 1702, but will not pass the second direction check of the AllHit test relative to box 1704. If a bundle fails either direction check of the AllHit test, it is determined that it has failed the direction test, therefore in Figure 17 In the example shown, bundle 1708 will not pass the orientation check of the AllHit test relative to both boxes 1702 and 1704.

[0167] Summary of direction check:

[0168] -For a full hit test, for each of the i-th components:

[0169] ○ If the i-th component of any boundary vector of the bundle is negative, then in p min,i >o i In the case of discovering that it was missed; and

[0170] ○ If the i-th component of any boundary vector of the bundle is positive, then in p max,i <o i In the case of discovering that it was missed; and

[0171] -For the AnyHit test, for each of the i-th components:

[0172] ○ If the i-th component of both boundary vectors of the bundle is negative, then in p min,i >o i In the case of discovering that it was missed; and

[0173] ○ If the i-th component of both boundary vectors of the bundle is positive, then in p max,i <o i In some cases, it was discovered that something was missed.

[0174] The distance check determines whether a ray of light terminates at a point in front of the box. The maximum distance a ray of light can travel in the scene before being terminated (or "cut off") is provided in the ray's data. If the distance check determines that the ray terminates at a point in front of the box (i.e., before it reaches the box), then the intersection test result can be determined to be that the ray misses the box, and an edge test is not required on the outline edge of the box. For example, the distance check could involve performing a check on each component (i.e., each of the x, y, and z components, generally denoted as the i-th component). If any of the components satisfies an inequality, then the distance check has failed. For example, for the AnyHit test, if p min,i >o i The distance check can then be performed on each of the i-th components to determine which boundary vector's i-th component has a maximum value, and then it can be determined whether p...min,i >o i +T max d i,max T max It is the maximum value of T (i.e., the value of T when the ray is intercepted before it intersects any object in the scene), where d i,max =max(d i,1 ,d i,2 ), and where d i,1 It is the i-th component of the first boundary vector of the bundle, and d i,2 It is the i-th component of the second boundary vector of the bundle. In this example, the bundle has only two boundary vectors. In this example, if p min,i >o i +T max d i,max If p fails the distance check, then the test fails. For the AnyHit test, if p... max,i <o i Then, the distance check can be performed on each of the i-th components to determine which boundary vector's i-th component has the minimum value, and then it can be determined whether p max,i <o i +T max d i,min , where d i,min =min(d i,1 ,d i,2 ), and where d i,1 It is the i-th component of the first boundary vector of the bundle, and d i,2 It is the i-th component of the second boundary vector of the bundle. In this example, the bundle has only two boundary vectors. In this example, if p max,i <o i +T max d i,min If not, the distance check was not passed.

[0175] As another example, for the AllHit test, if p min,i >o i Then the distance check can determine, for each of the i-th components, which boundary vector's i-th component has the minimum value (thus identifying d). i,min Then it can be determined whether p min,i >o i +T max d i,min In this example, if p min,i >o i +T max d i,min If p fails the distance check, then the distance check is not passed. For the AllHit test, if p max,i <o iThen the distance check can determine, for each of the i-th components, which boundary vector's i-th component has the maximum value (thus identifying d). i,max Then it can be determined whether p max,i <o i +T max d i,max In this example, if p max,i <o i +T max d i,max If the distance check fails, the distance test is deemed to have missed the box, and no edge test is required on the outline edge of the box.

[0176] If the distance or orientation check fails, the method proceeds from step S406 to step S408. In step S408, the intersection test result is determined to be a beam missing frame. This intersection test result can be output from test block 311 to result processor 313 without performing steps S410 to S416.

[0177] If the distance and orientation checks pass, the method proceeds from step S406 to step S410.

[0178] Distance and orientation checks are optional; that is, in some examples, steps S404 to S408 may not be performed. Performing distance and orientation checks (in steps S404 to S408) can reduce the number of edge tests that need to be performed on the contour edges, because some intersection test results (i.e., missed) can be determined by distance and orientation checks without requiring edge tests to be performed on the contour edges.

[0179] In step S410, the test block 311 marks the outline edge of the frame from the perspective of the light beam.

[0180] Steps S412 and S414 are performed on each contour edge identified in step S410.

[0181] In step S412, the components of the vector that provides the boundary to the light beam are obtained. The vector whose components are obtained depends on the specific contour edge being tested, and different vector components can be obtained for different contour edges. The components of a vector can be "obtained" by determining (e.g., calculating) the components of the vector or by receiving (e.g., reading) the components of the vector. The vector may or may not be the same as the direction vector of one of the rays in the beam. For example, the components of the vector can be obtained by identifying the minimum and maximum component values ​​in each dimension from the direction vectors of the rays in the light beam, wherein the obtained components of the vector that provides the boundary to the light beam are selected from a set of component values ​​including the identified minimum and maximum component values ​​in each dimension.

[0182] If the ray beam does not pass outside the outline edge of the mark, then all rays of the known beam do not pass outside the outline edge; in this sense, the vector can provide an outer boundary to the ray beam relative to the outline edge. Furthermore, if the ray beam does not pass inside the outline edge of the mark, then all rays of the known beam do not pass inside the outline edge; in this sense, the vector can provide an inner boundary to the ray beam relative to the outline edge.

[0183] In step S414, test block 311 determines whether the vector obtained in step S412 passes inside or outside the contour edge in question. This can be done as described above regarding the testing of a single ray relative to the box, for example, according to the inequality (11) given above. In the example described herein, for each contour edge, a single vector is obtained in step S412 and said vector is tested in step S414. The choice of which boundary vector to test relative to each contour edge depends on whether an AllHit test or an AnyHit test is performed, as explained in more detail below.

[0184] In step S416, the result of the beam intersection test relative to the frame is determined using the result of whether each determined vector in the identified contour edge passes inside or outside the contour edge. For example, if the test of all contour edges indicates that the corresponding vector passes inside the corresponding contour edge, then in step S416, the result of the beam intersection test relative to the frame is determined as "hit" or "pass"; while if the test of one or more contour edges indicates that the corresponding vector passes outside the corresponding contour edge, then in step S416, the result of the beam intersection test relative to the frame is determined as "miss" or "fail". For the AnyHit test, a "pass" or "hit" result means that all beams of the beams not yet identified in the test miss the frame, while a "fail" or "miss" result means that all beams of the beams already identified in the test miss the frame. For the AllHit test, a "pass" or "hit" result means that all beams of the beams already identified in the test hit the frame, while a "fail" or "miss" result means that all beams of the beams not yet identified in the test hit the frame.

[0185] For example, a beam intersection test could be an AllHit test (e.g., if the test output is inverted, it could be called an "AnyMiss test"). As described above, the AllHit test has only two possible outcomes: (i) the AllHit test determines that all rays of the beam intersect the frame, or (ii) the AllHit test is uncertain that all rays of the beam intersect the frame. In this example, for each of the outline edges of the marker, the vector obtained in step S412 provides an outer boundary to the beam of rays relative to the outline edge of the marker. If the beam of rays does not pass outside the outline edge of the marker, it is known that none of the rays of the beam pass outside the outline edge of the marker, and in this sense, the vector provides an outer boundary to the beam of rays relative to the outline edge of the marker. As mentioned above, the vector can have the maximum or minimum component value of the ray direction vector of the rays in the beam in each dimension. The choice of maximum or minimum component value in each dimension depends on the outline edge being tested and whether the vector provides an inner or outer boundary. The resulting vector can be the same as or different from the direction vector of one ray of the beam.

[0186] If each defined vector in the outline edge of the sign passes inside the outline edge of the sign, the result of the intersection test of the ray beam with respect to the box is that all rays in the ray beam intersect the box. If one or more defined vectors in the outline edge of the sign pass outside the outline edge of the corresponding sign, the result of the intersection test of the ray beam with respect to the box is not that all rays in the ray beam intersect the box; for example, one or more rays in the beam may miss the box.

[0187] For example, in Figure 5In the 2D example shown, an AllHit test can be performed on the first ray beam 504 relative to the 2D box 502. In the 2D example, the contour edges are reduced to only two contour points. Figure 5 The vectors are 5101 and 5102. A vector 5041 is obtained for the bundle 504 (in step S412) relative to the contour point 5101, because this vector 5041 provides an outer boundary to the bundle 504 relative to the contour point 5101; that is, if the bundle does not pass outside the identified contour point 5101, then the light rays of the known bundle 504 do not pass outside the identified contour point 5101. In step S414, it is determined that the vector 5041 passes inside the contour point 5101. Specifically, relative to the contour point 5101, it is determined according to inequality (11) that (p... min,x -o x )d y,1 ≤(p max,y -o y )d x,1 , where p min,x and p max,y These are the x and y component values ​​at point 5101, o x and o y These are the x and y component values ​​of the origin of the ray beam 504, and d x,1 and d y,1 These are the x and y component values ​​of the direction of vector 5041. This test determines that all rays of the ray beam 504 pass inside the contour point 5101 of the frame 502. Vector 5042 is obtained relative to the contour point 5102 for the beam 504 (in step S412) because this vector 5042 provides the outer boundary of the beam 504 relative to the contour point 5102. In step S414, it is determined that vector 5042 passes inside the contour point 5102. Specifically, relative to the contour point 5102, it is determined according to inequality (11) that (p min,y -o y )d x,2 ≤(p max,x -o x )d y,2 , where p max,x and p min,y These are the x and y component values ​​at point 5102, o x and o y These are the x and y component values ​​of the origin of the ray beam 504, and d x,2 and d y,2These are the x and y component values ​​of the direction of vector 5042. This test determines that all rays of the ray beam 504 pass inside the contour point 5102 of the frame 502. These two tests are sufficient to determine that all rays of the beam 504 hit the frame 502. Therefore, in step S416, it is determined that the result of the AllHit test of the ray beam 504 relative to the frame 502 is that all rays of the beam 504 hit the frame 502.

[0188] As another example, in Figure 5 In the 2D example shown, an AllHit test can be performed on the second ray beam 506 relative to the 2D frame 502. A vector 5061 is obtained for the beam 506 (in step S412) relative to the contour point 5101, because this vector 5061 provides the outer boundary of the beam 506 relative to the contour point 5101. In step S414, it is determined that the vector 5061 passes through the interior of the contour point 5101. Specifically, relative to the contour point 5101, it is determined according to inequality (11) that (p min,x -o x )d y,1 ≤(p max,y -o y )d x,1 , where p min,x and p max,y These are the x and y component values ​​at point 5101, o x and o y These are the x and y component values ​​of the origin of the ray beam 506, and d x,1 and d y,1 These are the x and y component values ​​of the direction of vector 5061. This test determines that all rays of the ray bundle 506 pass inside the contour point 5101 of the frame 502. Vector 5062 is obtained for the bundle 506 (in step S412) relative to the contour point 5102, because this vector 5062 provides the outer boundary of the bundle 506 relative to the contour point 5102. In step S414, it is determined that vector 5062 passes outside the contour point 5102. Specifically, relative to the contour point 5102, it is determined that the ray bundle 506 does not satisfy inequality (11). In other words, for the ray bundle 506, the following is not true: (p min,y -o y )d x,2 ≤(p max,x -o x )d y,2 , where p max,x and p min,y These are the x and y component values ​​at point 5102, o x and o y These are the x and y component values ​​of the origin of the ray beam 506, and d x,2 and dy,2 These are the x and y component values ​​of the direction of vector 5062. This test does not guarantee that all rays of ray beam 506 will pass inside the contour point 5102 of frame 502. Therefore, in step S416, the result of the AllHit test of ray beam 506 relative to frame 502 is not that all rays of beam 506 will hit frame 502. In other words, the AllHit test does not guarantee that all rays of beam 506 will hit frame 502.

[0189] As another example, in Figure 5 In the 2D example shown, an AllHit test can be performed on the third ray beam 508 relative to the 2D frame 502. A vector 5081 is obtained for the beam 508 (in step S412) relative to the contour point 5101, because this vector 5081 provides the outer boundary of the beam 508 relative to the contour point 5101. In step S414, it is determined that the vector 5081 passes through the interior of the contour point 5101. Specifically, relative to the contour point 5101, it is determined according to inequality (11) that (p min,x -o x )d y,1 ≤(p max,y -o y )d x,1 , where p min,x and p max,y These are the x and y component values ​​at point 5101, o x and o y These are the x and y component values ​​of the origin of the ray beam 508, and d x,1 and d y,1 These are the x and y component values ​​of the direction of vector 5081. This test determines that all rays of the ray beam 508 pass inside the contour point 5101 of the frame 502. Vector 5082 is obtained for the beam 508 (in step S412) relative to the contour point 5102, because this vector 5082 provides the outer boundary of the beam 508 relative to the contour point 5102. In step S414, it is determined that vector 5082 passes outside the contour point 5102. Specifically, relative to the contour point 5102, it is determined that the ray beam 508 does not satisfy inequality (11). In other words, for the ray beam 508, the following is not true: (p min,y -o y )d x,2 ≤(p max,x -o x )d y,2 , where p max,x and p min,y These are the x and y component values ​​at point 5102, o x and o y These are the x and y component values ​​of the origin of the ray beam 508, and dx,2 and d y,2 These are the x and y component values ​​of the direction of vector 5082. This test does not guarantee that all rays of ray beam 508 will pass inside the contour point 5102 of frame 502. Therefore, in step S416, the result of the AllHit test of ray beam 508 relative to frame 502 is not that all rays of beam 508 will hit frame 502. In other words, the AllHit test does not guarantee that all rays of beam 508 will hit frame 502.

[0190] As can be seen, the AllHit test results are the same for beams 506 and 508, namely, it is not confirmed that all rays in beams 506 or 508 hit box 502. This is also true even if some rays in beam 508 do hit box 502.

[0191] Figure 6 This shows that three light beams will be tested. Figure 6 The 3D example of the intersection of the 3D box (generally represented as 604, 606, and 608) with the 3D box 602. Figure 6 It is drawn from the perspective of the origin of the light rays. The first ray beam 604 consists of four rays ( Figure 6 (Shown in black circles), and the dashed box represents the axis-aligned box defining the ray beam 604, that is, the axis-aligned box whose minimum and maximum component values ​​in each of the x, y, and z dimensions are equal to the minimum and maximum component values ​​of the direction vector of the ray in the beam. The second ray beam 606 includes four rays ( Figure 6 (Shown in black circles), and the dashed box indicates the axis alignment frame defining the ray beam 606. The third ray beam 608 includes four rays ( Figure 6 (shown as a black circle in the middle), and the dashed box indicates the axis alignment frame that defines the ray beam 608.

[0192] An AllHit test can be performed on the first ray beam 604 relative to the 3D frame 602. The frame 602 has six contour edges. Figure 6 The values ​​are represented as 1 to 6. Relative to contour edge 1, the components of the vector with the maximum y and z values ​​of the direction vector of the light rays of bundle 604 are obtained. In this example, the upper right ray shown in bundle 604 is an example of a ray with these component values ​​in the y and z directions. This vector provides an outer boundary to bundle 604 relative to contour edge 1, i.e., if the bundle does not pass outside the identified contour point 5101, then it is known that the light rays of bundle 604 do not pass outside the identified contour edge 1. In step S414, it is determined that the vector passes inside contour edge 1. Specifically, relative to contour edge 1, it is determined according to inequality (11) (p max,z -o z )d y ≤(pmax,y -o y )d z , where p max,z It is the z-component value of the plane on the top of frame 602, p max,y It is the y-component value of the plane to the right rear of frame 602, o y and o z These are the y-component and z-component values ​​of the origin of the ray beam 604, and d y and d z These are the y-component and z-component values ​​of the vector that defines the bundle 604 relative to the outer boundary of the contour edge 1. This test determines that all rays of the ray bundle 604 pass inside the contour edge 1 of the frame 602. Relative to the contour edge 6, the components of the vector with the minimum x-value and maximum z-value of the direction vector of the rays of the bundle 604 are obtained. The vector with these x and z components will provide the outer boundary of the bundle 604 relative to the contour edge 6. It should be noted that in this example, none of the four vectors in the bundle 604 have both the minimum x-value and the maximum z-value. In step S414, it is determined that the vector with the obtained x and z components passes inside the contour edge 6. Specifically, relative to the contour edge 6, it is determined according to inequality (11) that (p max,z -o z )d x ≤(p min,x -o x )d z , where p max,z It is the z-component value of the plane on the top of frame 602, p min,x It is the x-component value of the plane to the left rear of frame 602, o x and o z These are the x-component and z-component values ​​of the origin of the 604 light beam, and d x and d z These are the x and y component values ​​of the vector defining the beam 604 relative to the outer boundary of the contour edge 6. This test determines that all rays of the beam 604 pass inside the contour edge 6 of the frame 602. For the sake of brevity, we have not described the test of the beam 604 relative to contour edges 2 through 5, but from the description of the test of contour edges 1 and 6 and from... Figure 6 It will be obvious that the AllHit test will determine that all rays of beam 604 are inside all contour edges of frame 602. Therefore, in step S416, the result of the AllHit test of beam 604 relative to frame 602 is that all rays of beam 604 hit frame 602.

[0193] An AllHit test can be performed on the second ray beam 606 relative to the 3D frame 602. The components of the vector with the maximum x and y values ​​of the direction vector of the ray beam 606 are obtained relative to the contour edge 2. In this example, the upper right ray shown in the beam 606 is an example of a ray with these component values ​​in the x and y directions. This vector provides an outer boundary to the beam 606 relative to the contour edge 2. In step S414, it is determined that the vector crosses outside the contour edge 2. Specifically, relative to the contour edge 2, inequality (11) is not satisfied, i.e., it is not (p max,x -o x )d y ≤(p max,y -o y )d x , where p max,x It is the x-component value of the plane to the right front of frame 602, p max,y It is the y-component value of the plane to the right rear of frame 602, o x and o y These are the x and y component values ​​of the origin of the ray beam 606, and d x and d y These are the x and y component values ​​of the vector defining bundle 606 relative to the outer boundary of contour edge 2. For simplicity, we have not described the test of bundle 606 relative to contour edges 1 or 3 through 6, but from... Figure 6 It will be apparent that the AllHit test will determine that all rays of beam 606 are inside contour edges 3 to 6 of frame 602, but not all rays of beam 606 are inside contour edge 1. Therefore, in step S416, the result of the AllHit test on beam 606 relative to frame 602 does not determine that all rays of beam 606 hit frame 602. It should be noted that in some examples (e.g., implemented in software), tests may be performed sequentially on different contour edges, and in these examples, the result of the AllHit test may be determined immediately after obtaining a first “fail” or “missed” result for a contour edge (e.g., contour edge 1 in the example given above regarding beam 606), which avoids testing one or more other contour edges (e.g., contour edges 2-6). However, in other examples (e.g., implemented in hardware), tests may be performed on different contour edges in parallel.

[0194] Similarly, an AllHit test can be performed on the third ray beam 608 relative to the 3D frame 602. The components of the vector with the minimum x and y values ​​of the direction vector of the ray beam 608 will be obtained relative to the contour edge 5. In this example, the lower left ray shown in the beam 608 is an example of a ray with these component values ​​in the x and y directions. This vector provides an outer boundary to the beam 608 relative to the contour edge 5. In step S414, it is determined that the vector crosses outside the contour edge 5. Specifically, relative to the contour edge 5, inequality (11) is not satisfied, i.e., it is not (p min,y -o y )d x ≤(p min,x -o x )d y , where p min,x It is the x-component value of the plane to the left rear of frame 602, p min,y It is the y-component value of the plane to the left front of frame 602, o x and o y These are the x and y component values ​​of the origin of the ray beam 608, and d x and d y These are the x and y component values ​​of the vector defining bundle 608 relative to the outer boundary of contour edge 5. For simplicity, we have not described the tests of bundle 608 relative to contour edges 1 to 4 or 6, but from... Figure 6 It will be apparent that the AllHit test will determine that all rays of beam 608 are inside the contour edges 1 to 4 and 6 of frame 602. Due to the results of the test relative to contour edge 5, in step S416, the result of the AllHit test of beam 608 relative to frame 602 does not determine that all rays of beam 608 hit frame 602.

[0195] If the AllHit test of the light beam relative to the frame does not result in all rays in the light beam intersecting the frame (e.g., beams 506 and 508 relative to frame 502 and beams 606 and 608 relative to frame 602), the method may further include determining whether any ray in the light beam intersects the frame.

[0196] As another example, the beam intersection test can be an AnyHit test (e.g., if the test output is inverted, it can be called an "AllMiss test"). As described above, the AnyHit test has only two possible outcomes: (i) the AnyHit test determines that all rays of the beam miss the frame, or (ii) the AnyHit test is uncertain whether all rays of the beam miss the frame. In this example, for each of the identified contour edges, the vector obtained in step S412 provides an inner boundary to the beam of rays relative to the identified contour edge. If the beam of rays does not pass inside the contour edge of the identified beam, it is known that none of the rays of the beam pass inside the contour edge of the identified beam, and in this sense, the vector provides an inner boundary to the beam of rays relative to the contour edge of the identified beam. As mentioned above, the vector can have the maximum or minimum component value of the ray direction vector of the rays in the beam in each dimension. The choice of maximum or minimum component value in each dimension depends on the contour edge being tested and whether the vector provides an inner or outer boundary. The resulting vector can be the same as or different from the direction vector of one ray of the beam.

[0197] If for each defined vector in the outline edge of the identifier it passes inside the outline edge of the identifier, the intersection test result of the ray beam relative to the box is not that all rays in the ray beam miss the box. If for one or more defined vectors in the outline edge of the identifier it passes outside the outline edge of the corresponding identifier, the intersection test result of the ray beam relative to the box is that all rays in the ray beam miss the box.

[0198] For example, in Figure 5 In the 2D example shown, an AnyHit test can be performed on the first ray beam 504 relative to the 2D frame 502. A vector 5042 is obtained for the beam 504 (in step S412) relative to the contour point 5101, because this vector 5042 provides an internal boundary to the beam 504 relative to the contour point 5101; that is, if the beam does not pass inside the identified contour point 5101, then it is known that the rays of the beam 504 do not pass inside the identified contour point 5101. In step S414, it is determined that the vector 5042 passes inside the contour point 5101. Specifically, relative to the contour point 5101, it is determined according to inequality (11) that (p min,x -o x )d y,2 ≤(p max,y -o y )d x,2 , where p min,x and p max,y These are the x and y component values ​​at point 5101, o x and o y These are the x and y component values ​​of the origin of the ray beam 504, and dx,2 and d y,2 These are the x and y component values ​​of the direction of vector 5042. Vector 5041 is obtained relative to contour point 5102 for bundle 504 (in step S412) because this vector 5041 provides the inner boundary of bundle 504 relative to contour point 5102. In step S414, it is determined that vector 5041 passes through the interior of contour point 5102. Specifically, relative to contour point 5102, it is determined according to inequality (11) (p min,y -o y )d x,1 ≤(p max,x -o x )d y,1 , where p max,x and p min,y These are the x and y component values ​​at point 5102, o x and o y These are the x and y component values ​​of the origin of the ray beam 504, and d x,1 and d y,1 These are the x and y component values ​​of the direction of vector 5041. The results of these two tests are used to determine that not all rays from beam 504 miss frame 502. Therefore, in step S416, the result of the AnyHit test on beam 504 relative to frame 502 does not determine that all rays from beam 504 miss frame 502; for example, at least one ray from beam 504 may hit frame 502. In other words, the AnyHit test does not guarantee that all rays from beam 504 miss frame 502.

[0199] As another example, in Figure 5 In the 2D example shown, an AnyHit test can be performed on the second ray beam 506 relative to the 2D frame 502. A vector 5062 is obtained for the beam 506 (in step S412) relative to the contour point 5101, because this vector 5062 provides the inner boundary of the beam 506 relative to the contour point 5101. In step S414, it is determined that the vector 5062 passes through the interior of the contour point 5101. Specifically, relative to the contour point 5101, it is determined according to inequality (11) that (p min,x -o x )d y,2 ≤(p max,y -o y )d x,2 , where p min,x and p max,y These are the x and y component values ​​at point 5101, o x and o y These are the x and y component values ​​of the origin of the ray beam 506, and d x,2 and d y,2These are the x and y component values ​​of the direction of vector 5062. Vector 5061 is obtained for bundle 506 (in step S412) relative to contour point 5102, because this vector 5061 provides the inner boundary of bundle 506 relative to contour point 5102. In step S414, it is determined that vector 5061 passes outside contour point 5102. Specifically, relative to contour point 5102, it is determined that ray bundle 506 does not satisfy inequality (11). In other words, for ray bundle 506, the following is not true: (p min,y -o y )d x,1 ≤(p max,x -o x )d y,1 , where p max,x and p min,y These are the x and y component values ​​at point 5102, o x and o y These are the x and y component values ​​of the origin of the ray beam 506, and d x,1 and d y,1 These are the x and y component values ​​of the direction of vector 5061. This test determines that all rays of the ray beam 506 pass outside the contour point 5102 of the frame 502. Therefore, in step S416, the result of the AnyHit test of the ray beam 506 relative to the frame 502 is that all rays of the beam 506 miss the frame 502.

[0200] As another example, in Figure 5 In the 2D example shown, an AnyHit test can be performed on the third ray beam 508 relative to the 2D frame 502. A vector 5082 is obtained for the beam 508 (in step S412) relative to the contour point 5101, because this vector 5082 provides the inner boundary of the beam 508 relative to the contour point 5101. In step S414, it is determined that the vector 5082 passes through the interior of the contour point 5101. Specifically, relative to the contour point 5101, (p) is determined according to inequality (11). min,x -o x )d y,2 ≤(p max,y -o y )d x,2 , where p min,x and p max,y These are the x and y component values ​​at point 5101, o x and o y These are the x and y component values ​​of the origin of the ray beam 508, and d x,2 and d y,2These are the x and y component values ​​of the direction of vector 5082. Vector 5081 is obtained relative to contour point 5102 for bundle 508 (in step S412) because this vector 5081 provides the inner boundary of bundle 508 relative to contour point 5102. In step S414, it is determined that vector 5081 passes through the interior of contour point 5102. Specifically, relative to contour point 5102, it is determined according to inequality (11) (p min,y -o y )d x,1 ≤(p max,x -o x )d y,1 , where p max,x and p min,y These are the x and y component values ​​at point 5102, o x and o y These are the x and y component values ​​of the origin of the ray beam 508, and d x,1 and d y,1 These are the x and y component values ​​of the direction of vector 5081. Therefore, in step S416, the result of the AnyHit test of the light beam 508 relative to the box 502 does not guarantee that all rays of the beam 508 will miss the box 502; for example, at least one ray of the beam 508 may hit the box 502. In other words, the AnyHit test does not guarantee that all rays of the beam 508 will miss the box 502.

[0201] As can be seen, the AnyHit test results are the same for both beams 504 and 508, namely, all rays in beams 504 or 508 miss frame 502. This is also true even if some rays in beam 508 do not hit frame 502.

[0202] refer to Figure 6 The 3D example shown can perform an AnyHit test on the first ray beam 604 relative to the 3D frame 602. The components of the vector with the minimum y and z values ​​of the direction vector of the ray beam 604 are obtained relative to the contour edge 1. In this example, the lower left ray shown in the beam 604 is an example of a ray with these component values ​​in the y and z directions. This vector provides an inner boundary to the beam 604 relative to the contour edge 1. In step S414, it is determined that the vector passes through the interior of the contour edge 1. Specifically, relative to the contour edge 1, it is determined according to inequality (11) that (p max,z -o z )d y ≤(p max,y -o y )d z , where p max,z It is the z-component value of the plane on the top of frame 602, p max,yIt is the y-component value of the plane to the right rear of frame 602, o y and o z These are the y-component and z-component values ​​of the origin of the ray beam 604, and d y and d z These are the y-component and z-component values ​​of the vector that defines the inner boundary of the bundle 604 relative to the contour edge 1. Relative to the contour edge 6, the components of the vector with the maximum x-value and minimum z-value of the direction vector of the ray from the bundle 604 are obtained. The vector with these x and z components will provide the inner boundary of the bundle 604 relative to the contour edge 6. It should be noted that in this example, none of the four vectors in the bundle 604 have both the maximum x-value and the minimum z-value. In step S414, it is determined that the vector with the obtained x and z components passes through the interior of the contour edge 6. Specifically, relative to the contour edge 6, it is determined according to inequality (11) that (p max,z -o z )d x ≤(p min,x -o x )d z , where p max,z It is the z-component value of the plane on the top of frame 602, p min,x It is the x-component value of the plane to the left rear of frame 602, o x and o z These are the x-component and z-component values ​​of the origin of the 604 light beam, and d x and d z These are the x and y component values ​​of the vector defining bundle 604 relative to the inner boundary of contour edge 6. For simplicity, we have not described the tests of bundle 604 relative to contour edges 2 through 5, but from the description of the tests of contour edges 1 and 6, and from... Figure 6 It will be apparent that the AnyHit test will determine that the ray beam 604 is inside all the contour edges of the frame 602. Therefore, in step S416, the result of the AnyHit test of the ray beam 604 relative to the frame 602 does not determine that all rays of the beam 604 miss the frame 602; for example, one or more rays of the beam 604 may hit the frame 602.

[0203] An AnyHit test can be performed on the second ray beam 606 relative to the 3D frame 602. The components of the vector with the minimum x and y values ​​of the direction vector of the ray beam 606 are obtained relative to the contour edge 2. In this example, the lower left ray shown in the beam 606 is an example of a ray with these component values ​​in the x and y directions. This vector provides an inner boundary to the beam 606 relative to the contour edge 2. In step S414, it is determined that the vector passes outside the contour edge 2. Specifically, relative to the contour edge 2, inequality (11) is not satisfied, i.e., it is not (p max,x -ox )d y ≤(p max,y -o y )d x , where p max,x It is the x-component value of the plane to the right front of frame 602, p max,y It is the y-component value of the plane to the right rear of frame 602, o x and o y These are the x and y component values ​​of the origin of the ray beam 606, and d x and d y These are the x and y component values ​​of the vector defining the beam 606 relative to the inner boundary of the contour edge 2. This test determines that all rays of the beam 606 pass outside the contour edge 2 of the frame 602. For simplicity, we have not described the test of the beam 606 relative to contour edges 1 or 3 through 6, but from... Figure 6 It will be apparent that the AnyHit test will determine that beam 606 is inside the contour edges 1 and 3 to 6 of frame 602. Due to the results of the test relative to contour edge 2, in step S416, the result of the AnyHit test of beam 606 relative to frame 602 is that all rays of beam 606 miss frame 602.

[0204] An AnyHit test can be performed on the third ray beam 608 relative to the 3D frame 602. The components of the vector with the maximum x and y values ​​of the direction vector of the ray beam 608 are obtained relative to the contour edge 5. In this example, the upper right ray shown in the beam 608 is an example of a ray with these component values ​​in the x and y directions. This vector provides an inner boundary to the beam 608 relative to the contour edge 5. In step S414, it is determined that the vector passes through the interior of the contour edge 5. Specifically, relative to the contour edge 5, inequality (11) is satisfied, i.e., (p min,y -o y )d x ≤(p min,x -o x )d y , where p min,x It is the x-component value of the plane to the left rear of frame 602, p min,y It is the y-component value of the plane to the left front of frame 602, o x and o y These are the x and y component values ​​of the origin of the ray beam 608, and d x and d y These are the x and y component values ​​of the vector defining bundle 608 relative to the inner boundary of contour edge 5. For simplicity, we have not described the tests of bundle 608 relative to contour edges 1 to 4 or 6, but from... Figure 6It will be apparent that the AnyHit test will determine that beam 608 is inside the contour edges 1 to 4 and 6 of frame 602. Therefore, in step S416, the result of the AnyHit test of beam 608 relative to frame 602 does not determine that all rays of beam 608 miss frame 602; for example, one or more rays of beam 608 may hit frame 602.

[0205] If the intersection test result of the AnyHit test of the ray beam relative to the box is not that all rays in the ray beam miss the box, the method may further include determining which rays in the ray beam intersect the box. Alternatively, if the intersection test result of the AnyHit test of the ray beam relative to the box corresponding to a parent node in the hierarchical acceleration structure is not that all rays in the ray beam miss the box, the method may further include performing the AnyHit test on the boxes corresponding to child nodes (i.e., nodes that are children of the parent node in the hierarchical acceleration structure).

[0206] In some examples of traversing a hierarchical acceleration structure, the AnyHit test can be used to test a beam of light against a box corresponding to the root node of the acceleration structure. If the AnyHit test result for a beam is "hit" (which may be referred to as "pass") (i.e., if the AnyHit test result does not indicate that all rays in the beam miss the box), the beam can be tested against boxes corresponding to each of some nodes, which are children of nodes in the acceleration structure, where beam intersections are found for those boxes. This process continues down the hierarchy of the acceleration structure. If a beam fails the AnyHit test (i.e., the AnyHit test determines that all rays in the beam miss the box), the beam is not tested against boxes corresponding to some nodes, which are children of nodes where the AnyHit test returned "miss" or "fail". If any ray in the beam will hit the box, the entire beam is pulled down to be tested at the next lower level of the acceleration structure. As the beam penetrates deeper into the hierarchical acceleration structure (i.e., when testing the beam against lower levels of the acceleration structure), the boxes targeted by the test beam become smaller, and the likelihood of rays unnecessarily participating in intersection tests against boxes they miss increases. Therefore, a threshold level may exist in the hierarchical acceleration structure such that below the threshold level, if the beam passes the AnyHit test at the threshold level, the beam is split into individual rays to test the boxes corresponding to nodes at levels below the threshold level. In different examples, the threshold level can be different, and as two examples, the threshold level can be based on the node depth in the hierarchical acceleration structure or on the size of the bounding box being tested. If the ray beam passes the AnyHit test against a leaf node, the rays of the beam can be separated from the beam, and the intersection of individual rays with primitives pointed to by the pointers of the leaf nodes can be tested. Alternatively, the intersection of the beam with primitives pointed to by the pointers of the leaf nodes can be tested. The system may include different test blocks to test rays against primitives, rather than against boxes. It should be noted that the shape of the primitives is usually not rectangular or cubic (primitives are usually triangular).

[0207] In the example described above, all rays in the beam share the same origin. This simplifies the intersection test performed on the beam. However, if a beam can only contain rays with the same origin, this greatly limits which rays can be grouped together to form a beam, meaning some rays may not be able to form a beam. Primary rays typically share the same origin (i.e., corresponding to the viewpoint of the scene). However, secondary rays (i.e., rays emitted from intersections in the scene) typically have different origins. Allowing rays with different origins to form beams together increases the number of rays that can be formed into a beam (specifically, secondary rays). See below for reference. Figure 10The method of grouping light rays together into bundles is described in more detail. In some examples, not all rays in a bundle have the same origin. For example, rays within a bundle may have different origins. There may be a threshold difference between origins, and rays above that origin will not be included in the same bundle. In these examples, even if the origins of the rays within a bundle are not exactly identical, the difference between the origins of the rays in the bundle is not significant. This allows for performing intersection tests on the bundle while still providing useful results about the rays within the bundle.

[0208] For example, the data for a bundle can specify the maximum and minimum origin component values ​​of the rays within the bundle in each dimension. For instance, vector o can be specified. min and o max , where o min The x, y, and z components are the minimum values ​​of the x, y, and z components at the origin of the light rays in the beam, and where o max The x, y, and z components are the maximum values ​​of the x, y, and z components at the origin of the ray in the bundle. During the intersection test, when calculating the distance from the ray origin to the plane representing the side of the frame, the distance to either the minimum or maximum origin of the bundle in a specific dimension is used. The choice between using the minimum or maximum component of the ray origin in the intersection test depends on whether an AllHit test or an AnyHit test is performed.

[0209] For example, for the AnyHit test, it is better to produce a hit result (i.e., pass, indicating that not all rays in the bundle miss the box) than a miss result (i.e., fail, indicating that all rays in the bundle miss the box). This is because if the AnyHit test produces a false miss result (i.e., a miss when one or more rays in the bundle actually hit the box), this could cause rendering errors; while if the AnyHit test produces a false hit result (i.e., a hit when all rays in the bundle actually miss the box), this will not cause rendering errors, but may reduce the efficiency of the intersection test because an additional intersection test is performed unnecessarily. Therefore, the effective size of the box is increased so that the maximum origin component value is used when subtracting the origin component value from the minimum plane of the box, i.e., in the value (p min,i -o i In the case of the example given above, this value will be replaced with the value (p). min,i -o max,i ), where i∈{x,y,z}, where o max,i It is the maximum value of the i-th component of the ray beam originating from the origin. Furthermore, to increase the effective size of the frame, the minimum origin component value is used when subtracting the origin component value from the maximum plane of the frame; that is, in the value (p... max,i -o i In the case of the example given above, this value will be replaced with the value (p).max,i -o min,i ), where i∈{x,y,z}, where o min,i It is the minimum value of the i-th component of the ray beam originating from the ray beam.

[0210] For example, for the AllHit test, it is better to produce a missed result (i.e., a failure, indicating that not all rays in the beam hit the frame) than a hit result (i.e., a pass, indicating that all rays in the beam hit the frame). This is because if the AllHit test produces false hits (i.e., a hit when one or more rays in the beam actually miss the frame), this can significantly reduce the efficiency of the intersection test; while if the AllHit test produces false missed results (i.e., a missed result when all rays in the beam actually hit the frame), this can lessen the efficiency reduction of the intersection test. Therefore, the effective size of the frame can be reduced such that the minimum origin component value is used when subtracting the origin component value from the minimum plane of the frame, i.e., in the value (p min,i -o i In the case of the example given above, this value can be replaced with the value (p). min,i -o min,i ), where i∈{x,y,z}, where o min,i It is the minimum value of the i-th component of the ray beam originating from the origin. Furthermore, to reduce the effective size of the frame, the maximum origin component value is used when subtracting the origin component value from the maximum plane of the frame; that is, in the value (p... max,i -o i In the case of the example given above, this value will be replaced with the value (p). max,i -o max,i ), where i∈{x,y,z}, where O max,i It is the maximum value of the i-th component at the origin of the beam of light.

[0211] Figures 16a to 16c This illustrates how the effective size of the frame can be increased or decreased based on the difference in the origin values ​​of the rays in the beam. For ease of explanation, Figures 16a to 16c The example shown is a 2D example, but it will be obvious how the effective size of the box can be increased or decreased in a 3D example. Figure 16a Box 1602 is shown, in which the minimum position vector p is shown. min and the maximum position vector p max In this example, the beam of light contains four rays, which are formed by... Figure 16a The solid black circle in the diagram indicates the location of the origin. The axis-aligned bounding box 1604 defines all origins. Bounding box 1604 has the maximum position vector o. max and the minimum position vector o min ,like Figure 16a As shown. Figure 16a The figure shows p in the x and y directions. min and o max and o min The distance between them.

[0212] Figure 16b This illustrates, in an example of the AnyHit test, how the effective size of box 1602 can be increased based on the difference in the origin values ​​of the rays in the beam. The ray beam can be considered as having a single origin at position o. The effective size of box 1602 is increased to box 1606, as shown. Figure 16b The dashed line in the diagram shows the minimum position vector of valid frame 1606 at position [p]. min -(o max -o)], and the maximum position vector of the valid frame 1606 is at position [p max -(o min -o)]. The distance to the minimum vector position of the effective bounding box 1606 in the x dimension is given by the following formula: [p min,x -(o max,x -o x )]-o x , and Figure 16a The [p] shown min,x -o max,x The same applies; and the distance in the y-axis to the minimum vector position of the effective bounding box 1606 is given by the following formula: [p min,y -(o max,y -o y )]-o y , and Figure 16a The 9p shown min,y -o max,y The same applies. Similarly, calculations can be performed to determine the distance between the ray beam and the maximum vector position of the effective box 1606. It is understood that, in the AnyHit example, increasing the effective size of box 1602 to box 1606 and using a single origin value is equivalent to treating the ray beam as having different origin values ​​for testing against the original box 1602.

[0213] Figure 16c This illustrates, in an example of the AllHit test, how the effective size of box 1602 can be reduced based on the difference in the origin values ​​of the rays in the beam. Specifically, the effective size of box 1602 is reduced to box 1608, as shown below. Figure 16c The dashed line in the diagram shows the minimum position vector of valid frame 1608 at position [p]. min -(o min -o)], and the maximum position vector of the valid bounding box 1608 is at position [p max -(o max-o)]. The ray beam can be considered as having a single origin at position o, and its distance in the x-dimensional to the minimum vector position of the effective bounding box 1608 is given by the following formula: [p min,x -(o min,x -o x )]-o x , and Figure 16a The [p] shown min,x -o min,x The same applies; and the distance in the y-axis to the minimum vector position of the effective bounding box 1608 is given by the following formula: [p min,y -(o min,y -o y )]-o y , and Figure 16a The [p] shown min,y -o min,y The same applies. Similarly, calculations can be performed to determine the distance between the ray beam and the maximum vector position of the effective box 1608. It is understood that, in the AllHit example, reducing the effective size of box 1602 to box 1608 and using a single origin value is equivalent to treating the ray beam as having different origin values ​​for testing against the original box 1602.

[0214] Therefore, if the rays in the beam do not all have the same origin, then for each of the identified contour edges, the step S414 of determining whether the vector passes inside or outside the contour edge includes performing a comparison according to the following formula: (p o,i -o i,[min,max] )d j <(p o,j -o j,[min,max] )d i , where p o,i p represents the i-th component of a point on the first plane of the first side of the frame forming the outline edge. o,j It is the j-th component of a point on the second plane of the second side of the frame forming the outline edge, o i[min,max] It is the minimum or maximum value of the i-th component of the light ray at the origin of the light ray beam, o j[min,max] It is the minimum or maximum value of the j-th component of the light ray at the origin of the light ray beam, and d i and d j These are the i-th and j-th components of the vector that provides the boundary to the light beam.

[0215] As described above and in Figure 5 and Figure 6In the examples shown, the direction vectors of the rays in the beam all have the same sign. In these examples, the outline edges of the box are at opposite edges of the box. However, if one or more of the component values ​​of the direction vectors of the rays in the beam do not all have the same sign, the step of identifying the outline edges (step S410) can identify different edges of the box. For example, Figure 7 A 2D example is shown for testing the intersection of a ray beam 704 with a 2D frame 702. The x-component values ​​of the two boundary vectors 7041 and 7042 of the beam 704 have different signs, but the y-component values ​​of the boundary vectors have the same sign. In some examples, the requirement for grouping rays into a ray beam is that the component values ​​of the boundary vectors have the same sign in each dimension, but in other examples, this requirement is not present. Figure 7 As shown, in this example, the contour points of the 2D box 702 are 7101 and 7102. Both contour points are located on the edge of box 702 closest to the origin of the ray beam 704. Therefore, contour points 7101 and 7102 are not at exactly opposite corners of box 702. For example, an AllHit test performed on the beam 704 relative to box 702 will determine that all rays from beam 704 hit box 702 because vector 7041 passes inside contour point 7101, and because vector 7042 passes inside contour point 7102. Figure 7 It is obvious that if the exact opposite point of box 702 is used as the outline point of the box, then the AllHit test performed on beam 704 relative to box 702 will not determine that all rays of beam 704 hit box 702.

[0216] Figure 8a A 3D example is shown, where the outline edges (due to the viewpoint of the view frame 802) are visible. Figure 8a The numbers 1 to 6 (represented in the original text) are not all exactly opposite pairs. For example, when from... Figure 8a When viewed from the perspective shown, the edges that are exactly opposite to the outline edges 2, 3, 5 and 6 are not the outline edges of box 802. Figure 8b A 3D example is shown where only four contour edges exist due to the viewpoint of viewbox 804 (in Figure 8b (represented as 1 to 4), which is not the exact opposite edge of box 804. It should be noted that box 804 is a 3D box, but from... Figure 8b From the perspective shown, only one side of box 804 is visible, making it difficult to see when viewed from... Figure 8b When viewed from the perspective shown, the edge of this side of frame 804 is the outline edge of 3D frame 804.

[0217] Figure 9Another example ray tracing system 900 for performing intersection tests in the manner described above is shown. Ray tracing system 900 is similar to ray tracing system 300 because it includes a scheduler 901, a request queue 903, a memory 905, and a tester module 907, and the tester module 907 includes a test queue 909 and a result processor 913. The tester module 907 also includes a set of one or more first test blocks (configured to perform AllHit bundle intersection tests) and a set of one or more second test blocks (configured to perform AnyHit bundle intersection tests). The test blocks are organized into multiple pairs of test blocks, each pair including: (i) a first test block from the set of one or more first test blocks, and (ii) a second test block from the set of one or more second test blocks. For example, Figure 9 A first pair of test blocks, including AllHit test block 9151 and AnyHit test block 9152, is shown; and a second pair of test blocks, including AllHit test block 9171 and AnyHit test block 9172, is shown. The result processor 913 is configured to process the intersection test results determined by the test blocks.

[0218] The ray tracing system 900 also includes a bundle builder (e.g., implemented in hardware or software or a combination thereof) configured to receive rays and construct ray bundles based on the received rays to test intersection with a frame. Bundles can be constructed by grouping rays together based on ray similarity. The term "similarity" as used herein refers to whether rays have similar origins and orientations. That is, rays with similar origins and similar orientations are "similar" rays. The bundle builder groups similar rays into bundles, allowing bundle intersection tests to be performed on the bundles. Furthermore, it should be noted that the scheduler 901 groups coherent rays and / or bundles into groups. Here, the term "coherent" means that rays and / or bundles will access the same memory locations to retrieve nodes to be tested for intersection. "Similar" rays grouped into bundles are also "coherent" rays because these similar rays will access the same memory locations for intersection testing. However, "coherent" rays are not necessarily "similar." In other words, some rays that will access the same memory locations to retrieve nodes to be tested for intersection may not have similar origins and orientations. The way the bundle builder 919 groups rays into bundles can be controlled by a similarity threshold, for example, by allowing new rays to merge with the bundle while keeping the real angle of the boundary vector representing the bundle smaller than a threshold, and / or, as another example, by keeping the bounding box of the origin of the rays within the bundle smaller than a certain size. This size threshold can be relative to the size of the scene. Alternatively, a simpler direction threshold would be: for each of the i components, the series of i-th component values ​​of the direction vector of the rays in the bundle has a maximum value. In other words, the value d of each of the i components... max,i -d min,iIt has a maximum value. In this example, the direction vectors are normalized so that they are equivalent.

[0219] Figure 10 A flowchart of a method performed by a ray tracing system 900 is shown. In step S1002, a beam builder 919 receives rays to be tested intersecting with one or more frames. The beam builder 919 may maintain a set of open beams to which the received rays can be added. The beam builder 919 may have a local memory to store the open beams. Steps S1006 to S1016 are performed for each of the received rays. In step S1006, the beam builder 919 determines the similarity level between the received ray and each of the open beams. This can be done by observing, for each of the open beams, how much the beam boundary (if any) increases when the ray is added to the beam. For example, if the origin of the ray is outside the bounding box of the origin of the beam, the similarity determination can be based on the distance between the origin of the ray and the bounding box of the origin of the beam and whether this distance is less than a threshold. If the component of the ray's direction vector is greater than the maximum direction of the beam or less than the minimum direction of the beam, the similarity determination can be based on the difference between the ray's direction vector and the minimum or maximum direction of the beam and whether this difference is less than a threshold. These thresholds can be fixed, or they can be thresholds that increase based on percentages, such as a percentage increase based on the bounding box of the bundle's origin, or a percentage increase based on the difference between the bundle's maximum and minimum direction vectors when a ray is added to the bundle. In step S1008, the bundle builder 919 identifies the best-matching open bundle from the set of open bundles for the received ray based on a determined similarity level. For example, in step S1008, the open bundle with the highest similarity level to the ray can be identified.

[0220] In step S1010, the bundle builder 919 determines whether the similarity level between the ray and the best-matching open bundle is higher than a threshold similarity level. In other words, the bundle builder 919 determines whether the ray is sufficiently similar to the best-matching open bundle to be added to it. If, in step S1010, the received ray is determined to have a similarity level higher than the threshold with the best-matching open bundle, the method proceeds to step S1012, where the received ray is added to the best-matching open bundle. If, in step S1010, the determined similarity level of the best-matching open bundle is determined to be lower than the threshold, the method proceeds to step S1014, where a new bundle is created, i.e., a new open bundle is created that initially does not contain any rays but to which rays can be added. As part of step S1014, if there is no space to create a new open bundle, an existing bundle can be selected and output from the bundle builder 919 and passed to the scheduler 901 to make room for creating a new open bundle. Then, in step S1016, the received ray is added to the new bundle.

[0221] In step S1018, the full bundle (i.e., the bundle ready to be tested for intersection with the box) is output from the bundle builder 919 and passed to the scheduler 901.

[0222] Scheduler 901 operates in a manner similar to scheduler 301 described above. However, scheduler 901 can form groups, including pointers to rays and / or ray bundles. This has no effect on grouping pointers, whether the pointers are for individual rays or ray bundles. In other words, rays and bundles can be mixed within groups, and groups can contain multiple rays and bundles (i.e., pointers to multiple rays and pointers to multiple ray bundles). Scheduler 901 groups rays and / or ray bundles that require access to the same block of memory 905. In other words, in step S1020, scheduler 901 forms groups that include one or both ray indicators and ray bundle indicators that the rays and ray bundles will require access to the same memory block to perform an intersection test. For example, rays and / or bundles to be tested relative to the same frame or object can be grouped such that data for the frame or object can be retrieved from memory 905 once for intersection testing of all rays and / or bundles in the group. Once the scheduler has assembled the rays and / or bundles into a group, the scheduler issues the group and adds it to request queue 903 to request the node data of the group (i.e., data describing the boxes corresponding to the appropriate nodes of the acceleration structure against which the intersection of the rays and / or bundles of the group is to be tested) from memory 905. In step S1022, the node data of the group is then retrieved from memory 905. In other words, in step S1022, data is extracted from the memory block to perform an intersection test on one or both of the rays and bundles of rays indicated by the indication in the group. In step S1024, the extracted data is passed to tester module 307 so that tester module 307 can perform an intersection test as described herein, for example, referring to Figure 4 , Figure 11 or Figure 12 The flowchart.

[0223] In the first example, a permanent root bundle may exist. In this example, once a ray has been added to a bundle, it will not separate from the bundle and will be grouped together into different bundles. In other words, in this example, the bundle builder 919 only processes new rays, i.e., primary rays and newly generated secondary rays. In this example, the results output from the result processor 913 can be directly passed to the scheduler 901, or they can be passed to the bundle builder 919, which can then simply forward the results to the scheduler 901. Figure 9The output from the result processor 913 is shown in dashed lines because, in different implementations, this output may be routed to either the bundle builder 919 or the scheduler 901. In this example, once the bundle begins traversal, it can be broken down (e.g., separated into individual rays), but the rays within the bundle cannot be reassembled or reorganized into other bundles. In other words, the rays constituting the bundle: (i) contain new rays that were not previously included in the ray bundle, but (ii) do not contain rays that were previously included in the ray bundle. In this example, since the bundle builder 919 only processes new rays, it only needs to run fast enough to process a relatively small number of rays per cycle (e.g., one or two rays). Furthermore, it is not necessary to access the data of individual rays within the bundle at each iteration (e.g., to begin each intersection test at each level of the acceleration structure), but only when the bundle collapses, such as when individual rays separate from the bundle. This allows the data of the bundle's boundary vectors to be stored separately from the ray data of individual rays, so the amount of data required to perform a bundle intersection test is comparable to (i.e., similar, for example, roughly equal) the amount of data required to perform a ray intersection test on a single ray.

[0224] In the second example, the bundle can be restructured. In this example, the bundle will be decomposed and deconstructed after each iteration of the intersection test (e.g., after each bundle intersection test). In this example, the tester module 907 will be modified to decompose the bundle into individual rays and pass the results of the individual rays to the bundle builder 919. The bundle builder will be responsible for forming the bundle when the ray results arrive and outputting the bundle to the scheduler 901. In some examples, the scheduler 901 may receive results from the results processor 913 and form the bundle. Since the scheduler 901 handles coherence collection for grouping rays and / or bundles into groups, it is not a significant modification to have the scheduler 901 also form bundles of similar rays (note that similar rays are coherent). In these examples, the rays constituting the bundle include: new rays not previously included in the ray bundle, and rays previously included in the deconstructed ray bundle. In these examples, bundles can be merged with other bundles or rays during traversal of the accelerated structure, which can make it more likely to benefit from performing bundle intersection tests (e.g., because bundles can typically contain a large number of rays, or because the similarity of rays within a bundle can typically be increased (compared to the first example of implementing permanent root bundles described in the preceding paragraphs)). However, in this second example, additional logic (e.g., additional hardware) will be required to form bundles of many rays per clock cycle (where the number of rays per clock cycle will depend on the number of test blocks in tester module 907). This second example also requires reading all ray data of the group at each iteration, which is not necessary in the first example described in the preceding paragraphs.

[0225] The test blocks described above (which can be configured to perform AllHit or AnyHit tests on ray bundles) are also configured to perform intersection tests on single rays. In other words, these test blocks can be used as individual ray testers, for example, to perform intersection tests on rays relative to a frame. A single ray can be considered as a bundle containing the single ray. For a bundle containing single rays, the boundary vector of the bundle will simply be the direction vector of the single ray, and the maximum and minimum components of the origin of the bundle will simply be the components of the origin of the ray. In this case, both the AllHit and AnyHit tests described above will give the correct intersection test results for the single rays in the bundle. This is useful because ray tracing systems 300 and 900 do not require dedicated single-ray test blocks and dedicated bundle test blocks: the same test blocks can be used to perform both bundle intersection tests and single-ray intersection tests. This reduces the possibility of bottlenecks caused by one type of test block being saturated while another type of test block is idle.

[0226] Tester module 907 includes memory 921 configured to store data describing frames that have been retrieved from memory 905 to perform intersection tests relative to the frames. For example, when testing the intersection of a bundle with respect to a frame, the frame data can be retrieved from memory 905 and stored in local memory 921. If the bundle collapses, i.e., if the rays in the bundle are separated into individual rays, the data for the individual rays can be retrieved from memory 905 (or from some other memory, such as an on-chip memory near the test block for storing ray data (e.g., a portion of local memory 921)), and the intersection with respect to the frame can be tested using the frame data stored in local memory 921. When frame data is retrieved from memory 905, local memory 921 temporarily stores the data so that, for example, when the bundle collapses, the data can be reused without requiring a round trip through memory 905, i.e., without needing to retrieve the frame data from memory 905 again.

[0227] The AllHit and AnyHit tests have been described above, and each of these two types of bundle intersection tests can be performed independently, each offering its own benefits, such as reducing the total number of intersection tests that need to be performed. However, in some examples, both AllHit and AnyHit tests can be performed. For example, Figure 11 A flowchart is shown showing a method for performing an intersection test at the ray tracing system 900.

[0228] In step S1102, the tester module 907 receives the beam of light to be tested for intersection with the frame. In step S1104, the first test block (e.g., test block 9151 or 9171) performs a first beam intersection test (i.e., an AllHit test) to determine whether all rays of the beam intersect with the frame. As described above, the AllHit test has two possible results: (i) determining that all rays of the beam hit the frame, or (ii) not determining that all rays of the beam hit the frame. In step S1106, the result of the first beam intersection test is considered. If the first beam intersection test determines that all rays of the beam hit the frame, the method proceeds from step S1106 to step S1108. In step S1108, it is determined that the beam intersection test result relative to the frame indicates that all rays of the beam intersect with the frame.

[0229] If the first beam intersection test is uncertain that all rays of the beam hit the frame, the method proceeds from step S1106 to step S1110. In step S1110, the second test block (e.g., test block 9152 or 9172) performs a second beam intersection test (i.e., an AnyHit test) to determine whether all rays of the beam miss the frame. As described above, the AnyHit test has two possible outcomes: (i) determining that all rays of the beam miss the frame, or (ii) being uncertain that all rays of the beam miss the frame. In step S1112, the outcome of the second beam intersection test is considered. If the second beam intersection test determines that all rays of the beam miss the frame, the method proceeds from step S1112 to step S1114. In step S1114, it is determined that the beam intersection test result relative to the frame indicates that all rays of the beam miss the frame.

[0230] If all rays of the second intersecting test uncertain bundle miss the frame, the method proceeds from step S1112 to step S1116. Therefore, if all rays of the first intersecting test uncertain bundle intersect the frame, and if all rays of the second intersecting test uncertain bundle miss the frame, the method reaches step S1116. In step S1116, the ray bundle is separated into individual rays. For example, the result processor 913 can separate the ray bundle into individual rays. Then, in step S1118, an intersection test is performed on the individual rays relative to the frame to determine which individual rays intersect the frame. One or more of the test blocks can perform the intersection test on the individual rays without first passing the individual rays back to the bundle builder 919 or scheduler 901. After the intersection test has been performed on the individual rays, the results of the intersection test on the individual rays can be output from the tester module 907 (e.g., from the result processor 913). If an intersection test finds a hit with a single ray, the ray can be processed as if it were a newly received ray, to test the boxes represented by the child nodes of the node representing the newly discovered intersection box. For example, a single ray that has been found to have a hit can be output from the results processor 913 to the bundle builder 919 or scheduler 901, allowing the single ray to be bundled and / or grouped and passed to the request queue 903, so that the ray can be processed as if it were a newly received ray, to test the boxes represented by the child nodes of the node representing the newly discovered intersection box. As described above, the box data can be stored in local memory 921, and the same test blocks (e.g., 9151, 9152, 9171, and 9172) can be used to perform intersection tests on the single rays relative to the boxes.

[0231] exist Figure 11 In the method shown in the flowchart, a second beam intersection test (e.g., an AnyHit test) is conditionally performed based on the result of a first beam intersection test (e.g., an AllHit test). In other words, in this example, in response to the result of the AllHit test not determining that all rays of the beam hit the box, the AnyHit test is performed relative to the box on the beam. This is an example of how the method can be implemented in software, for example, as a block of software code executable on a processing unit, in the tester module 907.

[0232] Figure 12 A flowchart illustrating another method for performing an intersection test at a ray tracing system 900 is shown. This flowchart may be more suitable for implementation in hardware, such as a hardware block in a tester module 907 configured to perform an intersection test (e.g., implemented in a fixed-function circuitry system). Figure 12In the method shown, both a first intersection test (e.g., AllHit test) and a second intersection test (e.g., AnyHit test) are performed on the light beam relative to the frame, unconditionally, i.e., regardless of the result of another intersection test of the light beam relative to the frame. Specifically, the second intersection test (e.g., AnyHit test) is performed regardless of the result of the first intersection test (e.g., AllHit test).

[0233] In step S1202, the tester module 907 receives the beam of light to be tested for intersection with the frame. After step S1202, steps S1204 and S1210 are performed in parallel. In step S1204, a first test block (e.g., test block 9151 or 9171) performs a first beam intersection test (i.e., an AllHit test) to determine whether all rays of the beam intersect the frame. In step S1206, the result of the first beam intersection test is considered. If the first beam intersection test determines that all rays of the beam hit the frame, the method proceeds from step S1206 to step S1208. In step S1208, it is determined that the beam intersection test result relative to the frame indicates that all rays of the beam intersect the frame. If the first beam intersection test does not determine that all rays of the beam hit the frame, the method proceeds from step S1206 to step S1215.

[0234] In step S1210, the second test block (e.g., test block 9152 or 9172) performs a second beam intersection test (i.e., an AnyHit test) to determine whether all rays of the beam miss the frame. In step S1212, the result of the second beam intersection test is considered. If the second beam intersection test determines that all rays of the beam miss the frame, the method proceeds from step S1212 to step S1214. In step S1214, it is determined that the beam-to-frame intersection test result indicates that all rays of the beam miss the frame. If the second beam intersection test does not determine that all rays of the beam miss the frame, the method proceeds from step S1212 to step S1215.

[0235] The results from both the first and second test blocks are passed to the result processor 913. In step S1215, the result processor 913 determines whether the results of steps S1206 and S1212 are "No". In other words, the result processor 913 determines whether (i) the AllHit test is uncertain whether all rays of the beam hit the box, and (ii) the AnyHit test is uncertain whether all rays of the beam miss the box. If so, the method proceeds from step S1215 to step S1216. In step S1216, the result processor 913 separates the beam into individual rays. Then, in step S1218, an intersection test is performed on the individual rays relative to the box to determine which individual rays intersect with the box. Individual rays (or references to individual rays, such as ray IDs) can be output from the result processor back to one or more test blocks for performing intersection tests on the individual rays. Alternatively, individual rays can be output from the result processor 913 and processed as if the ray were a newly received ray. For example, individual rays can be output from the result processor 913 to the bundle builder 919 or the scheduler 901, allowing the individual rays to be bundled and / or grouped and passed to the request queue 903, so that the rays can be processed as if they were newly received rays. As described above, the data of the frame can be stored in the local memory 921, and the same test blocks (e.g., 9151, 9152, 9171, and 9172) can be used to perform intersection tests on individual rays relative to the frame.

[0236] In some examples, ray data for rays may be stored in on-chip memory (as part of local memory 921), and each ray has an identifier (which may be referred to as a "RayID"). When we describe passing "rays" between blocks, in some examples, this can be implemented by passing RayIDs between blocks, so that the actual ray data (e.g., ray origin and direction, etc.) does not need to be passed between blocks. The test block (e.g., 915 or 917) can read the ray data indicated by the RayID just before performing intersection on the rays, for example, by retrieving the ray data from local memory. In the example of recreating a bundle, ray data may be streamed from tester module 907 to bundle builder 919, so that the bundle builder has the ray data to create the bundle.

[0237] The structure of the groups created by scheduler 901 can be an indication of the location of data in memory and a list of RayIDs, such as a list of links. Scheduler 901 constructs a RayID list for each group it is creating. Each in a bundle can have its own RayID, as well as a pointer to the RayID list for each ray in the bundle. If the bundle is to collapse (i.e., split into individual rays), the result processor 913 can pass pointers to the individual rays back to the front end of tester module 907. Essentially, in this case, the result processor 913 has a priori created groups of individual rays. The test block of tester module 907 reads the ray data of the individual rays exactly before each intersection test as usual.

[0238] Typically, the grouping includes a reference for the light rays, and the tester module extracts the light ray data when the light ray data is to be used for an intersection test.

[0239] If, in step S1215, the result processor 913 determines that the result of step S1206 or step S1212 is "yes" (in other words, if the result processor 913 determines that: (i) the AllHit test determines that all rays of the beam hit the frame, or (ii) the AnyHit test determines that all rays of the beam miss the frame), then the method executed by the test block ends after step S1215 because the intersection test result of the beam relative to the frame has already been determined. In other words, the AllHit test or the AnyHit test has already determined the intersection test result of the beam relative to the frame, and this result has already been output to the result processor 913; therefore, it is not necessary to separate the beam into individual rays to determine the intersection test result of all rays of the beam relative to the frame.

[0240] exist Figure 11 and Figure 12 In the two examples shown, if the first beam intersection test (e.g., the AllHit test) is uncertain whether all rays of the beam intersect the box, the result of performing a second beam intersection test (e.g., the AnyHit test) is used to determine the beam's intersection test result relative to the box. The main difference between these two methods lies in... Figure 11 In the method, the second beam intersection test is conditionally performed based on the results of the first beam intersection test; while Figure 12 In this method, the first beam intersection test and the second beam intersection test are performed simultaneously and in parallel. In other words, in Figure 12 In this method, a second beam intersection test (e.g., AnyHit test) is performed regardless of the result of the first beam intersection test (e.g., AllHit test).

[0241] In some other examples not described in detail herein, it is possible to conditionally perform a first beam intersection test (e.g., an AllHit test) based on the result of a second beam intersection test (e.g., an AnyHit test). In these other examples, if the AnyHit test determines that all rays of the beam miss the frame, the AllHit test will not be performed; if the AnyHit test does not determine that all rays of the beam miss the frame, the AllHit test will be performed.

[0242] As described above, the tester module 907 of the ray tracing system 900 includes multiple pairs of test blocks, each pair including an AllHit test block and an AnyHit test block. The tester module 907 is configured to pass data of a ray beam and a representation frame to a pair of test blocks (e.g., test blocks 9151 and 9152), such that the first test block 9151 of the pair performs a first beam intersection test (e.g., an AllHit test) relative to the frame against the ray beam, and the second test block 9152 of the pair performs a second beam intersection test (e.g., an AnyHit test) relative to the frame against the ray beam. In this manner, when an intersection test is performed on the ray beam, the beam is passed to both test blocks in the pair for the intersection test.

[0243] As described above, the test blocks can also be used to perform intersection tests on individual rays. The tester module 907 is configured to pass a first individual ray and a second individual ray, along with data representing a frame, to a pair of test blocks (e.g., test blocks 9151 and 9152), such that the first test block 9151 performs an intersection test on the first individual ray relative to the frame, and the second test block 9152 performs an intersection test on the second individual ray relative to the frame. In this way, when performing an intersection test on individual rays, two individual rays can be passed to the corresponding test blocks in a pair of test blocks for the intersection test. Therefore, it is understood that in some examples, a ray beam will occupy a pair of test blocks at a time, while a single ray will occupy only one test block at a time.

[0244] Figure 13a An example data structure for storing ray data is shown. In this example, each ray has 64 bytes of data. Figure 13aAs shown, the ray data of a ray includes the x, y, and z components of the ray's origin; the x, y, and z components of the ray's direction vector; the x and y components ("PosX" and "PosY") used to indicate the screen space position associated with the ray, which can be used to write back the results; the maximum distance the ray can travel ("MaxT"); the distance to the nearest hit ("T"); the U and V components of the centroid of the hit point on the primitive; the ID of the shader on the hit primitive ("Hit ID"); one or more markers that can be used to implement various per-ray API features such as backface culling; and user data that can be written, for example, by the shader program.

[0245] The data for the ray beam is stored in a data structure and includes: origin data for the ray beam; vector data describing the components of the vector that provides the boundary to the ray beam; and one or more pointers to the ray data pointing to the rays of the ray beam. For example, Figure 13b The data structure used to store data for the light beams is shown. In this example, each light beam has 64 bytes of data. Figure 13b In the example shown, each row represents a value with 32 bits of data. It's convenient to have the same data structure for ray and beam data because this allows beams and rays to be easily grouped together. For example... Figure 13b As shown, the data for a ray bundle includes: the minimum and maximum x, y, and z components of the origin of the ray bundle; the minimum and maximum x, y, and z components of the boundary vector of the ray bundle; the maximum distance the ray bundle can travel (“MaxT”); the distance to the nearest hit (“T”); one or more markers that can be used to implement various per-ray API features such as backface culling; and one or more ray pointers indicating the data of the rays in the bundle. For example, a ray pointer may point to another data group containing all the ray data that make up the bundle. When the bundle is broken down into individual rays, each bundle will follow this ray pointer once. For example, the results processor 913 may pass this pointer back to the test queue 909 and treat the pointer in the same way as when the pointer pointing to the list of rays comes from the scheduler path (e.g., from the request queue 903).

[0246] In some examples, a ray bundle can be separated into individual rays if a separation metric is met. For example, the separation metric can be based on one or more of the following: the number of rays in the ray bundle; the dispersion of the rays in the ray bundle; the size of the region defined by the outline edge of the box; whether the source of the rays in the ray bundle is a frame shader or a ray shader; and data provided by the shader that created the rays in the ray bundle (e.g., information related to the degree of dispersion of the rays). For example, if the number of rays in the bundle is less than a threshold, the bundle can be deconstructed, i.e., separated into individual rays. If there are not many rays in the bundle, the benefit provided by performing a bundle intersection test instead of an individual ray intersection test is not significant. For example, if there are only two rays in the bundle, it might be better to separate the rays and test them individually rather than performing a bundle intersection test. As another example, if the dispersion of the rays in the bundle is higher than a threshold, the rays can be considered too dispersed and the bundle can be separated. In this case, if the dispersion of the rays in the bundle is too wide, the rays are unlikely to have the same intersection test result, so performing a bundle intersection test is less advantageous. The wider the dispersion of the rays in the bundle, the greater the difference between the maximum and minimum boundary vector components of the bundle.

[0247] Figure 14 A computer system in which the ray tracing system described herein can be implemented is shown. The computer system includes a CPU 1402, a GPU 1404, memory 1406, and other devices 1410, such as a display 1412, speakers 1414, and a camera 1416. A ray tracing unit 1408 is implemented on the GPU 1404. Components of the computer system can communicate with each other via a communication bus 1418. The ray tracing unit 1408 can operate together with a portion of the memory 1406 to implement the ray tracing system 300 or ray tracing system 900 described above. In some examples, the ray tracing system can be implemented separately from the GPU 1404.

[0248] Ray tracing systems 300 and 900 are shown as comprising several functional blocks. This is merely illustrative and not intended to define a strict division between different logical elements of such entities. Each functional block can be provided in any suitable manner. It should be understood that intermediate values ​​described herein as being formed by the ray tracing system do not need to be physically generated by the ray tracing system at any point in time, and may simply represent logical values ​​that conveniently describe the processing performed by the ray tracing system between its inputs and outputs.

[0249] The ray tracing system described herein can be embodied in hardware on an integrated circuit. The ray tracing system described herein can be configured to perform any of the methods described herein. Generally, any of the functions, methods, techniques, or components described above can be implemented in software, firmware, hardware (e.g., a fixed logic circuit system), or any combination thereof. The terms “module,” “function,” “component,” “element,” “cell,” “block,” and “logic” are used herein to generally denote software, firmware, hardware, or any combination thereof. In the case of a software implementation, a module, function, component, element, cell, block, or logic represents program code that, when executed on a processor, performs a specified task. The algorithms and methods described herein can be executed by one or more processors executing code that causes the processor to execute the algorithm / method. Examples of computer-readable storage media include random access memory (RAM), read-only memory (ROM), optical disk, flash memory, hard disk storage, and other memory devices that can use magnetic, optical, and other techniques to store instructions or other data and can be accessed by a machine.

[0250] As used herein, the terms computer program code and computer-readable instructions refer to any kind of executable code for a processor, comprising code expressed in machine language, interpreted language, or scripting language. Executable code includes binary code, machine code, bytecode, code defining integrated circuits (e.g., hardware description languages ​​or netlists), and code expressed in programming languages ​​such as C, Java, or OpenCL. Executable code can be, for example, any kind of software, firmware, script, module, or library that, when properly executed, processed, interpreted, compiled, or run in a virtual machine or other software environment, causes the processor of a computer system that supports the executable code to perform tasks specified by said code.

[0251] A processor, computer, or computer system can be any kind of device, machine, or special-purpose circuit, or a collection or part thereof, that has the processing power to execute instructions. A processor can be any kind of general-purpose or special-purpose processor, such as a CPU, GPU, system-on-a-chip, state machine, media processor, application-specific integrated circuit (ASIC), programmable logic array, field-programmable gate array (FPGA), etc. A computer or computer system may include one or more processors.

[0252] This invention also intends to cover software, such as hardware description language (HDL) software, that defines the configuration of hardware as described herein for designing integrated circuits or for configuring programmable chips to perform desired functions. That is, a computer-readable storage medium may be provided on which computer-readable program code in the form of an integrated circuit definition dataset is encoded, which, when processed (i.e., run) in an integrated circuit manufacturing system, configures the system to manufacture a ray tracing system configured to perform any of the methods described herein, or to manufacture a ray tracing system including any of the devices described herein. The integrated circuit definition dataset may be, for example, an integrated circuit description.

[0253] Therefore, a method for manufacturing a ray tracing system as described herein can be provided at an integrated circuit manufacturing system. Furthermore, an integrated circuit definition dataset can be provided, which, when processed in the integrated circuit manufacturing system, enables the method for manufacturing the ray tracing system to be executed.

[0254] Integrated circuit definition datasets can be in the form of computer code, such as as a netlist, code for configuring programmable chips, or as a hardware description language suitable for manufacturing at any level in integrated circuits, including as register-transfer level (RTL) code, as high-level circuit representations (such as Verilog or VHDL), and as low-level circuit representations (such as OASIS(RTM) and GDSII). Higher-level representations (such as RTL) that logically define hardware suitable for manufacturing in integrated circuits can be processed on a computer system configured to generate manufacturing definitions of integrated circuits within the context of a software environment that includes definitions of circuit elements and rules for combining these elements to generate the manufacturing definitions of the integrated circuits defined by the representation. As is typically the case where software executes at a computer system to define a machine, one or more intermediate user steps (e.g., providing commands, variables, etc.) may be required to configure the computer system to generate the manufacturing definitions of the integrated circuits, executing code that defines the integrated circuits in order to generate the manufacturing definitions of the integrated circuits.

[0255] Now regarding Figure 15 This describes an example of processing an integrated circuit definition dataset at an integrated circuit manufacturing system in order to configure the system for manufacturing a ray tracing system.

[0256] Figure 15An example of an integrated circuit (IC) manufacturing system 1502 is shown, configured to manufacture a ray tracing system as described in any example herein. Specifically, the IC manufacturing system 1502 includes a layout processing system 1504 and an integrated circuit generation system 1506. The IC manufacturing system 1502 is configured to receive an IC definition dataset (e.g., defining a ray tracing system as described in any example herein), process the IC definition dataset, and generate an IC (e.g., containing a ray tracing system as described in any example herein) based on the IC definition dataset. The processing of the IC definition dataset configures the IC manufacturing system 1502 to manufacture an integrated circuit containing a ray tracing system as described in any example herein.

[0257] The layout processing system 1504 is configured to receive and process an IC definition dataset to determine a circuit layout. Methods for determining a circuit layout based on an IC definition dataset are known in the art and may involve, for example, synthesizing RTL code to determine the gate-level representation of the circuit to be generated, for example, in relation to logic components (e.g., NAND, NOR, AND, OR, MUX, and FLIP-FLOP components). By determining the location information of the logic components, the circuit layout can be determined based on the gate-level representation of the circuit. This can be done automatically or with user intervention to optimize the circuit layout. Once the layout processing system 1504 has determined the circuit layout, it can output the circuit layout definition to the IC generation system 1506. The circuit layout definition may be, for example, a circuit layout description.

[0258] As is known in the art, IC generation system 1506 generates ICs according to a circuit layout definition. For example, IC generation system 1506 may implement a semiconductor device manufacturing process for generating ICs, which may involve a multi-step sequence of photolithography and chemical processing steps, during which electronic circuits are gradually formed on a wafer made of semiconductor material. The circuit layout definition may be in the form of a mask, which can be used in the photolithography process to generate ICs according to the circuit definition. Alternatively, the circuit layout definition provided to IC generation system 1506 may be in the form of computer-readable code, which IC generation system 1506 can use to form a suitable mask for generating ICs.

[0259] The various processes performed by the IC manufacturing system 1502 may all be implemented in one location, for example, by one party. Alternatively, the IC manufacturing system 1502 may be a distributed system, allowing some processes to be performed in different locations and by different parties. For example, some of the following stages may be performed in different locations and / or by different parties: (i) synthesizing RTL codes representing an IC definition dataset to form a gate-level representation of the circuit to be generated; (ii) generating a circuit layout based on the gate-level representation; (iii) forming a mask based on the circuit layout; and (iv) fabricating the integrated circuit using the mask.

[0260] In other examples, processing of an integrated circuit definition dataset at an integrated circuit manufacturing system can configure the system to manufacture a ray tracing system without processing the IC definition dataset to determine circuit layout. For example, an IC definition dataset can define the configuration of a reconfigurable processor, such as an FPGA, and processing of said dataset can configure the IC manufacturing system (e.g., by loading the configuration data into the FPGA) to generate a reconfigurable processor with the defined configuration.

[0261] In some embodiments, when processed in an integrated circuit manufacturing system, an integrated circuit manufacturing definition dataset can enable the integrated circuit manufacturing system to generate devices as described herein. For example, the integrated circuit manufacturing definition dataset, as described above, allows the integrated circuit manufacturing definition dataset to... Figure 15 The described method configures an integrated circuit manufacturing system to produce devices as described in this article.

[0262] In some examples, an integrated circuit definition dataset may contain software running on hardware defined at the dataset, or software running in combination with hardware defined at the dataset. Figure 15 In the example shown, the IC generation system can be further configured by the integrated circuit definition dataset to load firmware onto the integrated circuit according to the program code defined at the integrated circuit definition dataset during the manufacturing of the integrated circuit, or otherwise provide the integrated circuit with program code for use with the integrated circuit.

[0263] Compared to known implementations, implementations of the concepts set forth in this application in devices, apparatuses, modules, and / or systems (and in the methods implemented herein) can lead to performance improvements. Performance improvements may include one or more of increased computational performance, reduced latency, increased throughput, and / or reduced power consumption. Trade-offs can be made between performance improvements and physical implementations during the manufacture of such devices, apparatuses, modules, and systems (e.g., in integrated circuits), thereby improving manufacturing methods. For example, a trade-off can be made between performance improvements and layout area to match the performance of known implementations but using less silicon. This can be accomplished, for example, by reusing functional blocks serially or sharing functional blocks among elements of a device, apparatus, module, and / or system. Conversely, the concepts set forth in this application that lead to improvements in the physical implementations of devices, apparatuses, modules, and systems (such as reduced silicon area) can be traded off for performance improvements. This can be accomplished, for example, by manufacturing multiple instances of a module within a predefined area budget.

[0264] The applicant has independently disclosed each individual feature described herein, as well as any combination of two or more such features, to the extent that such features or combinations can be implemented based on the specification as a whole, in accordance with the common knowledge of those skilled in the art, regardless of whether such features or combinations of features solve any problem disclosed herein. In view of the foregoing description, those skilled in the art will understand that various modifications can be made within the scope of this invention.

Claims

1. A computer-implemented method of performing an intersection test in a ray tracing system, the method comprising: receiving a bundle of rays to be tested for intersection with a frame; identifying profile edges of a profile of the frame, wherein the profile of the frame is a 2D projection of the frame from a perspective of the bundle of rays, wherein each of the profile edges is a straight edge between two vertices of the profile of the frame; for each of the identified profile edges: obtaining components of a vector providing a boundary to the bundle of rays according to a type of intersection test performed, the vector being such that if the vector providing the boundary to the bundle of rays does not cross a side of the identified profile edge, then it is known that no ray of the bundle of rays crosses the side of the identified profile edge; and determining whether the vector crosses inside or outside of the profile edge, wherein if the vector crosses outside of the profile edge, then the vector does not cross within a perimeter of the profile of the frame; and using results of the determining whether the vector crosses inside or outside of the profile edge for each of the identified profile edges, determining an intersection test result of the bundle of rays with respect to the frame.

2. The method of claim 1, wherein, For each of the identified profile edges, the obtaining components of a vector includes obtaining components of a single vector providing a single boundary to the bundle of rays.

3. The method of claim 1 or 2, wherein, For each of the identified profile edges, the determining whether the vector crosses inside or outside of the profile edge for which the vector is the only vector for which it is determined whether the vector crosses inside or outside of the profile edge for the bundle of rays.

4. The method of claim 1 or 2, wherein the intersection test result of the bundle of rays with respect to the frame is determined using the results of the determining whether the vector crosses inside or outside of the profile edge for each of the identified profile edges without using any other results of determining whether any other vector crosses inside or outside of the profile edge.

5. The method of claim 1 or 2, wherein, For each of the identified profile edges, the vector provides an outside boundary to the bundle of rays with respect to the identified profile edge such that if the vector does not cross outside of the identified profile edge, then it is known that none of the rays of the bundle of rays cross outside of the identified profile edge.

6. The method of claim 5, wherein if it is determined for each of the identified profile edges that the vector crosses inside of the respective identified profile edge, then the intersection test result of the bundle of rays with respect to the frame is that all of the rays in the bundle of rays intersect the frame; and wherein if it is determined for one or more of the identified profile edges that the vector crosses outside of the respective identified profile edge, then the intersection test result of the bundle of rays with respect to the frame is not that all of the rays in the bundle of rays intersect the frame.

7. The method of claim 6, wherein if the intersection test result for the ray bundle with respect to the box is not that all of the rays in the ray bundle intersect the box, the method further comprises determining whether any of the rays in the ray bundle intersect the box.

8. The method of claim 1 or 2, wherein, For each of the identified contour edges, the vector provides an interior boundary to the ray bundle with respect to the identified contour edge such that if the vector does not pass inside the identified contour edge, it is known that none of the rays of the ray bundle pass inside the identified contour edge.

9. The method of claim 8, wherein if it is determined for each of the identified contour edges that the vector passes inside the respective identified contour edge, the intersection test result for the ray bundle with respect to the box is not that all of the rays in the ray bundle miss the box; and wherein if it is determined for one or more of the identified contour edges that the vector passes outside the respective identified contour edge, the intersection test result for the ray bundle with respect to the box is that all of the rays in the ray bundle miss the box.

10. The method of claim 9, wherein if the intersection test result for the ray bundle with respect to the box is not that all of the rays in the ray bundle miss the box, the method further comprises determining which of the rays in the ray bundle intersect the box.

11. The method of claim 1 or 2, further comprising: performing a direction check to determine whether the box is behind an origin of the ray bundle, wherein if the direction check determines that the box is behind the origin of the ray bundle, the intersection test result is that the ray bundle misses the box; and / or performing a distance check to determine whether the ray bundle terminates at a point in front of the box, wherein if the distance check determines that the ray bundle terminates at a point in front of the box, the intersection test result is that the ray bundle misses the box.

12. The method of claim 1, wherein all of the rays of the ray bundle have the same origin and wherein, For each of the identified contour edges, the determining whether the vector passes inside or outside the contour edge comprises performing a comparison according to: (p o,i -o i )d j <(p o,j -o j )d i where p o,i is an i-th component of a point on a first plane forming a first side of the frame of the contour edge, p o,j is a j-th component of a point on a second plane forming a second side of the frame of the contour edge, o i and o j are i-th and j-th components of the origin of the light rays of the light ray bundle, and d i and d j are i-th and j-th components of the obtained vector providing a boundary to the light ray bundle.

13. The method of claim 1, wherein not all of the rays of the bundle of rays have the same origin and wherein, For each of the identified contour edges, the determining whether the vector passes inside or outside the contour edge comprises performing a comparison according to: (p o,i -o i,[min,max] )d j <(p o,j -o j,[min,max] )d i where p o,i is an i-th component representing a point on a first plane forming a first side of the frame of the contour edge, p o,j is a j-th component representing a point on a second plane forming a second side of the frame of the contour edge, o i[min,max] is a minimum or maximum of an i-th component of the origin of the light rays of the light ray bundle, o j[min,max] is a minimum or maximum of a j-th component of the origin of the light rays of the light ray bundle, and d i and d j are the obtained i-th component and j-th component of the vector providing a boundary to the light ray bundle.

14. The method of claim 1 or 2, further comprising: receiving a ray; and constructing a ray bundle from the received ray to test for intersection with the box, wherein the constructing a ray bundle comprises grouping the received ray together based on a similarity of the received ray.

15. The method of claim 14, wherein the constructing a ray bundle comprises: maintaining a set of open ray bundles to which new rays can be added; and for each of the received rays: determining a similarity level of the received ray to each of the open ray bundles; based on the determined similarity levels, identifying, for the received ray, a best matching open ray bundle of the set of open ray bundles; and if the determined similarity level of the received ray to the best matching open ray bundle is above a threshold, adding the received ray to the best matching open ray bundle.

16. The method of claim 14, wherein either: The received rays that make up the ray bundle: (i) include new rays that have not previously been included in the ray bundle, but (ii) do not include rays that have previously been included in the ray bundle; or The received rays that make up the ray bundle include: (i) new rays that have not previously been included in the ray bundle, and (ii) rays that have previously been included in the ray bundle that has been deconstructed.

17. The method of claim 1 or 2, further comprising separating the ray bundle into individual rays if a separation metric is satisfied, wherein the separation metric is based on one or more of: a number of rays in the ray bundle; a spread of the rays in the ray bundle; a size of an area defined by the profile edges of the box; whether a source of the rays in the ray bundle is a frame shader or a ray shader; and data provided by the shader that created the rays in the ray bundle.

18. A ray tracing system, comprising: a tester module configured to receive a ray bundle to test for intersection with a box, wherein the tester module comprises: a set of one or more test blocks configured to perform an intersection test on a received ray bundle with respect to the box by: identifying profile edges of a profile of the box, wherein the profile of the box is a 2D projection of the box from a perspective of the ray bundle, wherein each of the profile edges is a straight edge between two vertices of the profile of the box; for each of the identified profile edges: obtaining components of a vector that provides a boundary to the ray bundle according to a type of intersection test performed, the vector being such that if the vector that provides the boundary to the ray bundle does not cross a side of the identified profile edge, then it is known that no ray of the ray bundle crosses the side of the identified profile edge; and determining whether the vector crosses inside or outside of the profile edge, wherein if the vector crosses outside of the profile edge, then the vector does not cross within a perimeter of the profile of the box; and using results of the determining whether the vector crosses inside or outside of the profile edge for each of the identified profile edges, determining an intersection test result of the ray bundle with respect to the box.

19. The ray tracing system of claim 18, wherein a test block of the set of one or more test blocks is configured to perform an intersection test on a ray bundle and to perform an intersection test on a single ray.

20. A computer readable storage medium having stored thereon an integrated circuit definition data set that, when processed in an integrated circuit manufacturing system, configures the integrated circuit manufacturing system to manufacture the ray tracing system of claim 18 or 19.

21. A computer readable storage medium having stored thereon computer program code for performing the method of any one of claims 1 to 17.

Citation Information

Patent Citations

  • Multi-view ray tracing using edge detection and shader reuse

    CN103348384A

  • Compressed ray direction data in a ray tracing system

    CN109087384A