Ray tracing device and method combined with directed distance field ray casting

By introducing directed distance field ray casting technology in hardware ray tracing, utilizing multi-step ray tracing algorithms and mesh SDF, the inefficiency of hardware ray tracing in complex geometries is solved, achieving more efficient ray tracing operations.

CN116338665BActive Publication Date: 2025-09-23SHANGHAI BIREN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310188321.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-01
Publication Date
2025-09-23
Estimated Expiration
2043-03-01

AI Technical Summary

Technical Problem

Existing hardware ray tracing technology is inefficient when processing complex geometries, especially when the triangle distribution of the geometry is unbalanced, resulting in slow iterative processing.

Method used

Combined with the signed distance field ray casting technology, by adding the mesh signed distance field information to the underlying acceleration structure, and using a multi-step ray tracing algorithm to approximate the intersection of light and the mesh surface, ray casting is performed using signed distance functions and mesh SDFs with different levels of detail.

Benefits of technology

It improves the efficiency of ray tracing, reduces the computational burden on complex scenes, and improves the speed and accuracy of ray tracing operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116338665B_ABST
    Figure CN116338665B_ABST
Patent Text Reader

Abstract

The present invention relates to a ray tracing device and method in combination with directed distance field ray casting, wherein the device comprises: a buffer; a construction setting circuit; and a ray casting circuit. The buffer stores a mesh directed distance field. The construction setting circuit establishes multiple bottom-level acceleration structures (BLAS) for multiple geometric bodies based on multiple sets of transformation data and attributes, adds information pointing to the mesh directed distance field in at least one of the BLAS, and stores the multiple BLAS in the buffer. The ray casting circuit traces rays in multiple steps according to a directed distance function under the mesh directed distance field for the BLAS that hits it, so as to approximate the intersection between the ray and the corresponding mesh surface. The present invention can improve the performance of ray tracing by adding information pointing to the mesh directed distance field in at least one BLAS and setting up the ray casting circuit as described above.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to ray tracing technology, and more particularly to a ray tracing device and method combined with Signed Distance Field (SDF-based ray marching). Background Art

[0002] In 3-dimensional computer graphics, ray tracing is a technique for modeling the transport of light, which can be used in various rendering algorithms to generate digital images. Since 2018, hardware acceleration for real-time ray tracing has become standard on newer commercial graphics cards, followed by the introduction of a graphics application programming interface (API) that allows developers to use hybrid ray tracing and rasterization-based rendering applications in games and other real-time applications. Ray tracing can simulate a variety of optical effects, such as reflections, refractions, soft shadows, scattering, depth of field, motion blur, defocusing, ambient occlusion, and dispersion. Summary of the Invention

[0003] In view of this, how to achieve efficient computing is an important issue for the ray tracing pipeline used in graphics processors.

[0004] The present invention relates to a ray tracing device incorporating directed distance field ray casting, comprising: a buffer; a configuration circuit; and a ray casting circuit. The buffer stores a mesh directed distance field. The configuration circuit establishes multiple bottom-level acceleration structures (BLAS) for multiple geometric bodies based on multiple sets of transformation data and attributes, adds information pointing to the mesh directed distance field to at least one BLAS, and stores the multiple BLASs in the buffer. The ray casting circuit traces rays in multiple steps based on a directed distance function under the mesh directed distance field for each BLAS hit, thereby approximating the intersection between the ray and the corresponding mesh surface.

[0005] The present invention also relates to a ray tracing method incorporating signed distance field ray casting, comprising: establishing multiple BLASs for multiple geometric bodies based on multiple sets of transformation data and attributes; adding information pointing to a mesh signed distance field in at least one BLAS; and tracing rays for the hit BLAS in multiple steps based on a signed distance function under the mesh signed distance field to approximate an intersection point between the ray and the corresponding mesh surface.

[0006] Each BLAS contains the axis-aligned bounding box of the mesh that makes up the scene, and the mesh's signed distance field contains a grid of points representing the closest distance to the surface of objects constructed from the mesh.

[0007] One of the advantages of the above embodiment is that the performance of ray tracing can be improved by adding information of the mesh-directed signed distance field and the configuration of the ray casting circuit in at least one BLAS as described above.

[0008] Other advantages of the present invention will be explained in more detail with reference to the following description and accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] The drawings described herein are used to provide further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application.

[0010] Figure 1 A block diagram of a hardware ray tracing pipeline configured in a graphics processing unit (GPU) according to some embodiments.

[0011] Figure 2 Schematic diagram of a bottom-level acceleration structure (BLAS) and a top-level acceleration structure (TLAS) in some implementations.

[0012] Figure 3 FIG. 1 is a schematic diagram of ray casting based on a signed distance field (SDF) in some embodiments.

[0013] Figure 4 FIG. 1 is a schematic diagram of SDF Level of Details (LODs) according to an embodiment of the present invention.

[0014] Figure 5 FIG. 4 is a block diagram of a ray tracing device incorporating directed distance field ray casting according to an embodiment of the present invention.

[0015] Figure 6 FIG. 4 is a flow chart of a method for constructing TLAS and BLAS and finding the intersection between a ray and the BLAS according to an embodiment of the present invention.

[0016] Figure 7 FIG. 4 is a flow chart of a method for performing SDF-based ray casting according to an embodiment of the present invention.

[0017] Among them, the brief description of the symbols in the accompanying drawings is as follows:

[0018] 110: Ray generation operation; 120: Acceleration structure traversal operation; 130: Detection operation; 140: Closest hit operation; 150: No hit operation; 160: Intersection operation; 170: Any hit operation; 210: Top-level acceleration structure; 230#0, 230#1, 230#2: Bottom-level acceleration structure; 250: Instance buffer; 260#0, 260#1, 260#2: Transformation and attribute buffer; 280: Vertex and index buffer; 310: Ray; 320: Intersection; 330: Wall surface; 41: Global signed distance field; 43: Mesh signed distance field group; 410, 411, 412: Global signed distance fields at different levels; 430, 4 31, 432: mesh signed distance field; 430#0, 430#1, 431#0, 431#1, 432#0, 432#1: mesh signed distance fields of different levels; 51: shader binding data table buffer; 51#1, 51#1: binding information; 52: shader buffer; 531: ray generation shader; 532: ray casting circuit; 533: judgment circuit; 535: no-hit shader; 536: closest-hit shader; 538: acceleration structure traversal circuit; 550: construction setup circuit; 56: mesh buffer; 560, 561, 562: mesh; S610-S640: method steps; S712-S780: method steps. DETAILED DESCRIPTION

[0019] The embodiments of the present invention will be described below with reference to the accompanying drawings. In these drawings, the same reference numerals represent the same or similar components or method flows.

[0020] It must be understood that the words "comprise", "include" and the like used in this specification are used to indicate the existence of specific technical features, values, method steps, job processing, components and / or components, but do not exclude the addition of more technical features, values, method steps, job processing, components, components, or any combination of the above.

[0021] The terms "first", "second", "third", etc. used in the present invention are used to modify the components in the claims and are not used to indicate a priority order, a precedence relationship, or that one component precedes another, or a temporal sequence in executing method steps. They are only used to distinguish components with the same name.

[0022] It should be understood that when a component is described as being "connected" or "coupled" to another component, it can be directly connected or coupled to the other component, and intervening components may be present. Conversely, when a component is described as being "directly connected" or "directly coupled" to another component, there are no intervening components. Other words used to describe the relationship between components should be interpreted in a similar manner, for example, "between" versus "directly between," or "adjacent" versus "directly adjacent," etc.

[0023] Ray tracing is a rendering technology that simulates physical phenomena. It simulates the behavior of light in a medium to produce more realistic image output than raster rendering technology. It simulates light from the human eye (or camera), projects light into the scene, tries to find the path to reach the objects in the scene after passing through various optical reactions, and calculates the accumulated color. Figure 1The hardware ray tracing pipeline, implemented in a graphics processing unit (GPU) in some embodiments, is shown. A programmer or visual artist can use an intermediate application to mathematically describe the scene being ray traced. The application can associate objects in the scene with specific shaders, defining things like material parameters and intersection logic for those objects. Rays generated by ray generation operation 110 are tested for intersection with some portion of all objects in the scene in decision operation 130. Rays may hit any object in the scene, invoking a specific shader. Once the closest object is found in closest hit operation 140, the algorithm estimates the incoming ray at the intersection point, examines the object's material properties, and combines this information to calculate the final color of its pixel. Certain illumination algorithms and reflective or translucent materials may require ray generation operation 110 to generate additional rays and recast them into the scene. In acceleration structure traversal operation 120, the ray tracing technology searches for objects intersected by the ray using a data structure built from the entire scene information, called an acceleration structure (AS). The acceleration structure is organized into a Binary Volume Bounding (BVH) Hierarchy, divided into a Top-Level Acceleration Structure (TLAS) and a Bottom-Level Acceleration Structure (BLAS). The BLAS, at the lower level, contains the Axis-Aligned Bounding Boxes (AABBs) of the triangles or custom geometry (e.g., meshes) that make up the scene. Each BLAS can access multiple sets of geometry of a specific type. The TLAS contains references to a set of BLASs, each containing shading and transformation information. A BLAS can only be used when referenced by a TLAS. Shaders access the TLAS as description bindings. As the traversal progresses, when a ray intersects an object, the intersection operation 160 automatically executes the corresponding shader. During the traversal, if required by the tracing and acceleration structures, the applied shading code in the intersection operation 160 and the shaders in any hit operations 170 control how the traversal is performed. When the traversal is complete, the miss shader may be called in a miss operation 150 , or the closest hit shader may be called in a closest hit operation 140 .The different shader stages use ray payload structures that run between all traversal stages and ray attribute structures obtained from the traversal control shader to pass parameters and results.

[0024] refer to Figure 2 Schematic diagram of the BLAS and TLAS shown. TLAS 210 consists of instances stored in instance buffer 250, which reference BLASs 230#0, 230#1, and 230#2. Each BLAS contains actual vertex and index data stored in vertex and index buffer 280, encapsulated into geometry along with AABBs. Each instance in TLAS 210 references not only transformation data but also shading information for material data retrieved from the Shader Binding Table (SBT), which describes how the shader program connects the corresponding surface material data to the intersecting geometry. Based on the transformation data and attributes stored in corresponding ones of transformation and attribute buffers 260#0 to 260#2, a single BLAS can be created for one or more triangles. Ray tracing is performed using multiple iterations for multiple triangles using a ray-triangle intersection procedure. This architecture allows the same BLAS to be inserted into the TLAS multiple times when creating instances of an aggregate, with each BLAS associated with a different transformation matrix.

[0025] To detect whether a ray intersects a triangulated mesh, the Hardware Ray Tracing (HWRT) pipeline needs to traverse all triangles in the mesh and test each individual triangle against the ray. Because a ray may intersect multiple triangles in the mesh, the HWRT pipeline tracks the nearest intersection distance as it traverses the triangles. However, the HWRT pipeline is slow to iterate for each BLAS, especially when the geometry in the scene has an unbalanced triangle distribution. For example, a few geometries may have hundreds of times more triangles than other geometries. To reduce the impact of the HWRT pipeline's shortcomings, an embodiment of the present invention proposes integrating a signed distance field (SDF) based ray marching technique into the HWRT pipeline to replace the iterations in the HWRT pipeline's BLAS to find triangle intersections. Although the description describes the shortcomings of the above-mentioned embodiments, this is only the original inspiration for the invention embodiments described below. Those skilled in the art may apply these technical solutions to solve other technical problems or apply them to other technical environments, and the present invention should not be limited thereby.

[0026] refer to Figure 3 An example of SDF-based ray casting is shown. SDF-based ray casting traces ray 310 in multiple steps based on a signed distance function and an SDF to approach the intersection point 320 between ray 310 and wall surface 330. Each iteration evaluates the signed distance function with the appropriate SDF to advance the ray 310 to the maximum distance possible without missing any parts of the surface. The SDF contains grid points representing the closest distance to the surface of the object constructed using the grid, where negative values ​​represent points inside the object and positive values ​​represent points outside the object. When the point reached is very close to the wall surface 330, a threshold is used as a qualifier to cancel further iterations. The SDF-based ray casting algorithm is not limited to casting onto opaque surfaces. When casting onto transparent surfaces, an accumulated opaque factor is recorded, and each intersection contributes to this factor. If this factor reaches 1.0, the casting ends; otherwise, the casting continues and accumulates the transparency of each intersected surface. Opaque surfaces contribute a factor of 1.0, while transparent surfaces contribute a factor between 0.0 and 1.0. The efficiency of SDF-based ray casting algorithms is less affected by the local complexity of the scene. Furthermore, in general, the complexity of finding the intersection point between a ray and a triangle in a geometry using ray tracing is higher than the complexity of finding the intersection point between a ray and an object plane in the same geometry using ray casting based on its SDF.

[0027] To improve the computational speed of ray casting, in some embodiments, SDF can be divided into global SDF and mesh SDF. Global SDF is used in distant scenes, while mesh SDF is used in closer scenes. Regardless of global SDF or mesh SDF, each SDF can contain multiple levels of details (LOD). The lower the level of LOD, the less voxels the SDF contains. Figure 4Schematic diagram of SDF LODs shown. Global SDF 41 contains different LODs such as level 0 410, level 1 411, and level 2 412. It is used in distant scenes to allow the ray casting algorithm to find the intersection with the plane with only one pass at the optimal SDF LOD. Distant scenes are those where the distance between the light source and the corresponding geometry is greater than or equal to the distant threshold. In closer scenes, a mesh SDF is provided for each geometry. For example, mesh SDF group 43 contains multiple mesh SDFs 430, 431, and 432. Mesh SDF 430 contains different LODs such as level 0 430#0 and level 1 430#1. Mesh SDF 431 contains different LODs such as level 0 431#0 and level 1 431#1, and so on. Closer scenes are those where the distance between the light source and the corresponding geometry is less than the distant threshold. The ray casting algorithm can use multiple iterations to find the intersection of the ray and the plane for a specific geometry. In each iteration, a suitable LOD is selected from the SDF corresponding to this geometry for calculation.

[0028] refer to Figure 5 A block diagram of a ray tracing device combined with directed distance field ray casting. This device is set in the graphics processor. TLAS and BLAS are also organized as a BVH hierarchy for quickly searching which BLAS intersects a specific ray. The mesh buffer 56 stores information for constructing meshes 560, 561, and 562 for TLAS and BLAS, where a mesh can represent a geometric body composed of multiple triangles. The construction setup circuit 550 composes the instances stored in the instance buffer 250 into TLAS 210, allows the instances in TLAS 210 to reference BLAS 230#0, 230#1, and 230#2, and stores TLAS 210 in the AS buffer (not shown). Figure 5 ). The construction setup circuit 550 also establishes BLAS 230#0, 230#1 and 230#2 for multiple geometries based on the transformation data and attributes stored in the transformation and attribute buffers 260#0 to 260#2 for meshes 560 to 562, respectively, and stores the BLAS 230#0, 230#1 and 230#2 in the AS buffer. However, the construction setup circuit 550 does not associate the BLAS 230#0, 230#1 and 230#2 with the actual vertex and index data of the geometry. The BLAS 230#0, 230#1 and 230#2 generated by the construction setup circuit 550 also includes information pointing to the mesh SDF LODs 430, 431 and 432, respectively. The mesh SDF LODs 430, 431 and 432 are stored in the SDF buffer (not shown). Figure 5). After hitting one or more BLASs, the entire process switches from the ray tracing program to the ray casting program, which is used to perform a specific ray casting algorithm (e.g., sphere tracing) for each BLAS hit using the mesh SDF LOD it points to. For example, the construction setup circuit 550 requires the data structure "D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS" as input and uses the data structure "D3D12_RAYTRACING_GEOMETRY_DESC" to receive the geometry data. An example of the data structure "D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS" is as follows:

[0029]

[0030]

[0031] An example of the data structure "D3D12_RAYTRACING_GEOMETRY_DESC" is as follows:

[0032] When constructing BLAS, the construction setup circuit 550 needs to reference one or more entries for SDFs in the union of the data structure "D3D12_RAYTRACING_GEOMETRY_DESC". An example of a data structure "D3D12_RAYTRACING_GEOMETRY_SDFS_DESC" that references an entry is as follows: typedef struct D3D12_RAYTRACING_GEOMETRY_SDFS_DESC

[0033] {

[0034] D3D12_GPU_VIRTUAL_ADDRESS Transform3x4;

[0035] DXGI_FORMAT VoxelFormat;

[0036] UINT VoxelWidth;

[0037] UINT VoxelHeight;

[0038] UINT VoxelDepth;

[0039] D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE VoxelBuffer;

[0040] }

[0041] The data structure "D3D12_RAYTRACING_GEOMETRY_SDFS_DESC" contains information such as the format of the voxels in the SDF, width (that is, the number of units on the X axis), height (that is, the number of units on the Y axis), and depth (that is, the number of units on the Z axis).

[0042] The shader buffer 52 can store the program codes of the ray generation shader 531, the miss shader 535, the closest hit shader 536, etc. written by the programmer. The SBT buffer 51 stores a plurality of binding information 51#0, 51#1, etc., corresponding to the ray generation shader 531, the miss shader 535, the closest hit shader 536, etc. The binding information of the closest hit shader 536 describes how to connect the corresponding surface material data on the intersecting geometry. The processor in the pipeline (not shown) Figure 5 ) loads and executes the corresponding program code of the ray generation shader 531, generating rays for projection into the scene. The ray casting circuit 532 is configured to implement a ray casting algorithm based on a signed distance field. It traces rays in multiple steps according to a signed distance function at multiple different levels of Level of Observation (LOD) to approximate the intersection point between the ray and the surface of an object. The determination circuit 533 determines whether the ray generated by the ray generation shader 531 intersects with some portion of all objects in the scene after being calculated by the ray casting circuit 532. If so, the processor in the pipeline loads and executes the appropriate program code of the closest hit shader 536, which estimates the incoming ray at the intersection point, checks the material properties of the geometry, and combines this information to calculate the final color of the pixel at the intersection point. If not, the processor in the pipeline loads and executes the appropriate program code of the non-hit shader 535 to complete the task specified by the programmer. The acceleration structure traversal circuit 538 is configured to traverse the AS composed of the TLAS and BLAS to search for objects intersected by the ray. The processor can be implemented in various ways, such as using general-purpose hardware (eg, a single processor, multiple processors with parallel processing capabilities, or other processors with computing capabilities), and provides specific functionality when executing instructions from various shaders.

[0043] refer to Figure 6 The flowchart shown is used to construct TLAS and BLAS, and find the intersection between rays and BLAS. The detailed steps are as follows:

[0044] Step S610: The acceleration structure traversal circuit 538 determines whether there are any unprocessed TLAS. If so, the process continues with step S612. Otherwise, the entire process ends.

[0045] Step S612 : the acceleration structure traversal circuit 538 sets the content in the TLAS 210 .

[0046] Step S616 : The determination circuit 533 attempts to find the intersection between the ray and the bounding box in the TLAS 210 using a known intersection algorithm.

[0047] Step S618: The determination circuit 533 determines whether there is an intersection between the ray and the AABB in the TLAS 210. If yes, the process continues with the processing of step S620; otherwise, the process continues with the processing of step S610.

[0048] Step S620: The acceleration structure traversal circuit 538 enters BLAS processing.

[0049] Step S630: The acceleration structure traversal circuit 538 uses a known traversal algorithm to determine whether there are any unprocessed BLAS. If so, the process continues with step S632. Otherwise, the entire process ends.

[0050] Step S632: The acceleration structure traversal circuit 538 sets the content in the next BLAS.

[0051] Step S636 : The determination circuit 533 attempts to find the intersection between the ray and the AABB in the set BLAS using a known intersection algorithm.

[0052] Step S638: The determination circuit 533 determines whether there is an intersection between the ray and the AABB in the set BLAS. If yes, the process continues to step S640; otherwise, the process continues to step S630.

[0053] The detailed technical details of steps S610 to S638 described above are substantially the same as the operation of a conventional HWRT pipeline and are not further described for the sake of brevity.

[0054] Step S640: The process enters the SDF-based ray casting process.

[0055] refer to Figure 7 The method flow chart shown is used to perform ray casting based on SDF. The detailed steps are as follows:

[0056] Step S712: The ray casting circuit 532 loads the distance field bounding data. An example of the data structure of the distance field bounding data is as follows:

[0057]

[0058] Step S716 : The determination circuit 533 attempts to find the intersection between the ray and the AABB in the set BLAS using a known intersection algorithm.

[0059] Step S720: The determination circuit 533 determines whether there is an intersection between the ray and the AABB in the set BLAS. If yes, the process continues to step S722; otherwise, the entire process ends.

[0060] Step S722: The ray casting circuit 532 increases the advance count by 1. The ray casting circuit 532 may include an advance count register for storing the current advance count associated with the hit BLAS. In step S640, the advance count is initially 0.

[0061] Step S730: The ray casting circuit 532 determines whether the forward step count is less than the maximum forward step count MaxStep. If so, the process continues with step S732; otherwise, the entire process ends. The ray casting circuit 532 may include a maximum forward step count register for storing the maximum forward step count MaxStep.

[0062] Step S732: The ray casting circuit 532 may use a directed distance function to calculate the step distance based on the SDF referenced in the union of the hit BLAS and the level selected therein. When calculating the step distance for the first time, the ray casting circuit 532 may perform the calculation based on the SDF of the default level. Assuming that the hit BLAS is 230#0, the mesh SDF 430 includes three levels of LODs 430#0, 430#1, and 430#2, and the default level is the middle level: the ray casting circuit 532 may perform the calculation based on the mesh SDF LOD 430#1.

[0063] The ray casting circuit 532 may further include a small step threshold register and a large step threshold register, respectively configured to store a small step threshold and a large step threshold, wherein the large step threshold is higher than the small step threshold.

[0064] Step S750: The ray casting circuit 532 determines whether the step distance is less than the small step threshold. If so, the process continues with step S752; otherwise, the process continues with step S760.

[0065] Step S752 : The ray casting circuit 532 selects the finest SDF LOD for the next step.

[0066] Step S760: The ray casting circuit 532 determines whether the step distance is greater than the stride threshold. If so, the process continues with step S762; otherwise, the process continues with step S770.

[0067] Step S762 : The ray casting circuit 532 selects the coarsest SDF LOD for the next step.

[0068] Step S770: The ray casting circuit 532 determines whether the distance to the intersection point is less than a proximity threshold. If so, the process continues with step S772; otherwise, the process continues with step S780. The ray casting circuit 532 may include a proximity threshold register for storing the proximity threshold.

[0069] Assuming the hit BLAS is 230#0, mesh SDF 430 includes three levels of LODs 430#0, 430#1, and 430#2, with LOD 430#0 being the coarsest LOD, LOD 430#1 being the middle LOD, and LOD 430#2 being the finest LOD: in step S752, ray casting circuit 532 may select SDF LOD 430#2 as the next LOD. In step S762, ray casting circuit 532 may select SDF LOD 430#0 as the next LOD. In step S772, ray casting circuit 532 may select SDF LOD 430#1 as the next LOD.

[0070] Step S780: Write the intersection data to the carrier. In some embodiments, the intersection data may include the location of the intersection. In other embodiments, the intersection data may include the values ​​required in the result data structure, including the location of the intersection and other information. An example of the result data structure is as follows:

[0071]

[0072] Although Figure 5 The components described above are included in the invention, but it does not exclude the use of more additional components to achieve better technical effects without violating the spirit of the invention. Figure 6 、 Figure 7The flowchart is executed in the specified order. However, those skilled in the art may modify the order of the steps without violating the spirit of the invention, provided that the same effect is achieved. Therefore, the present invention is not limited to the sequence described above. Furthermore, those skilled in the art may also combine several steps into one step, or perform more steps sequentially or in parallel in addition to the steps described above, and the present invention should not be limited thereby.

[0073] The above description is only a preferred embodiment of the present invention, but it is not intended to limit the scope of the present invention. Anyone familiar with this technology can make further improvements and changes on this basis without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be based on the scope defined by the claims of this application.

Claims

1. A ray tracing device incorporating distance field ray casting, provided in a graphics processor, characterized in that: include: A buffer storing a grid signed distance field, wherein the grid signed distance field comprises grid points representing the closest distance to a surface of an object constructed using the grid; Constructing a setup circuit, coupled to the buffer, to establish a plurality of bottom-level acceleration structures (BLAS) for a plurality of geometric bodies based on a plurality of sets of transformation data and attributes, to add information pointing to the mesh signed distance field in at least one of the BLAS, and to store the plurality of BLAS in the buffer, wherein each BLAS includes an axis-aligned bounding box of a mesh constituting the scene; and a ray casting circuit coupled to the buffer, configured to trace a ray in a plurality of steps according to a signed distance function under the mesh signed distance field for hitting an underlying acceleration structure, so as to approximate an intersection point between the ray and a corresponding mesh surface, wherein the mesh signed distance field comprises a plurality of levels of mesh signed distance fields, a higher level mesh signed distance field comprising more voxels than a lower level mesh signed distance field; The ray casting circuit selects one of the grid directed distance fields of the plurality of levels according to the calculated step distance in one advance as a reference grid directed distance field for the next advance, The ray casting circuit selects a highest-level mesh signed distance field when the step distance is less than a small-step threshold; selects a lowest-level mesh signed distance field when the step distance is greater than a large-step threshold; and selects an intermediate-level mesh signed distance field when the step distance is greater than or equal to the small-step threshold and the step distance is less than or equal to the large-step threshold, wherein the large-step threshold is greater than the small-step threshold.

2. The ray tracing device incorporating directed distance field ray casting according to claim 1, wherein: The construction setup circuitry does not associate each of the underlying acceleration structures with vertex and index data for geometry.

3. The ray tracing device incorporating directed distance field ray casting according to claim 1, wherein: The grid signed distance field includes a global signed distance field and a grid signed distance field, the global signed distance field includes multiple first-level global signed distance fields, a higher first-level global signed distance field includes more voxels than a lower first-level global signed distance field, and the grid signed distance field includes multiple second-level grid signed distance fields, a higher second-level grid signed distance field includes more voxels than a lower second-level grid signed distance field: The ray casting circuit selects one from the plurality of first-level global signed distance fields in a first scene to calculate a first step distance, and selects one from the plurality of second-level mesh signed distance fields according to the calculated second step distance in a forward movement of a second scene as a reference mesh signed distance field for a next forward movement, wherein the first scene refers to a scene in which a distance between a light source and a corresponding geometric body is greater than or equal to a threshold, and the second scene refers to a scene in which a distance between the light source and the corresponding geometric body is less than a threshold.

4. The ray tracing device incorporating directed distance field ray casting according to claim 1, wherein: Also includes: An acceleration structure traversal circuit traverses an acceleration structure consisting of a top-level acceleration structure (TLAS) and the plurality of bottom-level acceleration structures to find the bottom-level acceleration structure that intersects the ray, wherein the top-level acceleration structure and the plurality of bottom-level acceleration structures are organized into a binary volume boundary hierarchy.

5. The ray tracing device incorporating directed distance field ray casting according to claim 4, wherein: The top-level acceleration structure contains references to a set of bottom-level acceleration structures, and each reference contains shading and transformation information.

6. The ray tracing device incorporating directed distance field ray casting according to claim 1, wherein: Also includes: A processor is configured to, upon finding the intersection point between the ray and the corresponding mesh surface, load and execute program code of a closest-hit shader for evaluating the incoming ray at the intersection point, examining the material properties of the geometry, and calculating a final color of the pixel at the intersection point accordingly.

7. A ray tracing method incorporating directed distance field ray casting, characterized in that: include: Creating multiple bottom-level acceleration structures (BLAS) for the multiple geometric bodies based on the multiple sets of transformation data and attributes, wherein each BLAS contains an axis-aligned bounding box of a mesh constituting the scene; Incorporating information pointing to a mesh signed distance field into at least one of the underlying acceleration structures, wherein the mesh signed distance field comprises grid points representing the closest distance to a surface of an object constructed using the mesh; and The underlying acceleration structure for hitting the mesh is traced in multiple steps according to the signed distance function under the mesh signed distance field to approximate the intersection between the ray and the corresponding mesh surface, The grid signed distance field includes multiple levels of grid signed distance fields, and a higher level grid signed distance field includes more voxels than a lower level grid signed distance field. The method further comprises: In one advance, one of the grid directed distance fields is selected from the plurality of levels according to the calculated step distance as a reference grid directed distance field for the next advance; When the step distance is less than the small step threshold, selecting the highest level grid signed distance field; When the step distance is greater than a large step threshold, selecting a lowest level grid signed distance field; and When the step distance is greater than or equal to the small step threshold and the step distance is less than or equal to the large step threshold, selecting a grid signed distance field of an intermediate level, The large-step threshold is greater than the small-step threshold.

8. The ray tracing method in combination with directed distance field ray casting according to claim 7, wherein: Each of the underlying acceleration structures cannot be associated with vertex and index data of geometry.

9. The ray tracing method in combination with directed distance field ray casting according to claim 7, wherein: The grid signed distance field includes a global signed distance field and a grid signed distance field, the global signed distance field includes a plurality of first-level global signed distance fields, a higher first-level global signed distance field includes more voxels than a lower first-level global signed distance field, the grid signed distance field includes a plurality of second-level grid signed distance fields, a higher second-level grid signed distance field includes more voxels than a lower second-level grid signed distance field, The method further comprises: selecting one from the plurality of first-level global signed distance fields in a first scene to calculate a first step distance; and In one advance of the second scene, one is selected from the plurality of second-level grid directed distance fields according to the calculated second step distance as a reference grid directed distance field for the next advance. The first scene refers to a scene in which the distance between the light source and the corresponding geometric body is greater than or equal to a threshold, and the second scene refers to a scene in which the distance between the light source and the corresponding geometric body is less than a threshold.

10. The ray tracing method in combination with directed distance field ray casting according to claim 7, wherein: Also includes: An acceleration structure consisting of a top-level acceleration structure (TLAS) and the plurality of bottom-level acceleration structures is traversed to find the hit bottom-level acceleration structure intersected by the ray, wherein the top-level acceleration structure and the plurality of bottom-level acceleration structures are organized into a binary volume boundary hierarchy.

11. The ray tracing method in combination with directed distance field ray casting according to claim 10, wherein: The top-level acceleration structure contains references to a set of bottom-level acceleration structures, and each reference contains shading and transformation information.

12. The ray tracing method in combination with directed distance field ray casting according to claim 7, wherein: Also includes: After finding the intersection point between the ray and the corresponding mesh surface, the incoming ray at the intersection point is evaluated, the material properties of the geometry are checked, and the final color of the pixel at the intersection point is calculated accordingly.

Citation Information

Patent Citations

  • Multi-camera combined rapid ray tracing method, system and application

    CN113240785A

  • Processing equipment and processing method of ray tracing acceleration structure

    CN115222868A