Data compression and decompression method and system in ray tracing

By compressing and decompressing displacement information data, and combining hardware units and graphics processing units, the ability to adjust geometric resolution in real time in a ray tracing system was realized, solving the problems of rendering quality and computational cost in existing technologies, and improving rendering efficiency and quality.

CN118628591APending Publication Date: 2024-09-10IMAGINATION TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410260422.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-03-08
Filing Date
2024-03-07
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing ray tracing systems cannot dynamically adjust geometric resolution in real time, resulting in decreased rendering quality and increased computational costs when the scene changes. Furthermore, tessellation methods in ray tracing have high storage and update costs and are difficult to be compatible with real-time dynamic changes.

Method used

By compressing and decompressing displacement information data, the geometric resolution is adjusted in real time in the ray tracing system using tessellation technology. A compressed dataset is used to represent the mipmap of texture pixel data sampling, and the displacement information is encoded as a single value. The intersection test and tessellation process between rays and patches are performed in combination with hardware units and graphics processing units.

Benefits of technology

It enables real-time adjustment of geometric resolution in ray tracing systems, reducing computational costs and storage requirements, improving rendering quality and efficiency, and avoiding rendering artifacts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628591A_ABST
    Figure CN118628591A_ABST
Patent Text Reader

Abstract

Methods and systems for data compression and decompression in ray tracing. A method of compressing data representing displacement information in a ray tracing system is provided, wherein the displacement information indicates a displacement to be applied to a geometry in a scene rendered by the ray tracing system. The method includes: detecting a pair of data sets representing displacement information, where a first data set of the data sets includes a first array of values and a second data set of the data sets includes a second array of values; values are detected from corresponding array positions of the first array and the second array, wherein the detected values form a pair of values representing upper and lower limits of displacement values of the corresponding array positions. The method includes identifying which of a plurality of predetermined conditions a pair of values satisfies; and encoding the pair of values as a single value in the compressed data set, wherein the single value represents the identified predetermined condition.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to UK patent application GB2303377.2 filed on March 8, 2023 and UK patent application GB2303378.0 filed on March 8, 2023, the entire contents of which are incorporated herein by reference. Technical Field

[0003] The present disclosure relates to techniques for performing data compression and decompression for use in ray tracing systems. Background Art

[0004] Ray tracing is a computational rendering technique for generating an image of a scene (e.g., a 3D scene) by tracing light paths ("rays") through the scene, typically from the perspective of a camera. Rays are often traced toward a light source (e.g., a shadow ray), but are typically traced toward the (underlying) scene geometry. For example, a primary ray is modeled as originating from a camera and entering the scene through a pixel. As a ray traverses the scene, it may intersect objects within the scene and may spawn more rays. The intersections between rays and objects can be modeled to create realistic visual effects.

[0005] Rendering an image of a scene using ray tracing may involve performing a large number of intersection tests, such as performing billions of intersection tests. The objects themselves are typically represented using multiple polygonal 2D surfaces, whose atomic elements are typically referred to as "primitives" (e.g., triangles). Thus, intersection testing involves the interaction between rays and the primitives used to represent the objects. However, it is generally not necessary or helpful to perform exhaustive intersection testing of each ray for each primitive in the scene.

[0006] In order to reduce the number of intersection tests that need to be performed, the ray tracing system can generate an acceleration structure, wherein each node of the acceleration structure represents an area within the scene. The acceleration structure is usually hierarchical (e.g., having a tree structure), so that it includes multiple node levels, wherein the nodes near the top of the acceleration structure represent larger areas in the scene (e.g., the root node can represent the entire scene), and the nodes near the bottom of the acceleration structure represent smaller areas in the scene. "Tree node" refers to a node with a pointer to other nodes in the hierarchical acceleration structure, that is, the tree node has child nodes in the hierarchical acceleration structure. "Leaf node" generally refers to a node with one or more pointers to one or more primitives, that is, the leaf node does not have child nodes in the hierarchical acceleration structure. In some examples, a leaf node may simply refer to a primitive or a list of primitives. In other words, the leaf node of the acceleration structure represents an area in the scene that defines one or more primitives. The acceleration structure may have different structures in different examples, such as a grid structure, an octree structure, a space partitioning structure (e.g., a kd tree), or a hierarchical bounding volume structure. A node may represent a suitable shape or area (which may be referred to as a "box" in this article) in the scene. In some examples, the nodes represent axis-aligned bounding boxes (AABBs), or oriented bounding boxes (OBBs) in the scene. The overall hierarchy of acceleration structures may be referred to as a bounding volume hierarchy (BVH), or more generally an acceleration structure (AS).

[0007] The number of primitives that make up an object determines the geometric level of detail (LOD) of that object in the scene. In ray tracing systems, the geometric LOD is typically fixed relative to a series of consecutive frames, because the geometric resolution of the scene (and therefore the number of primitives used to represent the object) must be known in advance in order to calculate the topology of the acceleration structure. Known ray tracing systems are unable to dynamically readjust the geometric resolution in real time (i.e., every frame). One reason for this is that the acceleration structures that are typically used to make real-time ray tracing easy to perform limit the geometric LOD of objects within the structure.

[0008] Known methods for adapting acceleration structures in response to changes in geometric LOD in a ray tracing scheme are "refitting" and "rebuilding". During refitting, the sizes of volumes and bounding boxes within the AS are changed. In practice, this involves changing the shape / volume / position of regions associated with nodes in the AS, e.g., the location of a "split plane", or the extent of a bounding volume in a BVH. The results of the refitting are selected to reduce the number of ray primitives or ray box intersection tests. After refitting, the topology and node structure of the AS are unchanged, so in particular, the refitting is to maintain the same number of nodes.

[0009] During reconstruction, the entire acceleration structure is rebuilt. For example, reconstruction can be performed while applying new heuristics to generate AS, or previous heuristics can be reapplied to reflect changes in geometric resolution. Therefore, reconstruction can also be performed in response to changes within the scene, such as changes in the geometric LOD of one or more models in the scene (for example, due to a decrease in the viewing distance to the object). Rebuilding part or all of the AS node structure based on a dynamic scene can be costly, and most GPU hardware is typically unable to perform a reconstruction for each frame. Another method known in ray tracing to change the geometric LOD via changes in the texture LOD is "tessellation-free displacement mapping."

[0010] A common way to organize an AS is to implement a (single) high-level AS called a top-level acceleration structure (TLAS), which may contain one or more "instances" of (one or more) objects, each defined using a second AS called a low-level acceleration structure (BLAS). The geometry defined in the TLAS is typically represented in "world space", and the geometry contained in one or more BLASs is typically represented in "instance space" (also called object space). The TLAS and one or more BLASs together constitute an AS. This is a convenient way to store objects in world space, for example, because multiple versions of the same object can be included by inserting pointers to the same BLAS in different locations (optionally applying different transformation matrices). The leaf nodes of a TLAS typically contain a pointer to a single BLAS. Therefore, the leaf nodes of a TLAS can be "instance transformation nodes", i.e. nodes that require a spatial coordinate transformation from world space to instance space. Therefore, partial reconstruction and partial re-adaptation are possible, for example, where only a subset of the BLAS is rebuilt / re-adapted (also resulting in reconstruction / re-adaptation of the TLAS). However, (partial) refitting and (partial) reconstruction approaches can lead to problems with geometry LOD changes, e.g. objects appearing to "bounce" when their geometry resolution suddenly changes due to changes in the LOD model. Tessellation-free displacement mapping suffers from the fact that watertight rendering cannot be guaranteed in various use cases and is also very dependent on efficient texture sampling.

[0011] In contrast, there are techniques in rasterization schemes that dynamically change the geometric LOD (i.e., every frame). Rasterization involves defining an observation window of a 3D scene containing geometric shapes, and generating a 2D pixel array to be rendered from the 3D scene from the observation window. In most rasterization methods, the rasterized image is generated by a model including triangular primitives. Higher geometric LODs require more primitives, which are usually smaller in size. Increasing the geometric LOD is beneficial in cases where the primitives of the rasterized scene cover too many screen pixels. For example, if an object in the scene is rendered at a closer (virtual) distance, the straight edges of the primitives used to represent the surface of the object may become discernible, and thus give the object a jagged appearance. This can be solved by "tessellation" (in this case, meaning "subdivision") of the triangular primitives (or some other basic polygonal primitives, such as quadrilateral primitives) that make up the object to generate a fine grid of (usually triangular) primitives, and thus better approximate the appearance of a smooth surface. Any tessellated surface is usually an approximation of the original surface, but the accuracy of this approximation can be improved by increasing the number of primitives generated, which in turn usually results in smaller primitives. The amount of tessellation / tessellation is usually determined by the geometry LOD at some granularity (e.g., per scene, object / model, face, edge, vertex, material, texture, etc.). However, using a greater number of triangles increases the amount of processing required to render the scene.

[0012] The tessellation (i.e., subdivision) of the surface of an object is performed on basic / atomic segments of the surface called "patches". Patches can be polygonal. For example, a patch can be a square, a rectangle (or a general quadrilateral, such as a trapezoid, a parallelogram, or a rhombus), or a triangle. Although polygonal patches are represented as planes in any space (e.g., world, instance / model / object, view, etc.), the intention may be to curve the tessellated patch to accurately map the surface of the represented object, for example by applying a displacement map to it to form a higher-order surface. However, the subdivision itself is not performed in a 3-dimensional space (e.g., world, instance / model / object, view, etc.) because this is computationally inefficient. Instead, tessellation is performed in a 2-dimensional space, i.e., in the domain of the patch (where the patch is planar). This 2D space can be defined in terms of (u,v) parameters and is referred to as a "parameter space" or "domain space". Non-tessellated patches typically occupy a normalized region in the 2D domain space, such as the set [0,1] in the case of a quadrilateral patch. 2 This facilitates computational simplification (e.g., by utilizing fixed-point arithmetic). Thus, the tessellation process can be performed independently of any expected curvature present in the final displaced surface. Tessellation in a rasterization scheme can be performed in advance, or can be performed in real time (e.g., on a per-frame basis to provide continuously varying or view-dependent levels of detail). Suitable tessellation methods are described in detail in the disclosure below.

[0013] However, ray tracing methods are generally not compatible with real-time (i.e., online / dynamic), e.g., frame-by-frame, geometric LOD updates to scene geometry. In part, this is because the surfaces used in ray tracing and their inherent acceleration structures require a large amount of memory, which would make tessellation of the entire surface and necessarily updating the AS in real time infeasible. In other words, in ray tracing, the input surface is pre-tessellated at the desired geometric resolution before the acceleration structure is generated. Therefore, in known ray tracing methods, the entire AS, e.g., BVH, needs to be rebuilt every time the geometric resolution changes (which is generally not achievable in real time during rendering using most current computer systems).

[0014] The embodiments described below are provided by way of example only and are not limited to specific implementations that address any or all of the disadvantages of known methods and apparatus for changing geometry LOD while ray tracing. Summary of the invention

[0015] This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.

[0016] A method of compressing data representing displacement information in a ray tracing system is provided, wherein the displacement information indicates displacements to be applied to geometric shapes in a scene rendered by the ray tracing system, the method comprising:

[0017] retrieving a pair of data sets representing the displacement information, wherein a first data set of the data sets comprises a first array of values ​​and a second data set of the data sets comprises a second array of values;

[0018] extracting values ​​from corresponding array positions in each of the first array and the second array, wherein the extracted values ​​form a pair of values ​​representing an upper limit and a lower limit of the displacement magnitude of the corresponding array position;

[0019] identifying which of a plurality of predetermined conditions the pair of values ​​satisfies; and

[0020] The pair of values ​​is encoded into a single value in the compressed data set, wherein the single value represents the identified predetermined condition.

[0021] The method may include repeatedly performing encoding on all value pairs included in a pair of data sets, wherein the compressed data set may include compressed displacement information of all information in the pair of data sets.

[0022] The pair of data sets representing displacement information may represent mipmaps that have been sampled from texture pixel data representing a texture to be applied to geometry in the scene. Preferably, the pair of data sets represents displacement information for a particular level of detail (i.e., geometry or texture detail level).

[0023] The encoded single value representing the identified predetermined condition can be represented by fewer bits than each value in a pair of values. The encoded single value can be an unsigned integer. 2 or 3 bits can be used to represent the encoded single value. In some examples, the pair of values ​​are each represented by 8 bits (i.e., 16 bits in total), where each value in the first array and the second array of values ​​is a normalized integer (in the 8-bit example, between 0 and 255) that can represent a normalized floating point value in the range [0,1].

[0024] The method may include compressing a plurality of pairs of data sets representing displacement information to form a plurality of compressed data sets, wherein each compressed data set of the plurality of compressed data sets may represent a different level of texture detail in a scene to be rendered.

[0025] Each cell of each compressed data set may be generated based on cells corresponding to multiple regions of the compressed data set having a finer texture detail level. The texture detail level of each compressed data set may correspond to a geometric detail level.

[0026] The method may also include: decoding a compressed data set to obtain at least one pair of values ​​representing an upper limit and a lower limit on the displacement value, wherein the compressed data set is associated with a tile within the scene; determining a bounding volume containing the tile, wherein at least one dimension of the bounding volume is determined based on the pair of values; and in response to determining that the ray intersects the bounding volume, depending on a tessellation indication associated with the tile, subdividing the tile one or more times to obtain a plurality of tile sub-units.

[0027] The predetermined condition may be that the value pair is covered by a predetermined value range, wherein the encoded single value may represent the predetermined range. The predetermined range may relate to a displacement magnitude (eg, a displacement of a primitive).

[0028] One or more values ​​may be reserved for encoding a pair of values ​​into a single value to represent characteristics of a texture to be applied to geometry in a scene. For example, a predetermined condition may be that a pair of values ​​satisfies a predetermined condition (e.g., both values ​​are zero) that indicates a texture property (e.g., transparency). Some value pairs may fall within a certain range, and different value pairs may represent special cases, such as indicating a particular texture property.

[0029] A first data set in the data sets may include a first array of values ​​representing minimum displacements, and a second data set in the data sets may include a second array of values ​​representing maximum displacements, wherein upper and lower limits of the displacement values ​​may be represented by value pairs as corresponding maximum displacement values ​​and minimum displacement values.

[0030] A first dataset in the datasets may include a first array of midpoint displacement values, and a second dataset in the datasets may include a second array representing half-width displacement values, wherein upper and lower limits of the displacement values ​​may be represented by value pairs as corresponding midpoint values ​​and half-width values.

[0031] The upper and lower limits of the displacement magnitude may be configured to define the boundaries of a bounding volume associated with the corresponding position of the scene for use by the ray tracing system.

[0032] A hardware unit for use in a ray tracing system is also provided, wherein the hardware unit is configured to:

[0033] retrieving a pair of data sets representing displacement information, wherein a first data set in the data sets comprises a first array of values ​​and a second data set in the data sets comprises a second array of values;

[0034] retrieving a value from each of the first array and the second array corresponding to the array position, wherein the retrieved value forms a pair of values ​​representing an upper limit and a lower limit of the displacement magnitude for the corresponding array position;

[0035] Identifying which of a plurality of predetermined conditions a pair of values ​​satisfies; and encoding the pair of values ​​into a single value in a compressed data set, wherein the single value represents the identified predetermined condition.

[0036] A method of decompressing data to obtain data representing displacement information in a ray tracing system is also provided, wherein the displacement information indicates displacement to be applied to geometric shapes in a scene rendered by the ray tracing system, the method comprising:

[0037] retrieving a compressed data set comprising an array of values, wherein each value in the array of values ​​is an encoded value representing one of a plurality of predetermined conditions;

[0038] retrieving a value from the compressed data set;

[0039] selecting one of the plurality of predetermined conditions depending on the retrieved value;

[0040] In response to determining that the selected predetermined condition represents a predetermined range of values:

[0041] A pair of values ​​is generated, wherein the pair of values ​​collectively encode respective upper and lower limits associated with the predetermined range of values, wherein the upper and lower limits relate to upper and lower limits of a displacement magnitude.

[0042] The method for decompressing data may also include repeatedly retrieving and decompressing values ​​included in a compressed data set to obtain multiple generated value pairs, wherein the multiple generated value pairs may form a pair of data sets representing displacement information, wherein a first data set in the data sets may include a first array of values, and a second data set in the data sets includes a second array of values.

[0043] The first array of values ​​may represent the minimum displacement and the second array of values ​​may represent the maximum displacement, with each generated pair representing the respective maximum displacement value and minimum displacement value.

[0044] The first array of values ​​may represent midpoint values, the second array of values ​​may represent half-width shifts, and each generated pair may represent a corresponding midpoint value and half-width shift value.

[0045] Each value of the compressed data set can be represented by fewer bits than each value in the generated value pair. The generated value pair representing the upper and lower limits of the displacement value can be configured to define the boundaries of a bounding volume associated with the corresponding position of the scene for use by the ray tracing system.

[0046] A hardware unit for use in a ray tracing system is also provided, wherein the hardware unit is configured to:

[0047] retrieving a compressed data set comprising an array of values, wherein each value in the array of values ​​is an encoded value representing one of a plurality of predetermined conditions;

[0048] retrieving a value from the compressed data set;

[0049] selecting one of the plurality of predetermined conditions depending on the retrieved value;

[0050] In response to determining that the selected predetermined condition represents a predetermined range of values:

[0051] A pair of values ​​is generated, wherein the pair of values ​​collectively encode respective upper and lower limits associated with the predetermined range of values, wherein the upper and lower limits relate to upper and lower limits of a displacement magnitude.

[0052] A graphics processing unit is also provided, which comprises a hardware unit according to the above hardware unit.

[0053] An integrated circuit definition data set is also provided, which, when processed in the integrated circuit manufacturing system, configures the integrated circuit manufacturing system to manufacture the above-mentioned hardware unit or the above-mentioned graphics processing unit.

[0054] A computer readable code is also provided, the computer readable code being configured to cause any of the methods described herein to be performed when the code is executed.

[0055] There may also be provided a method of performing tessellation of tiles in a ray tracing system for rendering an image within a scene, wherein the tile represents a portion of a surface of an object within the scene, the object being defined in 3D space using a first spatial coordinate system, the method comprising:

[0056] determining a bounding volume containing the patch;

[0057] determining whether the ray intersects the bounding volume;

[0058] In response to determining that the ray intersects the bounding volume, and in accordance with a tessellation indication associated with the tile, subdividing the tile one or more times to obtain a plurality of tile subunits, wherein one or more of the tile subunits do not represent primitives;

[0059] after said subdivision of said tile, determining that at least one of said tile subunits comprises a primitive; and

[0060] Intersection tests between the rays and the primitives are performed for rendering an image of the scene.

[0061] A hardware tessellation unit for use in a ray tracing system may also be provided, comprising volume intersection test logic, tessellation logic, and primitive intersection test logic, wherein the tessellation unit is configured to:

[0062] determining a bounding volume containing the patch;

[0063] determining whether the ray intersects the bounding volume;

[0064] In response to determining that the ray intersects the bounding volume, and in accordance with a tessellation indication associated with the tile, subdividing the tile one or more times to obtain a plurality of tile subunits, wherein one or more of the tile subunits do not represent primitives;

[0065] after said subdivision of said tile, determining that at least one of said tile subunits comprises a primitive; and

[0066] Intersection tests between the rays and the primitives are performed for rendering an image of the scene.

[0067] The method described herein (i.e., for compressing data representing displacement information in a ray tracing system or decompressing data to obtain data for representing displacement information in a ray tracing system) may be embodied in a hardware unit. A hardware unit may be provided for manufacturing in an integrated circuit manufacturing system for performing compression or decompression as described herein. An integrated circuit definition data set may be provided, which, when processed in an integrated circuit manufacturing system, configures the system to manufacture the hardware unit. A non-transitory computer-readable storage medium may be provided, having stored thereon a computer-readable description of the hardware unit, which, when processed in an integrated circuit manufacturing system, causes the integrated circuit manufacturing system to manufacture an integrated circuit containing the hardware unit as described herein.

[0068] An integrated circuit manufacturing system may also be provided, comprising: a non-transitory computer-readable storage medium having stored thereon a computer-readable description of a hardware unit; a layout processing system configured to process the computer-readable description so as to generate a circuit layout description of an integrated circuit containing the hardware unit; and an integrated circuit generation system configured to manufacture the hardware unit based on the circuit layout description.

[0069] Computer program code for executing any of the methods described herein may be provided.A non-transitory computer readable storage medium may be provided on which computer readable instructions are stored, which when executed in a computer system cause the computer system to execute any of the methods described herein.

[0070] As will be apparent to the skilled person, the above features may be combined as appropriate and may be combined with any aspect of the examples described herein. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] Examples will now be described in detail with reference to the accompanying drawings, in which:

[0072] Figure 1 A ray tracing system according to examples described herein is shown;

[0073] Figure 2 shows the patch oriented in instance / model / object space, and the axis-aligned bounding box (in that space) that contains the patch intersected by the ray;

[0074] Figure 3 Shows Figure 2 The patch of has been transformed into patch space, where the patch is contained by an axis-aligned bounding box (in that space);

[0075] Figure 4a Shown applied to Figure 3 The first tessellation level of the patch;

[0076] Figure 4b showing a sub-axis-aligned bounding box containing a sub-tile formed by a tessellated region of the tile, wherein a ray intersects the sub-bounding box;

[0077] Figure 4c Shows Figure 4b Vertex normals of the sub-patch shown in , where the vertex normals indicate primitive displacement;

[0078] Figure 4d showing primitives within a sub-tile that have been shifted according to vertex normal data, and rays that intersect the shifted primitives;

[0079] Figure 5 is a flow chart of a first method for performing tessellation of tiles during ray traversal of an acceleration structure;

[0080] Figure 6a shows the axis-aligned bounding box contained within Figure 2 The patch,bounding box intersects with different rays;

[0081] Figure 6b shows the child axis-aligned bounding box, which is contained by Figure 6a A sub-patch formed by a mosaic area of ​​the patch in;

[0082] Figure 7a shows that according to the higher detail level Figure 6b and further tessellation of a sub-patch formed in and another sub-axis-aligned bounding box containing another sub-patch;

[0083] Figure 7b showing a primitive within another sub-tile that has been displaced, and a ray that intersects the displaced primitive;

[0084] Figure 8a to Figure 8g Seven different single-level (aka local) tessellation patterns are shown, along with the primitives and / or sub-tiles that make up the corresponding patterns;

[0085] Figure 9a and Figure 9b Two examples are shown by which an axis-aligned bounding box containing a patch can be conservatively filled;

[0086] Fig.10 showing a grid indicating minimum and maximum displacement data for a patch region for each respective level of detail;

[0087] Fig.11a and Fig.11b Two examples of compressed min / max displacement data at two levels of detail are shown;

[0088] Fig.12a Describe the steps for initially tessellizing an input quadrilateral patch, Figure 12b Describe the steps to further tessellate the intermediate subtriangles, and Fig.12c shows an example resulting tessellation pattern of an input quadrilateral tile containing triangle primitives generated by an initial tessellation step, followed by a further tessellation step of intermediate sub-triangles;

[0089] Fig.13 Shows Fig.12c An example of how tiles in are consistently tessellated according to a tessellation algorithm and a predetermined level of geometric detail (i.e., a per-vertex tessellation factor) associated with the tiles;

[0090] Fig.14 Three 2D patch types and their corresponding (piecewise affine) transformations into the 2D domain space are shown;

[0091] Fig.15 A computer system is shown in which a graphics processing system is implemented; and

[0092] Fig.16 An integrated circuit manufacturing system for producing an integrated circuit including a graphics processing system is shown.

[0093] The accompanying drawings illustrate various examples. It will be appreciated by the skilled person that the element boundaries (e.g., boxes, groups of boxes, or other shapes) shown in the accompanying drawings represent an example of boundaries. In some examples, it may be the case that an 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 accompanying drawings to indicate similar features. DETAILED DESCRIPTION

[0094] The following description is presented by way of example to enable one skilled in the art to make and use the invention.The present invention is not limited to the embodiments described herein, and various modifications to the disclosed embodiments will be apparent to those skilled in the art.

[0095] Embodiments are now described by way of example only.

[0096] Figure 1 A ray tracing tessellation system 100 is shown that includes a ray tracing unit 102 and a memory 104. Ray tracing unit 102 includes a processing module 106, an intersection testing module 108, and processing logic 110. Intersection testing module 108 includes one or more box intersection testing units 112, one or more primitive (e.g., triangle) intersection testing units 114 (TTU), a tessellation module 116, and an instance transformation unit 118 (ITU). In some examples, intersection testing module 108 may also include one or more process tester units ( Figure 1) for performing intersection tests on procedural primitives (e.g., those generated programmatically by shader code). In operation, ray tracing unit 102 receives geometric data defining objects within a 3D scene. The geometric data may include geometric data on tiles that form part of a surface of the object, where the tiles are to be tested for intersection and subsequently tessellated. Ray tracing unit 102 also receives ray data defining rays to be tested for intersection. The ray tracing unit also receives tessellation data (also referred to as tessellation instructions) that indicate how to tessellate the tiles. Figure 1 The “tessellation data” is shown as being obtained external to the ray tracing unit for simplicity. However, the tessellation instructions may be obtained externally and / or internally to the ray tracing unit. Thus, in practical examples, the tessellation instructions may be generated partially (or completely) from within the tessellation module 116.

[0097] Tessellation instructions typically include any data used by tessellation module 116 to generate new geometry through tessellation. Thus, tessellation instructions determine the topology (i.e., connectivity) of the final surface. Tessellation instructions, typically received from outside ray tracing unit 102, may include one or more of: pre-baked vertex attributes, samples from tessellation maps / textures, results of shader calls, and some combination thereof. Some or all of these attributes may also be referred to as displacement data, for example, if they are also used to determine displacement information (e.g., the displaced position of a tessellated vertex, or the extent of a bounding box of a sub-tile). The displacement data typically determines the geometry of the final surface (e.g., position, length, area, etc.). In some cases, the content of the displacement data overlaps with the tessellation data, but the two data are not identical in nature. Figure 1 However, the tessellation instructions may also be generated within the tessellation module 116, for example as a fixed function result of the geometry and lighting data (eg, based on relative position / orientation).

[0098] The ray may be a primary ray or a secondary ray (e.g., a shadow, ambient occlusion, reflection, refraction, global illumination (radiance), or subsurface scattering ray, etc.). The processing module 106 is configured to generate a set of secondary acceleration structures (i.e., a set of BLAS) based on the geometric data, and further generate a single primary acceleration structure (i.e., TLAS) based on the set of secondary acceleration structures, and store the primary acceleration structure and the set of secondary acceleration structures in (e.g.,) a global memory ( Figure 1 For simplicity, Figure 1 Memory 104 is merely indicated, and is generally not intended to store the entire AS. For example, memory 104 may be local memory for storing a portion of an AS (e.g., one or more BLAS). Typically, memory 104 will be used to store only as much AS as is needed for ray tracing unit 106 to perform a pass, e.g., enough data to tessellate a particular tile or set of tiles. Memory 104 may be a local cache.

[0099] In general, each leaf node of the main AS (e.g., TLAS) includes: instance transformation data / information, a pointer (one or more) to the BLAS, and a bounding volume (i.e., defining objects defined within the BLAS). The second acceleration structure represents a hierarchy of geometric structures of one or more models / objects that share instance transformations (and is a strict subset of the entire scene), and is referred to as the underlying acceleration structure (BLAS) in the example. The leaf nodes of each BLAS typically include primitives or lists of primitives. In most examples corresponding to the present disclosure, each BLAS leaf node contains a tile (which contains multiple primitives when tessellated) or a list of tiles. Alternatively, pointers can be used at leaf nodes, that is, so that the BLAS leaf node contains a pointer to any of the following: primitives; lists of primitives; tiles; and lists of tiles. The BLAS leaf node also includes a bounding volume (which defines one or more tiles) and tile transformation data (i.e., for applying a transformation from instance space to tile space). As described below, during the tessellation and traversal of the tile, another three-level AS of the tile is generated in real time and implicitly.

[0100] Figure 1 The location of processing module 106 in is merely exemplary; in other cases, processing module 106 may be external to ray tracing unit 102 (e.g., the acceleration structure is generated separately from the ray tracing unit in a CPU, etc.). After each BLAS has been generated and stored, intersection testing module 108 can retrieve nodes of the acceleration structure (including data defining or used to define a bounding box (e.g., AABB) corresponding to the node) from memory 104 to perform ray intersection tests on the retrieved nodes. In some examples, the (axis-aligned) bounding box will contain a larger portion of the object (e.g., when higher in the hierarchy of the BLAS), and in other examples will contain a smaller portion of the object (e.g., when lower in the hierarchy of the BLAS), such as the bounding volume of a single tile or a small list of tiles. In the following disclosure, a tile is considered to be a planar (generally polygonal) portion of the surface of an object, which can be further tessellated / subdivided into multiple primitives. The volume (e.g., box) intersection test unit 112 (BTU) performs intersection testing to determine if the ray intersects each bounding volume corresponding to a node of the acceleration structure (where a miss may cull a large tile of the hierarchical acceleration structure). Traversal along the BLAS including intersection testing with bounding volumes (e.g., AABBs) continues until the intersection test module 108 reaches a node that contains only bounding volumes of tiles or a small list of tiles that may be contained. This node represents a leaf node in the BLAS.

[0101] In the following disclosure, unless otherwise indicated (e.g., oriented bounding boxes, etc.), bounding volumes or bounding boxes, etc. are inferred to be axis-aligned by way of example. If the box intersection test unit (BTU) indicates a hit with the AABB (obtained from the leaf node of the BLAS) of the bounding volume containing the tile, the ray and the patch are transformed into parameter space, where the patch is planar and where the edges of the patch are aligned with the parameter space axes. In the examples, no explicit transformation is performed on the patch because the spatial coordinate system (2D domain space) is derived with reference to the dimensions of the patch, which means that the patch becomes implicitly transformed once it is defined in the domain space. For example, in the example where the patch is a quadrilateral patch, the transformation from instance space to domain space is specifically chosen so that the corner vertices of the patch will be mapped to (algorithmically convenient) predetermined values, such as the corners of the patch are mapped to the set [0,1] 2 The angle is {0, 1} 2 .

[0102] Advantageously, the ITU 118 used to transform from world space to instance space can also be used to perform a transformation from instance space to a tile-based parameter space. Attributes for the transformation from TLAS to BLAS are stored (or pointed to) in the TLAS leaf node, and attributes for the transformation from BLAS to domain space are stored (or pointed to) in the BLAS leaf node. In some cases, the transformation information can be explicit (e.g., a matrix transformation) or can be derived based on attributes such as the corner vertices of the tile. In a rasterization tessellation scheme, this 2D parameter space may also be referred to as a "domain space." In the present disclosure, by extending the parameter domain into 3-dimensional space, another 3-dimensional bounding volume / AABB is generated around the 2D tile for testing by the BTU, such as Figure 3 This 3D space is called "patch space" where two axes of the space lie in the plane of the patch and the third axis is orthogonal to the plane of the patch (i.e., parallel to the normal of the patch), or otherwise does not lie in the plane of the patch. The extent of the AABB is determined according to the indicated positive and negative displacements (which may be the maximum displacement) in each axis, where the displacements are assumed to be in the direction of the normals associated with each corner vertex of the patch, or in the direction of any normals that can be interpolated from those corner normals.

[0103] BTU 112 may test a new AABB containing a tile that is aligned with respect to a tile space axis. In response to a hit, the tessellation module subdivides the tile according to the tessellation data. Subsequent intersection tests with BTUs and tessellation operations are performed recursively, depending on factors such as other "hits" with the new child AABB and tessellation data. This recursive tessellation method involves several examples in the following disclosure and is described in Figure 5Detailed description in. Recursion continues until a given ray no longer needs mosaicking, equivalently reaching a sub-tile containing only primitives in the tile, wherein the primitives are tested for intersection with the ray, and / or determining that the ray misses the AABB of all pending sub-tiles. During the recursive mosaicking and intersection testing, a new (implicit) hierarchical structure is obtained, which contains the new mosaicking sub-unit of the tile. In other words, the nodes of the hierarchical structure relate to sub-tiles or sub-triangles (wherein those sub-triangles are primitives). This hierarchical structure is referred to as a tile-level acceleration structure (PLAS). PLAS is unique for each ray, that is, each ray can generate different hierarchical structures, because each ray can induce different mosaic patterns and / or different LODs due to different mosaicking instructions. PLAS is generated implicitly in real time, meaning that it has never been fully constructed and stored, but partially constructed during traversal. PLAS leaf nodes are usually sub-triangles that cannot be further subdivided, that is, where the sub-triangles are primitives. PLAS can be stored in a memory and / or cached for subsequent use by other rays. For example, bundles of rays or packets of coherent rays may utilize the same PLAS so that tessellation is not re-performed.Triangle Intersection Test Unit 114 (TTU) Once generated and / or reached during traversal, one or more of the primitives perform intersection testing.

[0104] The results of the tessellation and intersection tests are provided to processing logic 110. Processing logic 110 is configured to process the results of the intersection tests to determine rendering values ​​for an image representing a 3D scene. The processing logic obtains attribute data to perform shading, but for simplicity, Figure 1 This is not shown in the figure. The rendering values ​​determined by the processing logic 110 may be transferred back to the memory 104, or stored in some other storage area such as a global memory (not shown), to represent an image of the 3D scene. References to LOD (level of detail) in this disclosure generally refer to geometry LOD unless specified in relation to another type of LOD (e.g., texture LOD).

[0105] As mentioned, the memory 104 shown is typically local memory to the ray tracing module, but in an embodiment, the processing module 106 and the processing logic 110 may store their respective input / output in either a global memory (not shown) or a local memory (such as a local cache), as appropriate and in a manner that can be derived by a skilled person. In addition, the data input (geometry data, ray data, tessellation data, and / or displacement data) to the ray tracing unit 108 may actually be received directly from the local memory (e.g., 104) (to improve the efficiency associated with extracting data for traversing the PLAS), or from another external storage location (e.g., global memory).

[0106] Figure 2A patch 204 is shown oriented in object space 210. In this example, the coordinates of the patch 204 satisfy V3=V1+V2-V0, i.e., such that the patch is a parallelogram in instance space. The parallelogram also satisfies |(V1-V0)×(V2-V0)|>0, i.e., the patch is non-degenerate (otherwise it can be assumed that any ray test against it automatically results in a miss). References to model / object space in the following disclosure are interchangeable with "instance space" and represent a 3D coordinate space for representing the geometry of one or more objects that share a local space, and the patches used to form the surfaces of these objects. The patch 204 in this example is a parallelogram, but other patch configurations (e.g., triangular or non-parallelogram) are also possible, as described in the following disclosure. The patch 204 is oriented according to object space, i.e., aligned with the surface of the object it represents. The plane of the patch is indicated relative to the patch axis 212. Only one patch is shown, although the surface of the object is represented by multiple (usually) continuous patches (not shown) so that the patches (usually) form a continuous surface without holes. The bounding box 202 shown is axis-aligned with respect to the object space axis 210, but not aligned with the plane of the patch 204. The vertices of the patch are V0, V1, V2 and V3. A ray 208 is indicated that intersects the bounding box 202 at the intersection point 206. In the instance / object space, the bounding box 202 is not configured to tightly bound the 2D patch (i.e., there is free space in the direction of its normal, for example). However, this can be done intentionally, i.e., the object space bounding box can be arranged to conservatively bound the patch for any combination of mosaicking and displacement. For example, the bounding box 202 can be constructed to tightly bound an oriented bounding box OBB (not shown) that conservatively bounds any mosaicking and / or displacement form of the patch.

[0107] The bounding box 202 represents a leaf node of the underlying acceleration structure (BLAS) because it contains one or more pointers to one or more tiles, ie, represents a region bounding one or more tiles in the scene. Figure 2 Only one tile 204 is shown in FIG. As will be appreciated by those skilled in the art, ray 208 is preferably tested for intersection with object space bounding box 202 by a box test unit (BTU). In response to a hit (indicated at 206), tile 204 will then be tested after any tessellation of the tile determined by the tessellation indication to determine whether the ray intersects a sub-tile or primitive generated from the tile by tessellation.

[0108] In some examples, intersection testing with the patch may be performed in instance space without transforming to patch space. However, for AABBs aligned with instance space (e.g., 202), resources are not efficiently utilized due to the degree of misalignment between the plane of the patch and the axis of the instance / object space. In a second example, a new oriented bounding box (OBB) may be generated in object space (not shown), which is aligned with the plane of the patch and, as described above, conservatively defines any mosaic and / or shifted forms of the patch. However, performing box tests with non-axis-aligned boxes may suffer from the inherent delays or additional power / area costs of OBB box tests. Therefore, in order to perform additional box intersection tests and mosaics on the patch, it is advantageous to use a box that is both aligned with the coordinate system axes and tightly defines the patch (or sub-patch). Therefore, the present embodiment transforms the rays into parameter space, where by definition, the edges of the patch are axis-aligned, which means that an axis-aligned and tightly fitting bounding volume around the patch can be generated. Preferably (and typically like bounding volumes), bounding volumes are constructed in a conservative manner so as to mitigate false negative hits. Advantageously, this allows existing BTUs, such as those already present in ray tracing hardware, to be used to perform additional intersection tests. From an algorithmic perspective, box testing for AABBs is also more efficient than for OBBs. Furthermore, box testing using tight bounding boxes avoids wasteful overlap between bounding volumes of adjacent tiles and thus reduces overall latency. The reduction in latency is more pronounced for smaller tiles or sub-tiles, i.e., the degree of displacement applied to the AABB is more significant compared to the size of the tile.

[0109] Figure 3 Shown from Figure 2 The patch 204 has been transformed into a parametric 3D space, in which the plane of the patch is aligned with the axis 304 of the space, i.e., the patch space. In the rasterization scheme, this space is 2D, however, due to the bounding volume built around the patch, the present ray tracing implementation uses a 3D patch space. The patch 204 is contained within an axis-aligned bounding box 302a (AABB), however, this AABB 302a is strictly fitted to the edge of the patch. Therefore, another extended axis-aligned bounding box 302b is generated around the AABB, where the extended or "filled" box is used in the example for the purpose of intersection testing to ensure conservative intersection testing (i.e., to reduce or avoid false negatives) when a displacement along the normal of the vertex generated by the tessellation is adopted. In practice, only the filled volume 302b is generated, but for illustrative purposes, the tightly fitting box 302a is shown here. Filling the bounding volume helps to provide a "watertight" ray tracing method, thereby avoiding artifacts such as cracks in the rendered scene, such as artifacts caused by incorrect clipping of displaced primitives. The intersection point 308 is shown relative to the filled AABB 302b.

[0110] The tile 204, being a quadrilateral, is associated with four vertex normals (306a-d) shown by four arrows. These indicate the direction of displacement of the final intersecting surface described by the tile. The vertex normals are used together with a pair of minimum and maximum displacement values ​​to compute a fill bounding box prior to the final displacement of the primitive (but no displacement occurs if the ray is not found to intersect any of the lowest level sub-tiles within the tile-level acceleration structure). In accordance with the present disclosure, the fill calculation of the bounding volume is relative to Figure 9a , Figure 9b Described.

[0111] Vertex normals 306a-d encode at least a portion of the displacement of the primitives contained in the tile, as well as minimum and maximum displacement values. Four tessellation factors (TF0, TF1, TF2, TF3) are indicated at the vertices of the tile, which provide the information required to subdivide the tile. These tessellation factors form at least a portion of the tessellation instructions used by the tessellation module 116 (and may form the entire tessellation instructions). Preferably, the tile is initially associated with four tessellation factors (or typically one tessellation factor per tile corner vertex). It should be noted that the examples of tessellation schemes in the present disclosure use tessellation factors generated at a per-vertex granularity, however, other examples may generate tessellation factors at other granularities, such as per scene, object / model, face, edge, vertex, material, texture, etc. A predetermined tessellation algorithm determines how the tessellation should be performed based on the tessellation factors. The tessellation method is described in detail in the following example. After a "hit" 308, i.e., when an intersection between a ray and a fill AABB 302b is determined, the tile 204 is tessellated according to the tessellation instructions (TF0, TF1, TF2, TF3) to determine what intersection test to perform next.

[0112] Figure 4aA subdivided tile 204 in tile space is shown, where the subdivision involves initially subdividing a quadrilateral tile into four triangles, and then equally dividing each triangle into two sub-triangles within the tile. When bisecting a triangle into sub-triangles, a preferred subdivision operation involves generating a new edge between an existing vertex (for a right triangle, the vertex is associated with a right-angle corner) and a point on an existing edge (for a right triangle, the hypotenuse) that bisects the edge into two sub-edges, one for each sub-triangle. The subdivided tile 204 contains eight sub-units, all of which are triangles, and which themselves can be grouped into four "sub-tiles", i.e., "sub-quads". The four sub-tiles are squares and therefore have the same relative proportions as the parent tile 204 (i.e., similar to the parent tile). It is not yet known whether the triangles are primitives, i.e., whether they can be further subdivided. At this stage, it is not determined whether the tile sub-units are primitives, because the next step in the algorithm is a box intersection test. In general, the method of the present disclosure performs volume-ray intersection testing in preference to primitive-ray intersection testing because volume-ray testing can be used to exclude a large number of primitives, thereby avoiding testing an excessive number of primitives. In addition, volume-ray testing can be used to exclude unnecessary tessellation. Still further, volume-ray intersection testing is typically computationally cheaper than primitive-ray intersection testing (particularly when the volume is an AABB). Therefore, it is preferred to increase the ratio of volume-ray testing to primitive-ray testing, thereby eliminating as many high-cost primitive tests (to be performed by TTU 114) as possible using the low-cost volume-ray testing performed by BTU 112. In this way, the present method has the advantage that tessellation (i.e., subdivision) of a tile into sub-tiles and / or primitives is performed only on areas of the tile where ray intersection is determined. Advantageously, this avoids the need to pre-tessellate the entire surface prior to ray tracing, because the traversal of the ray through the tile will determine which areas of the tile to tessellate based on successful volume-ray intersection tests.

[0113] Figure 4b A sub-patch 404 containing two triangles within a larger patch is shown. A new AABB 402a is formed around the sub-patch. Figure 3 402b, to provide a conservative box intersection test (which again provides inherent water tightness for the final rendering). The sub-AABBs of all sub-tiles are conservatively constructed in this way (e.g., padded) so that the AABBs of adjacent sub-tiles overlap. This ensures that a ray that should intersect a primitive in a tile will also intersect any sub-tile AABB that is above the PLAS that should define it. Ray 208 is shown intersecting the padded sub-tile AABB 402b at intersection point 406.

[0114] Figure 4c Shows the response to Figure 4b A "hit" 406 is shown having another tessellation level applied to sub-tile 404 between ray 208 and filler sub-tile AABB 402b. New Tessellation Figure 4b The two triangles shown are tessellated (by bisection) to form four new triangles (e.g., 410a, 410b). The result of the preferred tessellation step is four triangles of equal size. The newly formed triangles represent a new level of detail because the tile is now defined at a finer granularity. The tessellation indication is updated in response to the subdivision (according to Fig.13 Detailed description of the method for updating mosaic data in the preferred mosaic method). In this example, four triangles are determined not to be further subdivided based on the updated mosaic indication. It can therefore be inferred that the four triangles are primitives, that is, the smallest unit of the object surface to be intersected and shaded / rendered. In order to test the intersection of the primitive with the light, each vertex of the primitive is shifted according to the displacement data associated with the tile (e.g., the vertex normal and / or any (normalized) texture map or other displacement function and / or minimum and maximum displacement values). This shifts each vertex of the primitive beyond the XY plane of the tile (i.e., parameter / domain space) into the third axis of the tile space.

[0115] Figure 4d The vertex of a primitive 410b of the indication sub-patch 404 is shifted to the new position of the displacement primitive 414 relative to the plane of the patch. The vertex normal associated with the original patch (306a-306d) is used to calculate the normal associated with the vertex of the non-displaced primitive (408c, 408d, 408e), which can be completed by linear interpolation (with or without renormalization) after generating the primitive vertex during mosaicking. When the normal is not renormalized, the normal generated for the sub-patch during the PLAS traversal can be reused as input, to sub-interpolate the normal of the vertex generated in the PLAS hierarchy below after additional mosaicking. The calculation of the new vertex normal can also be realized by repeating interpolation at each level of PLAS. The vertex normal (408c, 408d, 408e) encodes the displacement direction, but not necessarily the magnitude (normal is shown as extending to the vertex of the displacement primitive 414 for convenience only). In addition to the vertex data, displacement data is obtained, which perturbs the vertex position along the interpolated normal, resulting in a displaced primitive in the 3D tile space. The displacement data may involve a texture, or in other examples may be provided by a displacement function. In general, the displacement data may be obtained in a variety of different ways, for example: the original user-provided displacement map / function may be sampled per vertex as needed (e.g., via an interpolation scheme) ( Fig.10 1000 in ).

[0116] The original user-provided displacement map can be mipmapped to avoid latency attributable to sampling with reduced aliasing, at the expense of storage (mipmaps use up to 33% more storage); in addition, doing so may result in the mipmap displacement data having to be sampled at each LOD in the following construction. The sampled displacement data (possibly adjusted for the worst-case value across all texture LODs when mipmapping the original user-provided displacement map) can be used to produce a min / max map at the highest LOD. From this min / max map of sampled data, a min / max mipmap can be generated, i.e., a chain of maps / tables for each level of detail (i.e., from the highest LOD down to zero LOD). In the example described below, this series of mipmapped min / max tables is generated offline and stored in global memory (e.g., Fig.10 , as seen in 1002a-1008a) or (partially) in local memory. This is advantageous because, for example, the (sampled) original user-provided displacement map 1000 can be used primarily for offline generation of min / max mipmaps, thereby not requiring fetching / storage in local memory for the purpose of generating and traversing bounding volumes in PLAS, nor requiring on-the-fly processing with the associated cost. However, the (sampled) original user-provided displacement map 1000 is used to obtain accurate displacement information for displacing primitives, as described in more detail below. It should be appreciated that the main benefit of min / max mipmaps is to make the process of providing displacement minima and maxima (at each LOD) an offline process (and thus, as mentioned, avoid the cost of on-the-fly processing of user-provided displacement maps). As mentioned, multiple tables including min / max mipmaps have greater storage requirements; however, the present disclosure provides a compression scheme (relative to Fig.11a and Fig.11b However, it should be appreciated that even without compression, min / max mipmaps are still advantageous because the lower level of detail tables (e.g., LOD1=8B, and LOD2=32B) are the most commonly used and have a combined footprint (40B) that is still smaller than the footprint of the sampled original user-provided displacement map 1000 (81B).

[0117] The values ​​in the displacement map / function are usually treated as normalized values, i.e., values ​​in the closed interval [0,1]. For example, if an 8-bit displacement map is used, the encoding of 255 is treated as the value 1, etc. The closed interval [0,1] is modified to an arbitrary interval with a little affine arithmetic using the provided minimum and maximum displacement values. The displacement information for each primitive is therefore a combination of the tile vertex normal and the displacement data (including the minimum and maximum displacement values). The displacement data may require a lot of memory / bandwidth to store / fetch, especially if it is a high-resolution bit-depth texture map. Relative to Fig.10 and Fig.11a , Fig.11b Preferred methods for efficiently processing displacement data are disclosed.

[0118] Advantageously, there is no need to extract displacement data for each primitive within a tile for the entire tile or during traversal of non-leaf nodes of the PLAS. Final displacement data for a mosaicked primitive is obtained only at the moment when primitive displacement is required for ray-primitive intersection testing (e.g., via local texture samples). Prior to this, only "worst case" displacement information, i.e., min / max mipmaps, which are used to determine the degree of fill of AABBs of tiles and sub-tiles at each level of detail (LOD), is extracted and / or stored locally (e.g., in the tile data) and can only be generated offline (e.g., during the AS build process) once and stored as per-tile data in a hierarchical structure, and / or with its displacement map. Figure 1 In addition, compressed min / max mipmaps may be used, which contain conservative values ​​for the minimum and maximum displacement values ​​(again, at each given level of detail), but with significantly reduced memory usage / bandwidth. This has the advantage that the displacement values ​​for a given level of detail do not need to be calculated during the traversal from fine-grained (i.e., high resolution or bit depth) displacement values, which would be bandwidth intensive, but can simply be read from a compact quantized array, which is more amenable to caching in local memory. Fig.11a , Fig.11b Compression of mipmaps in this manner is described in more detail.

[0119] Once the primitive has been shifted to primitive 414, it is tested for intersection with ray 208. Preferably, the intersection test is performed using existing hardware such as a triangle test unit (TTU). In response to "hit" 412, this causes or instructs a shader to execute (e.g., any hit shader or closest hit shader, etc.) intersection information (e.g., winding, center of gravity, distance, etc.) and tile vertex attributes as input. The primitive-ray intersection test can then be performed for all primitives within the sub-tile, for example, in this case, the other three primitives in sub-tile 404, where it can be found that the ray did not hit these three primitives, so no shader is called for them. After the (multiple) rays are tested for intersection with the primitives, the ray traversal continues (e.g., along the bottom and / or top acceleration structures (BLAS and / or TLAS)). The traversal can also continue along the tile-level acceleration structure (PLAS), for example, when the sub-tile contains additional untested sub-tiles (for which it may be possible to further subdivide). In other examples, it may be determined that the ray does not intersect the first sub-tile AABB tested, in which case no tessellation is performed within the first sub-tile and no primitive intersection testing is performed, and traversal of the PLAS continues by testing different AABBs associated with different sub-tiles.

[0120] Thus, the combination of the tessellation scheme in this manner within the ray tracing scheme provides computational savings, since multiple primitives associated with one or more sub-tiles do not need to be generated in the first place (by tessellation), let alone tested for intersection. Figure 5 and Figure 6a , Figure 6b and Figure 7a , Figure 7b This advantage is illustrated by way of example in the flowchart shown in FIG.

[0121] Figure 5 is a flow chart of a method for performing a ray traversal of a PLAS associated with a particular ray and tile. The method includes performing a box-ray intersection test and / or a tessellation operation and / or a primitive-ray intersection test. The flow chart is for illustrative purposes only and is not intended to cover all possible finalities associated with different tile geometries or tessellation patterns. Certain paths or groups of steps within the flow chart may also be repeated in a recursive manner. Therefore, alternative paths are possible and will be recognized by those skilled in the art.

[0122] In step S502, the data of the ray is obtained: in particular, the data defining the components of the ray origin and the ray direction. This ray data relates to the instance space 210, such as Figure 2208 in . Data for the instance / model / object space bounding volume is also obtained. Preferably, the bounding volume is a box aligned with the axes of the instance space. Alternatively, instead of obtaining, a bounding box can be generated from scratch based on the geometry of the tile: for example, a bounding box aligned with the instance space axes (such as Figure 2 202 in order to define an oriented bounding box (not shown) that is consistent with the tile orientation. Since it is expensive to generate bounding volumes on the fly between coordinate spaces, it is preferred that the attributes of the bounding volumes be stored in leaf nodes such as BLAS. In some examples, to confer further conservatism with respect to arithmetic errors in intersection testing, the bounding box may be further expanded by a small amount, for example, by additional padding values ​​such as multiples of machine precision values ​​(e.g., for non-zero normalized floating point values).

[0123] In step S504, the intersection of the bounding box and the ray in the instance space is tested, for example, Figure 2 As shown. In response to a "miss", the method restarts, i.e., another aspect of the traversal of the system is performed, which may involve further traversal of the TLAS, BLAS, or testing of another leaf node of the BLAS (thus, traversing a new PLAS), i.e., a different tile. In addition, a new ray may be selected for traversal. In response to a "hit", the traversal of the ray continues in the current tile space.

[0124] In step S506, the ray is transformed from instance space into patch space 304. The patch 204 itself is also implicitly transformed into patch space so that the planes and edges of the patch are axis-aligned. As described above, the ray transformation is specifically chosen so as to map the patch to a set of (normalized) predetermined coordinates, e.g. [0,1] 2 . Thus, preferably no explicit arithmetic is performed on the tile itself. In this example, the transformation involves a translation step that places the V0 vertex (or some other corner vertex of the tile) at the origin of instance space 210, followed by a linear transformation (although non-parallelogram tiles may require multiple transformations). Fig.14 The transformations are described in detail. In some examples, the transformations can be pre-computed to save computation time for each ray traversal. Typically, computing transformations is computationally expensive, so offline computation is beneficial. In examples where transformations are generated dynamically, the transformation matrix can be cached and reused for other rays. Alternatively, when the transformation matrix is ​​stored in the leaf nodes of the BLAS, since the corner vertices implicitly embedded in the matrix (used to generate the transformation) do not need to be stored during the PLAS traversal, the components of the matrix transformation can be stored instead of the 3D corner vertices as per-patch data, thus saving space. In the case of a quad patch, a 3×4 matrix can accurately replace the four three-dimensional corner vertices because they each include twelve floating point values.

[0125] Once in tile space, a conservative AABB is calculated, e.g., 302b, based on minimum and maximum displacement data (which may be retrieved from a predetermined normalized component array coupled to the minimum and maximum displacement values). The minimum / maximum data determines the height of the box in the Z axis. The bounding box can then be extended in the X and Y axes based on the "worst case" lateral displacement of the primitives in the tile. This lateral displacement may be determined from the vertex normal data. In a conservative example, additional padding may be incorporated into the AABB along one or more axes to further ensure watertightness in the final rendering (at least, watertightness will be achieved between any two consecutive primitives generated by a single tessellated tile). In addition, additional padding may be applied to individual primitives that share edges with tile boundaries, i.e., as another conservative measure to ensure watertightness between consecutive primitives generated by different tessellated tiles.

[0126] The additional padding value typically corresponds to a small value that increases the extent of the bounding box almost negligibly. The functional goal of the additional padding is to ensure watertightness while affecting the latency of ray tracing to the minimum possible extent. In other words, the purpose of the additional padding is to provide an overlap between the bounding volumes of adjacent tiles that is small enough not to significantly affect rendering speed but ensures that false negative intersection results are avoided. Avoiding false negatives can bring multiple benefits, for example, helping to ensure watertight rendering, and additionally ensuring that simultaneous (e.g., parallel) implementations can achieve determined intersections when the execution order is uncertain; in other words, the additional padding helps to ensure that the results of the intersection test are determined and therefore predictable / repeatable, regardless of the order in which the intersection tests are performed. The value of the additional padding can be generated based on one of the following (or multiples thereof) or a combination: underflow level (UFL), machine precision (also known as unit rounding), or ULP (unit in the last place, or least precision unit). The UFL is the smallest computationally representable absolute quantity, and is usually the smallest representable normalized floating point value. Therefore, the ULP depends on the number of exponent bits used to represent the relevant value. The effect of adding the UFL on the floating point value is almost negligible and has no effect on most floating point values. Therefore, the additional padding is preferably proportional to the machine precision (also known as unit rounding) because this is related to the relative error from the ULP (unit in the last position / unit of least precision), which is a function of the number of mantissa bits. Throughout the specification, unless otherwise stated, all references to "additional padding value", "additional padding", or "further padding", etc., refer to one of the above values ​​(UFL, ULP, machine precision) and usually to the machine precision.

[0127] During the PLAS traversal, the normals of the corner vertices of a tile are usually defined in tile space. In theory, these normals can be generated from instance space normals and instance dynamic conversion. However, a more computationally efficient approach is to generate the corner vertex normals offline in tile space and then store them as per-tile data (e.g., as part of BLAS, stored in local memory such as cache). In this way, instance space normals can be stored elsewhere (e.g., in global memory) and used as shading input, while tile space normals can be stored locally and used only for PLAS traversal.

[0128] At step S508, a box test unit (BTU) may be used to test the intersection of a filled AABB (e.g., 302b) and a ray. In response to a "miss," the process restarts via A as with step S504, and traversal continues along a different path (e.g., with a different ray or tile). In response to a "hit" 308 (e.g., Figure 3 As shown), consider the mosaic of patches.

[0129] At step S510, tessellation factors for the tile (or sub-tile, following the loop from S516 via path D) are obtained. These may include, for example, tessellation factors (and / or possible tessellation thresholds) for each vertex and / or each edge. In general, a positive tessellation factor indicates that a certain degree of tessellation is desired. A tessellation factor equal to or less than zero may indicate that the tile should not be tessellated, and may further indicate that the tile should be discarded entirely (i.e., not intersected by any rays). Other implementations may exist, and the skilled person will recognize that the meaning associated with different tessellation factor values ​​is implementation specific. A predetermined tessellation algorithm determines how to subdivide the tile based on the tessellation indication, and refers to Figures 12a to 12c and Fig.13 Overview of the preferred method. In general, one or more new vertices are generated, one or more new edges are formed between existing vertices and / or new vertices, and old edges may be subdivided. Although not specifically illustrated in the present disclosure, in some instances, the old vertices / edges may be completely removed. In the preferred method, each new edge divides the triangle area into two, forming two equal-sized sub-triangle areas. Other known tessellation implementations may move the positions of vertices in parameter / domain space during the generation of new sub-units (e.g., triangles), however, due to aliasing of displacement maps / functions, moving domain space vertices during tessellation may produce unwanted "wobble" artifacts in the post-displacement rendering. Therefore, tessellation is good at maintaining the positions of all existing vertices in domain space with the benefit of avoiding such artifacts. In the preferred method, as Figure 4a The tessellation of the quadrilateral patch shown in generates a plurality of initial triangles. Specifically, Figure 4aThe tessellation in shows that the quad tile is initially tessellated into four triangle sub-units, and each sub-unit is subsequently subdivided into two equal-sized triangles (yielding a total of eight triangles). Each time a subdivision has been performed (e.g., initially tessellizing the tile into triangles, and / or subdividing a triangle into two sub-triangles), the tessellation factor is updated (e.g., by subtracting a fixed value). The resulting tessellated tile, which includes a new set of sub-units (e.g., triangles), is considered to have a first level of detail (or "LOD1"), as shown in FIG. Figure 4a Further subdivision of the subunits results in second and third levels of detail, etc. For example, Figure 7a The second-order sub-tile 706 shown in FIG. 7 represents a second level of detail formed after the triangle formed by the first LOD undergoes two additional subdivision operations.

[0130] After step S510, Figure 5 Indicates that the method is subdivided into one of steps S512 and S514. Either subdivision step may be followed first. Alternatively (and more likely in practice), the criteria in S512 and S514 may be considered simultaneously (e.g., in a parallel implementation), and one of the three paths may be taken depending on the result (i.e., both are answered yes, only S512 is answered yes, or only S514 is answered yes). The subdivision step selected may depend on factors such as the exit condition of the ray under consideration, for example, whether the ray is an occluding ray. In the example disclosed herein, the subdivision step leading to S512 is taken first. The skilled person will recognize that no matter which subdivision step is taken first, the final result (e.g., any hits and misses of occluding rays; the closest hits and misses of non-occluding rays) should be the same (i.e., the result should be deterministic, even if the volume / primitive test sequence changes), although the efficiency of the algorithm may depend on the choice of which subdivision step is taken first (e.g., finding an early hit may eliminate subsequent tests). In some cases, block S512 is never reached (e.g., where one of the tiles is subdivided into four sub-tiles, all of which are not hit by the ray). The skilled person will appreciate that Figure 5 The flow of the method shown is merely exemplary. For example, in some cases, the second subdivision step leading to S514 can be omitted (because the "no" in S512 leads to the "yes" of S514 inferred via path B). In the example shown, the method is constructed so that it is impossible for both S512 and S514 to be "no": that is, a "no" result in S512 means a "yes" result in S514 (indicated via path B), and vice versa, a "no" in S514 means a "yes" in S512 (indicated via path C). In practice, this represents the fact that all tiles and sub-tiles of any specified LOD are constructed to contain at least one primitive and / or at least one sub-tile.

[0131] At S512, it is determined whether the tile or sub-tile contains any primitives. This step is equivalent to querying the tessellation indication to determine whether any further tessellation of the primitives is indicated. If it is determined that the (sub)tile does not contain primitives, the method is skipped via path B, as if S514 has been answered in the affirmative. In other words, a (sub)tile that does not contain primitives means that it only contains sub-tiles, which is consistent with the affirmative result in S514. If it is determined that any primitives are in the (sub)tile, the method proceeds to S518. Consistent with this, the updated tessellation indication may indicate that no further tessellation will occur, from which it can be directly inferred that the sub-tile only contains primitives. In this case, the method will also continue to S518, but will not iterate back to S516 via path B via S522. After determining that one or more primitives exist after subdivision at S510, one or more primitives in the sub-tile are tested (for example, in Figure 4c In the case of sub-patch 404 in , the intersection of four primitives) and the light.

[0132] In step S518, displacement data is obtained and used to move and perturb one or more primitives in the 3D tile space before the intersection test. The displacement information for each primitive can be a combination of the tile vertex normal and the displacement data (including the minimum displacement value and the maximum displacement value). Other detailed examples are provided below. The primitive is based on its vertex normal (e.g., Figure 4d 408c-e) of the primitive 410b in , and then using e.g. Fig.10 The positions of the primitives are disturbed by further shifting data shown as 1000 in FIG. Depending on the number of primitives to be shifted and the number of test cells, it may be advantageous to shift some or all of the primitives and then perform intersection testing on each of the shifted primitives (either sequentially or simultaneously) to maximize utilization of the test cells.

[0133] In step S520, the shifted primitive (e.g., Figure 4d The test is preferably performed using a TTU unit 114 that implements any suitable primitive-ray intersection method. In response to a "miss", the TTU 114 repeatedly continues to test all remaining primitives identified in the sub-tile (e.g., Figure 4d, if primitive 414 is not hit, three more primitives are tested). Step S522 provides an escape condition when iterating over primitives: that is, if not all primitives have been tested, S522 loops back to S518 and S520 to move and test another primitive. If all primitives have been tested and no primitive results in a hit, the method restarts via A. Thus, S518 and S520 may alternate between shifting primitives and testing them for intersection with the ray until: i) a "hit" is found; or ii) it has been determined that all primitives do not intersect the ray (specifically, this relates to the example where the ray is an occluding ray (e.g., a shadow ray). This represents only one exit condition, called the "any hit" exit condition, and is suitable for handling shadow rays, etc.

[0134] In another example regarding a "closest hit" ray (i.e., a non-occluding ray), all primitives within the sub-tile will be intersected in sequence, and in each case, it will be determined whether a hit occurs. Each time a hit occurs, if the intersection is closer than the previous intersection, the hit information for the ray is updated. In this example, the method follows the dashed arrow extending from S524 and iterates over S518, S520 (and S524, in response to another hit) for all primitives within the (sub)tile. In general, the exit condition used depends on the type of ray being processed, and in this regard, the skilled person will be aware of what the appropriate exit condition is. In response to the appropriate exit condition being met for a given type of ray, the method ultimately returns to the beginning of the method via path A at S502.

[0135] At S524, in response to a "hit" shift primitive (e.g., Figure 4d ), performs shading of the primitive, i.e., triggers a shader to execute (e.g., any hit shader, closest hit shader, etc.), and inputs intersection information (e.g., winding, center of gravity, distance) and other data related to the intersecting primitive derived (e.g., interpolated) from the tile attributes of each vertex. After shading, the results are stored in memory 104, and traversal continues. In some examples (e.g., for a "closest hit" ray), the process may continue to iterate on steps S518 and S520 to test all primitives in the sub-tile even after successfully "hitting" the displaced primitive, for example, because in some examples, one primitive may occlude another primitive.

[0136] At step S514, it is determined whether the tile or sub-tile contains (other) sub-tiles. In some examples, this step can be reached directly from S510. Alternatively, in response to a "no" at S512, S514 is answered implicitly. For any given (sub-)tile, S514 and S512 cannot both have negative results, because tiles and sub-tiles contain at least one primitive, at least one sub-tile, or a mixture thereof (e.g., Figure 8a to Figure 8g ). Thus, when one of S514 and S512 is "no", the other is "yes". Typically, S514 involves considering whether a tile or sub-tile contains other sub-tiles. This typically involves determining whether / how the sub-units (e.g., triangles) of the subdivided tile are grouped into sub-tiles (i.e., sub-quads), i.e., sub-regions preferably having the same (or similar) proportions as the parent tile (e.g., quads). For example, Figure 4a The subdivided tiles 204 in can be grouped into four sub-tiles (each sub-tile contains two right triangles forming a sub-quadrilateral). As another example, in Figure 4b , a sub-tile (i.e., sub-quad) containing two triangles is identified 404. In practice, this determination may involve counting / determining how many sub-tiles (i.e., quads) can be formed (e.g., by grouping sub-triangles together), and checking whether this number of sub-tiles is > 0. If the result of S514 is "yes", a sub-tile is identified / selected at S516.

[0137] In step S516, one or more sub-tiles determined in S514 are identified. Once a sub-tile is selected, a conservative AABB is generated around the sub-tile, such as 402b. Conservative filling is again based on the min / max displacement data of the primitives and the "worst case" lateral displacement. Again, the lateral primitive displacements may be derived from the vertex normals of the tile, where the normals of the new vertices defining a portion of the tile may be calculated from the original tile vertex normals, i.e., by (linear) interpolation (with or without renormalization).

[0138] Even if a sub-tile or tile is found to contain only primitives at the next geometric LOD, it is also advantageous to identify the sub-tile. For example, it is usually more efficient to exclude the primitive set for intersection testing by performing an intersection test on the hierarchical bounding volume (with BTU 112) containing the primitive set instead. In this way, multiple primitive ray intersection tests can be avoided. In addition, since the primitive intersection test may require obtaining primitive displacement data and performing the movement of the primitive into the 3D tile space, performing a frame line test may be more efficient than performing one or more triangle intersection tests. Generally, it is advantageous to exclude or "remove" primitives as much as possible by performing frame line intersection tests, wherein frame line intersection tests are also usually less expensive than primitive ray intersection tests (in terms of area / power consumption / delay). Step S526 itself has eliminated primitives because the sub-tiles bounded by the bounding volume that is found not to intersect with the ray in S526 are not further subdivided or tested.

[0139] In step S526, the sub-tile AABB (eg, Figure 4c In response to a "miss", since there may be other child tiles in the parent tile, the method returns to step S516 to identify a new child tile that determines the child tile AABB and performs a box test. Figure 4b In the hypothetical case where ray 208 does not hit AABB 402b, there will be three other sub-tiles, and these sub-tiles will be tested for frame line intersection. In response to a "hit", it is determined how to process the sub-tile next, for example based on the geometric LOD of the sub-tile and any primitives contained in the tile. Even in response to a hit, all sub-tiles can be tested for bounding volume ray intersection (at S526), ​​that is, because a "hit" AABB may not produce an intersection primitive (or the closest intersection primitive for a non-occluding ray), all sub-tiles will generally be tested for intersection regardless of ray type (either done all at once in advance or during a subsequent round). An exception is when testing occluding rays (during a simultaneous traversal), during which testing of any pending sub-tiles can be stopped immediately after a successful (i.e., "hit") primitive intersection test of an occluding ray. However, in general, in response to at least one hit, for each sub-tile intersected at S526, the method returns to S510 via path D. If the hierarchical bounding volume of the sub-tile is proven to contain only primitives at the next geometric LOD, no further tessellation will be performed at S510.

[0140] Figure 5A method of traversing the PLAS from the perspective of a single ray is shown, however, parallel / concurrent computation is also contemplated, for example, using multiple ray tracing units 102 (or multiple sub-ray tracing units 108, 110, 112, 114, 116, etc.) that have access to a shared cache or memory 104. In both parallel and serial computing implementations, some or all of the hierarchical bounding volumes generated as part of generating the PLAS may be cached. In a parallel implementation, any generated node of the PLAS may subsequently be used concurrently with other rays. Typically, even in a serial processing implementation, nodes of the PLAS may be reused, without having to be regenerated, for subsequent rays of a given tile and / or for rays bundled together (e.g., for one or more coherent rays).

[0141] Consistent with the possibility of traversing multiple PLAS structures or multiple parts of the same PLAS structure (more likely) in parallel, the method can support grouped tracing. In a grouped tracing scheme, the method is performed on a batch of rays (e.g., bundles or coherence rays) in parallel. This means that multiple rays are "in flight" at the same time, but preferably, parallel rays will be processed with multiple groups of testers in a SIMD manner. As the box test proceeds, the structure of the PLAS is stored for one or more rays along with the parameters for tessellation and any sub-tile hierarchy bounding volumes. The results can then be copied as input across multiple intersection test units 112 or 114 and / or tessellation modules 116 (or stored in a shared cache to which the testers have shared access), so that other bundles / coherence rays can reuse previously calculated tessellation (e.g., sub-tiles, sub-triangles) and sub-tile AABBs. This has the following advantages: the tester group is more likely to be saturated and therefore resources can be used most efficiently. At the same time, it can also avoid wasting computation time associated with regenerating tessellation data and hierarchy bounding volumes.

[0142] Therefore, although each ray traverses its own specific version of PLAS for a given patch, it is advantageous to exploit the commonality between the topologies of many different PLAS versions as much as possible. In other words, the disclosed embodiments utilize the consistency of the ray by "gathering" the ray on the nodes of the hierarchical structure, so that multiple rays can be tested for the same bounding volume / primitive at the same time. This helps to improve the utilization of our bounding volume / triangle tester. Therefore, even if each ray is associated with a slightly different mosaic factor, if it generates the same sub-patch or primitive as another nearby ray, it is also advantageous to process the ray (and therefore utilize at least part of the same data) at the same time. By encapsulating the ray in this way, it is likely to cause the sub-geometry to overlap further away from the traversal, so that for multiple levels of detail, each grouping can remain active (i.e., not split / merged). There are two general methods to achieve this synergy. The first method, as described above, is by collecting / bundling the ray group into the grouping to be tested in parallel for the same node of the tree. Alone or in combination with this method, parts of the PLAS can be cached for retesting similar (e.g., coherent) rays. The former approach ensures that the utilization of the testers is improved (ie, the tester bank is saturated), and the PLAS cache reduces the overall computational workload.

[0143] Figure 6a , Figure 6b and Figure 7a , Figure 7b Shows Figures 4a to 4d An alternative implementation that shows the traversal with Figure 5 Consistent PLAS approach.

[0144] Figure 6a Shown with Figure 4a The same patch 204 in FIG. 1 is bounded by AABB 302a and (conservatively) filled AABB 302b. Figure 4a A different ray 602 intersects the fill bounding box 302b at the intersection point 604. This intersection test corresponds to step S508, because the tile 204 and the ray 602 have already been converted to tile space. For convenience, the tile is shown as already tessellated, but tessellation (i.e., subdivision) of the tile 204 occurs subsequently in step S510 in response to the "hit" 604. Thus, Figure 6aSub-tile 610 is shown in a state processed according to S512 (i.e., after having been tessellated). After tessellation, sub-tile 610 is selected for consideration in the next step. According to step S512, it is determined that the sub-tile does not currently contain any primitives (the two triangular sub-units in sub-tile 610 can be further subdivided and therefore cannot be considered as primitives at this stage). Since S512 determines that there are no primitives, it is inferred that sub-tile 610 contains one or more sub-tiles to be further subdivided, i.e., it is inferred that S514 is answered in the affirmative. Therefore, the method proceeds to step S516, where a new sub-bounding box is generated around sub-tile 610.

[0145] Figure 6b A filled AABB 606b is shown that has been generated around sub-tile 610 and based on min / max displacement data and / or vertex normal data, and / or further filled with additional fill values ​​conservatively. Filled sub-tile bounding box 606b is generated according to S516. Ray 602 is seen to intersect AABB 606b at "hit" point 608, corresponding to the intersection test of step S526. Although Figure 6a or Figure 6b (or Figure 5 ), but the other three sub-tiles have their own sub-tile AABBs that can be generated and tested for ray 602. For example, steps S516 and S526 are preferably iterated to test each of the four possible sub-tile AABBs in turn to determine which, if any, intersects ray 602. In response to a successful intersection 608 (corresponding to step S526), ​​path D is followed and a new tessellation pattern of sub-tile 610 is generated (consistent with S510). Figure 6b The new mosaic geometry is displayed in . Then, according to step S512, it is determined whether the new mosaic sub-tile 610 contains any primitives. After the second mosaic step of S510, Figure 6b The partial tessellation of sub-tiles 610 shown in represents a second LOD.

[0146] Consistent with S512, confirmed Figure 6bThe tessellated sub-tile 610 shown in does contain primitives. Specifically, four primitives are detected, corresponding to four triangles that are not contained within the quadrilateral 706 indicated by the dashed boundary. These four primitives are displaced (not shown) and tested for intersection with the ray 602. The displacement and iteration may be performed sequentially (consistent with the iterations at steps S518, S520, and S522). Preferably, to improve the utilization of the test cells, all primitives may be displaced prior to intersection testing (although the improvement in utilization depends on the number of primitives compared to the number of primitive-ray intersection test cells). In this case, none of the four primitives currently identified within 610 intersects the ray. Therefore, after testing the last of the four primitives, S522 determines that all currently identified primitives within the tessellated sub-tile 610 have been tested. The remaining sub-quadrilateral 706 is then tested because step S514 (via branch (2)) is performed before, after, or simultaneously with path (1). This sub-patch 706 within the sub-patch 610 may be referred to as a second-order sub-patch.

[0147] Figure 7a A second-order (axis-aligned) hierarchical bounding volume 704a is shown that has been generated around the second-order sub-tile 706 in accordance with S516 (preferably zoomed in to the conservatively filled AABB 704b). In step S526 (a second time in our example traversal), the ray 602 is tested for intersection with the filled sub-AABB 704b. In response to a "hit" 702, a determination is made as to whether the second-order sub-tile requires further tessellation in step S510 (via path D). In this case, it is determined that the sub-tile 706 does not require further tessellation, and therefore it is implicitly determined (as would be determined in S512) that the second-order sub-tile contains primitives (in this case, only primitives). Therefore, in step S526, the ray 602 is tested for intersection with the filled sub-AABB 704b. In step S526, the ray 602 is tested for intersection with the filled sub-AABB 704b. In response to a "hit" 702, a determination is made as to whether the second-order sub-tile requires further tessellation (via path D) in step S510. In this case, it is determined that the sub-tile 706 does not require further tessellation, and therefore it is implicitly determined (as would be determined in S512) that the second-order sub-tile contains primitives (in this case, only primitives). Figure 7a In the example, two triangles in sub-patch 706 are determined ( Figure 7b 710a, 710b) in S510a are primitives, and no more tessellation is required according to the tessellation indication, and it is determined through inference that the two triangles are primitives (corresponding to the result “yes” of S512).

[0148] Figure 7bThe steps following S518 are shown. Primitive displacement data including (linearly) interpolated vertex normals 708a, 708b, 708c are obtained for a first primitive 710a. Primitive 710a is then shifted by moving each of its vertices in the direction of its respective normal, and by an amount according to further shift data (corresponding to a displacement map / function (e.g., texture) and / or minimum and maximum displacement values) to obtain a displaced primitive 712 that is generally located outside the plane (i.e., parameter / domain space) of the tile 204. At step S520, the displaced primitive 712 is tested for intersection with the ray 602 (e.g., by the TTU 114), and a "hit" 712 is determined. After a hit, the method proceeds to step S524 to shade the primitive. As shown by the dashed arrows after S524, depending on the exit condition of the ray, other primitives in the sub-tile (e.g., primitive 710b) may be shifted and tested for intersection with the same (non-occluding) ray 602 even after a hit. Otherwise, after all primitive intersection tests, traversal of the new tile and new corresponding PLAS begins via path A back to step S502.

[0149] Figure 8a to Figure 8g Seven different local subdivision patterns are shown after subdividing a (sub)tile from one level of detail to the next. In this set of examples, all triangles (i.e. bounded only by solid lines) are primitives, i.e. they cannot be further subdivided. Bold squares are sub-tiles that contain multiple primitives in certain configurations, which can only be found by further subdividing to a higher level of detail. Figure 8a A minimum tessellation pattern is shown, where the (sub)tile is split in two between two vertices, forming two rectangular primitives 800 (and in some examples may not be considered a possible initial tessellation pattern for a quadrilateral tile). Figure 8b has been subdivided to provide four equally sized primitives 802. In a preferred embodiment, as described in detail below, the quadrilateral is generated by creating a new vertex at the center of the quadrilateral and drawing four new edges between the original vertex corners and the new center vertex. Figure 8b The mosaic pattern shown in . Figure 8c and Figure 8d Two (sub) patches are shown with further subdivision to produce a size of Figure 8b A smaller primitive 804 that is half of the primitive 802 in FIG.

[0150] exist Figures 8a to 8d In , (sub) tiles contain only primitives. If these (sub) tiles are Figure 5 If the test is performed, the primitive can be shifted and tested iteratively, i.e., the operations of S518 and S520 are repeated, including any (intermediate or subsequent) necessary shading. Generally, in embodiments of the present disclosure, sub-triangles (802, 804) that do not together form a sub-quadrangular shape are not further tessellated and are therefore considered primitives. Figures 8a to 8f All sub-triangles formed in are formed after a subdivision operation according to S510 and therefore have the same geometric LOD, even though the triangles may have different sizes (e.g., they differ by "half" LOD). Figures 8a to 8f All triangles in (except the triangles bounded by the dashed lines in 8e and 8f) are considered primitives because none of their neighboring sub-triangles can form a sub-tile with them (eg, quadrilateral 806), so they cannot be further subdivided.

[0151] In alternative examples that will be apparent to one skilled in the art, hierarchical bounding volumes other than cubic bounding volumes may be generated (e.g., prisms of triangular tiles, or hierarchical bounding volumes with simple intersection tests (e.g., spheres)). Alternatively, cubic bounding boxes (e.g., AABBs, OBBs) may be generated around non-quadrilateral tiles. In either case, this may affect efficiency due to more / fewer hierarchical bounding volume hits, since such hierarchical bounding volumes more or less represent the associated tile volume (when fully displaced).

[0152] Figure 8e , Figure 8f A subdivided tile is shown with a mixture of sub-tiles 806 and primitives 802, 804. Such tiles containing mixtures are processed similarly to Figure 6b , i.e., where sub-tile 610 contains both primitives and sub-tile 706, and a bounding box is generated around the primitives and sub-tiles (and where it is not known in the first instance whether the triangle in 706 is a primitive). In the mixed case, the primitive is tested for intersection with the ray (i.e., at S518 and S520). After, before, or (preferably) at the same time as all primitives have been tested (particularly, for occluding rays, if all primitives have been tested and no primitive intersects the ray), any sub-tile (e.g., Figure 8e The sub-tiles 806 in the image have a hierarchical bounding volume created around them. The bounding volume is then tested for intersection, and if it intersects with the ray, the enclosed sub-tiles are further tessellated. These three operations are performed according to steps S516, S526, and S510. For a tile that only contains sub-tiles (e.g., Figure 8g ), test all sub-patches for intersection with the ray, i.e., generate a conservative AABB around each patch and test each AABB for intersection with the ray.

[0153] In general, the method of iterative tessellation and intersection testing aims to exhaust (ie, continue tessellation until no further tessellation operations are indicated) all sub-tiles until any non-intersecting sub-tiles are excluded and only primitives remain. Figure 6a , Figure 6b and Figure 7a , Figure 7b= means that the primitives generated as the PLAS is traversed are usually tested for intersection first, before testing sub-tiles and (possibly) performing another tessellation step. For example, Figure 6b The sub-patch 610 shown in FIG. Figure 8e The pattern in Figure 6a , Figure 6b and Figure 7a , Figure 7b The sequence of 1 and 2 indicates that the four primitives (804, 802) are first tested for intersection (e.g., using TTU 114) before the hierarchical bounding volume around sub-tile 706 is tested with BTU 112. In a serial implementation, this order may be performed because early "hit" primitives can help eliminate further intersection tests. However, as described above, primitive testing (based on the order from Figure 5 Path (1) starting from S512 in Figure 5 Path (2) starting from step S514 in is completed at the same time.

[0154] For the preferred mosaic method, Figure 8a to Figure 8g represents all possible local tessellation patterns (i.e., from one geometric LOD to the next), including (sub)tiles containing only primitives and primitive / sub-tile mixtures (which contain primitives that can be grouped into sub-tiles, such as forming quads). Other tessellation methods may have other sets of local tessellation patterns. Therefore, the seven tessellation patterns represent the seven topological classes that can be formed at each stage in the implicit PLAS hierarchy (at a specified LOD). For memory storage purposes, it is helpful to predetermine a set of node structures that a PLAS may have. In particular, it is advantageous to know the "worst case" number of primitive or sub-tile nodes that will be stacked in local memory (e.g., for a depth-first traversal). For example, Figure 8d represents six primitive nodes, and Figure 8f represents 3 primitive nodes and 2 sub-patch nodes. The skilled person will appreciate that the categories shown take into account symmetry, i.e. all possible reflections and rotations of the pattern. For example, Figure 8b has 4-fold rotational symmetry plus reflection symmetry, so only 1 version exists. In contrast, Figure 8c It does not have rotational symmetry, but it does have reflectional symmetry, so there are four potential versions (all sharing the same node structure, i.e., five primitive nodes).

[0155] Figure 9a and Figure 9b shows how the tile span can be used to compute a bounding box around a sub-tile in tile space. In some examples, the bounding box can be constructed to closely delimit the edges of the tile, e.g., with Figure 3204 in the same manner as the hierarchical bounding volume 302a around the tile 204 in . However, such a tight box may not take into account the fact that the primitive may protrude beyond the boundaries of the tight bounding box once it is displaced. If the hierarchical bounding volume does not delimit the entire space in which the displaced primitive may exist, some intersection tests may result in "false negatives". In this context, a false negative refers to an intersection test that incorrectly returns a "miss" result when in fact the ray should have intersected the bounding volume (e.g., box) because the ray would have intersected the displaced primitive within the bounding volume. False negative results in intersection tests are disadvantageous because they may result in the formation of "cracks" or holes in the final rendering. Algorithms that avoid the appearance of cracks are called "watertight". Therefore, the way the hierarchical bounding volumes are created takes into account the possible degree of displacement of the primitives contained within the enclosed tiles.

[0156] The tiles represented in tile space are planar, and the primitives contained within the tiles may not yet have been formed (by tessellation). In addition, primitives within planar tiles are therefore not displaced to their final 3D positions. Therefore, prior to the displaced primitive and triangle intersection testing phase (e.g., step S518), it is unclear how far outside the boundaries of the 2D tile the primitive will be. Therefore, the hierarchical bounding volume around the tile is filled based on the worst-case displacement of the primitive within the tile.

[0157] Figure 9a The tile 900 is shown viewed along the XY plane and is contained within a bounding box 902, the faces of which are flush with the edges of the tile 900. The height of the hierarchical bounding volume 902 is given by Z 最小值 and Z 最大值 OK, these values ​​indicate the maximum vertical displacement of the primitive below and above the patch plane. 最小值 and Z 最大值 Depending on the level of detail (LOD) of the tile or sub-tile considered (in the conventional example, Z 最大值 is a non-negative number, and Z 最小值 is a non-positive number, for example, the Z of the initial level bounding volume 最小值 =-Z 最大值 ). For the entire patch (e.g., Figure 2 and Figure 3 204), these values ​​are given by the original user-provided interval [Z 最小值 , Z 最大值 ] is given. For a sub-patch (e.g., Figure 4b Sub-patch 404 in Figure 6b The sub-patch 610 and Figure 7a The values ​​are from the original user-provided interval [Z 最小值 , Z 最大值 ] and a sequence of predetermined normalization values ​​(e.g., 8-bit values and )Derived sub - intervals. It should be understood that Z 最小值 and Z 最大值 are used to denote all the minimum / maximum ranges for each level of detail, although each sub - patch at each LOD represents a different quantized sub - interval. For example, the value of [Z 最小值 ,Z 最大值 can be updated between different sub - patches at different LODs, from the parent sub - patch at a lower LOD (e.g., LOD0 or a previous LOD), according to [Z 最小值 ,Z 最大值 =[a,b]*[Z 最小值 ,Z 最大值 :=[Z 最小值 +a(Z 最大值 –Z 最小值 ),Z 最小值 +b(Z 最大值 –Z 最小值 )], where Z 最小值 and Z 最大值 are fixed - point, floating - point, normalized or un - normalized numbers, and a and b are predetermined fixed - point values (which may be decompressed / decoded), e.g., including 8 - bits, as in Fig.10 , where a < b (and thus can be considered as a sub - interval), and where a and b are considered as normalized values, i.e., the interval [0, 1] (e.g., by re - scaling them by their maximum value). Since Z 最小值 and Z 最大值 depend on the LOD, for higher LODs, the minimum / maximum displacement values also depend on the region: for example, the Z Figure 4c and Z 最小值 of the AABB of sub - patch 404 in Figure 6b can be different from the Z Figure 7a and Z 最小值 of the AABB around sub - patch 610 in Fig.10 . Similarly, the minimum / maximum values of the second - order sub - patch 706 in Fig.11a are different. Fig.11b and describe the calculation and storage of these values.

[0158] Figure 9a To form the first - level bounding volume 902, only the vertical range of the bounding volume 910 needs to be provided. In this example, the vertical displacement 910 is calculated by interpolation from the vertex normals 908a, 908b (the normals 908a, 908b and 910 are intended to have the same length, however, for clarity, Figure 9a not drawn to scale). The interpolation is done in Figure 9b (instead of ) and

[0159] ) because vertex normals 908a and 908b have relative horizontal components (i.e., they do not face the same horizontal direction). Therefore, different directions mean convexity, and a "worst case" vertical normal 910 is calculated based on vertex normals 908a and 908b. To obtain a conservative hierarchical bounding volume 912, the lateral displacement of the primitive within the tile must be obtained or conservatively estimated. The lateral displacement relative to the X axis of the tile 900 is conceptually indicated by two primitive displacement boxes 904a, 904b (such boxes may not actually be calculated during the generation of the filled hierarchical bounding volume 912). The lateral displacement range 904a, 904b is indicated by vertex normals 908a, 908b. A quadrilateral tile will initially be associated with four vertex normals, i.e., one for each vertex. For any new vertex generated by the tessellation of the tile, a new vertex normal is calculated / estimated (e.g., by linear interpolation). The vertex normal indicates the direction and magnitude of the primitive within the tile, and can therefore be used to calculate the "worst case" primitive displacement. In this way, primitives do not actually have to be shifted to compute the hierarchical bounding volume. Furthermore, at this stage, the primitives may not yet have been tessellated, so tessellation is not required before building the hierarchical bounding volume for the tile or sub-tile.

[0159] All displacement data (i.e., minimum / maximum displacement values ​​and vertex normals) are tile characteristics, and therefore can be stored as per-tile data together with the original acceleration structure (AS), and can be defined relative to world or instance space. Since the magnitude and direction of vertex normals need to be defined in the tile space traversed by the PLAS, they can also be converted to tile / domain space on the fly before calculating the range of the hierarchical bounding volume. Alternatively, they can be transformed offline, and therefore the displacement data can be stored in the AS defined relative to the tile space (although the world / instance space normals can still be stored separately for other purposes, such as as input for rendering calculations in the shader). The Z-axis plane of the tight hierarchical bounding volume 902 and the lateral plane of the displacement boxes 904a and 904b of the primitive can be used to determine the range of the fully filled hierarchical bounding volume. In the case of a parent tile, the generation of the filled hierarchical bounding volume of the tile corresponds to S506, and corresponds to S516 in the case of any child tile.

[0160] Figure 9b An alternative example is shown, showing that vertex normals 916a and 916b may point in the same direction as the lateral axis (ie, the X or Y axis), which is consistent with Figure 9a (where vertex normals 908a and 908b point in directions opposite to the lateral axis). Since 916a and 916b face the same horizontal direction, the worst-case vertical displacement is actually known, so there is no need to interpolate vertex normals to calculate additional vertical displacements (e.g., Figure 9a910 in FIG. 900 ). However, if the direction of any vertex normal is not vertical, it still indicates that there is a lateral displacement outside the boundary of the patch 900 , which means that the size of the generated conservative bounding box 912 is larger than the size of the patch 900 it delimits. Figure 9a and Figure 9b Applicable to any child patch and parent patch, that is, applicable to child patches at any detail level.

[0161] Since the extent of displacement that determines the conservative hierarchical bounding volume is generated dynamically, i.e., when a partial tessellation is generated during the traversal of a ray through a patch, the PLAS may not be known during the TLAS or BLAS traversal. In other words, the PLAS is implicitly generated dynamically during the tessellation. This is in contrast to typical ray tracing schemes, where the complete node structure of the object, i.e., the structure of the BLAS, must be generated before ray tracing operations (e.g., intersection tests) can proceed. In fact, depending on the heuristics used to generate the splitting planes, the generation of the BLAS may be a computationally expensive process and may be a bottleneck in the process. Therefore, the advantage of the ray tracing tessellation method is that the node structure of the PLAS does not need to be known in advance. As previously described, once part or all of the PLAS is known after traversing the ray, the nodes of the structure (i.e., bounding volumes, primitives) can be saved (e.g., cached) and reused for coherent and / or bundled rays that can use the same nodes for their specific PLAS. However, this reuse may not be applicable to all rays, because the PLAS is a function of the ray and may therefore be completely different for incoherent rays (except for the root node).

[0162] In addition to generating extended hierarchy bounding volumes based on primitive displacement ranges, it is also advantageous to conservatively "fill" the hierarchy bounding volumes to provide an additional degree of overlap between the hierarchy bounding volumes of adjacent tiles. A "conservative" hierarchy bounding volume, or "conservative" AABB, as described in the present disclosure, refers to a hierarchy bounding volume that has been expanded or filled along at least one axis to further reduce false negative tests and thereby ensure watertight rendering. Depending on the arithmetic precision of the intersection tests between rays and the hierarchy bounding volumes, some intersection tests may result in "false negatives" if the box is not conservatively filled. By sequentially filling the hierarchy bounding volumes around the tile and any sub-tiles, avoiding false negatives is inherently part of the bounding volume ray intersection test (especially when the bounding volume ray intersection test does not have an internal mechanism for reducing false negatives). Further padding (corresponding to the additional padding value) is provided by Figure 9aThe additional padding is indicated by the small increment 914 shown in . The additional padding ensures watertightness in the final rendering by reducing false negatives in the intersection tests. The amount is not chosen to be too large so as not to increase latency (i.e., unnecessarily filling the hierarchy bounding volume will capture more rays that do not intersect the primitives within the tile). The small amount 914 can be calculated in a variety of different ways that will be understood by those skilled in the art. As described above, the additional padding value is a multiple of the machine precision, which represents an amount equal to an upper limit on the relative approximation error due to rounding of the floating point precision used by the bounding volume ray intersection test algorithm. This type of padding may be particularly suitable for non-zero normal floating point numbers.

[0163] Alternatively, the smallest absolute value (or multiples thereof) representable by software or hardware may be added, also known as the underflow level (UFL). This type of padding may be particularly appropriate for zero or denormal floating point numbers ("inf" or "nan" floating point numbers cannot be padded, but can still be handled as special exception cases).

[0164] Figure 9a This small value added in the X and Z dimensions (Y axis not shown) of the bounding volume 902 is shown for illustration purposes only. This small padding value 914 is generally optional, but may be incorporated into one or more dimensions in order to extend the bounding box 912 along one or more axes (to reduce false negatives and thus achieve or improve watertightness and determinism in intersection testing). Conservatively padding the hierarchical bounding volume in this manner has the additional advantage that the need for enhanced precision (e.g., infinite precision) intersection testing or two-part intersection testing may be avoided. In some general ray tracing implementations, the hierarchical bounding volume may be tested with enhanced precision (i.e., the rays and / or box geometry are represented with more mantissa and / or exponent bits than found in standard single floating point precision or even double floating point precision), or "miss" results may be retested with higher precision to avoid more false negatives. In the present disclosure, these safety measures may be avoided because the hierarchical bounding volume around the patch is conservatively padded. In addition, by providing conservative padding in the hierarchical bounding volume, the precision used by the box test unit 112 may be reduced. This may provide another advantage in that a BTU 112 implemented in hardware may implement a smaller silicon footprint by reducing the precision used by the hardware, thereby reducing the size of registers and / or arithmetic operations (e.g., adders, multipliers, etc.) in the hardware. This advantage may offset the fact that edge-extended bounding boxes may result in increased box hits, meaning that slightly less geometry may be culled.

[0165] Fig.10 The generation and storage of minimum / maximum displacement data (i.e., Z 最小值 and Z 最大值 ) method, such as Figure 9a and Figure 9b In this example, Figures 4a to 4d , Figure 6a , Figure 6b and Figure 7a , Figure 7b , the tiles (represented in domain space) are square. However, other tile geometries are possible, and the skilled person will appreciate that the displacement map can be adapted accordingly by adapting the size of the map (e.g., by an affine transformation). The sampled displacement map for texture value 1000 represents a sampling of the texture at the highest possible tessellation level (i.e., the highest texture LOD). Map 1000 represents the vertical displacement position. The detailed displacement map for texture value 1000 contains 81 (texel) values ​​corresponding to 81 possible vertices at the highest level of detail, indicating an 8×8 maximum tessellation grid (but in reality more vertices will appear, e.g., for a 64×64 maximum tessellation grid). The two initial values ​​provided by the user do not necessarily always represent minimum or maximum values: for example, compared to the minimum and maximum grids, the user-provided values ​​may correspond to the endpoints and width, or the center and half-width, etc. For the avoidance of doubt, the detailed displacement map for texture value 1000 does not represent the initial displacement data provided by the user, but rather a sample of the user-provided data.

[0166] Displacement data is needed to generate the bounding volume of the tile and sub-tile hierarchy at each geometric LOD. For example, at the lowest geometric LOD, LOD0 (e.g. Figure 3 1008a and 1008b of the parent tile in ), only one minimum and one maximum need be considered (i.e., the corresponding minimum value of 0 and maximum value of 255 in tile 1000, corresponding to 0 and 1 as normalized values, respectively). These can be stored implicitly (i.e., no number of bits are required), but the original user-provided interval that provides the overall scaling of the normalized values ​​can still be stored as per-tile data. Fig.10 The detailed map 1000 in is considered normalized to the interval [0,1] and encoded with eight bits, so it can be predetermined that the minimum and maximum values ​​will be 0 (considered as a normalized value of 0) and 255 (considered as a normalized value of 1), respectively. These values ​​can be stored as unsigned integers to reduce storage requirements.

[0167] To create hierarchical bounding volumes from a pair of min / max values, the displacements for any LOD can be derived / sampled from the detailed map 1000 (e.g., by repeated bilinear interpolation). However, this process would take time and be wasteful to perform dynamically for each hierarchical bounding volume that needs to be created, particularly for low geometric LODs (e.g., at tile scales 1008a, 1008b) where 81 values ​​need to be sampled to compute a single pair of min / max displacement values. Thus, the level of detail of the highest texture LOD represented in the map 1000 is excessive and unnecessary when used for lower geometric LODs. Therefore, separate minimum and maximum displacement tables for each LOD can be pre-determined to make displacement data retrieval more efficient (in other words, separate texture LOD min / max tables are generated and designed to be consistent with the different geometric LODs of the mosaic). This LOD-dependent mapping technique is called mipmapping, and the series of displacement tables for each LOD is called a min / max mipmap. In Fig.10 The minimum 1002a and maximum 1002b tables for the highest level of detail (“LOD3”) of the min / max mipmap are shown in FIG.

[0168] Fig.10 The min / max mipmaps have been conservatively generated so that each cell in the min map / table / grid 1002a corresponds to the lowest value in the corresponding 2×2 tile of the grid 1000 (which is sampled from the “original” user-provided displacement map at the tessellated vertex position). Each cell in the max grid 1002b corresponds to the highest value in the corresponding 2×2 tile of the grid 1000 (which is sampled from the “original” user-provided displacement map at the tessellated vertex position). Specifically, the transformation from the original sampling grid 1000 to the LOD3 grids 1002a and 1002b is as follows: For each value at a cell position (m,n) in the LOD3 grid, the value selected for that cell is the minimum (for 1002a) or maximum (for 1002b) of the 2×2 tiles in the sampling grid 1000 defined by the position: For example, cell (1,7) in the min / max LOD3 grid 1002a / b is "81" / "239" (using an indexing system where both m and n start at 1) because the position of the sampling grid 1000 is The lowest / highest value in is 81 / 239 (at the (1,8) / (2,7) positions). Therefore, the 9×9 grid of the original sample value 1000 is transformed into an 8×8 LOD3 grid 1002a and 1002b. Fig.10, the subsequent transitions from LOD3→LOD2 and from LOD2→LOD1, etc. are simpler: Specifically, the LOD(i) min / max tables are divided into 2×2 non-overlapping (i.e., continuous) tiles, and the lowest / highest value in each 2×2 tile forms the value of the corresponding cell in the LOD(i-1) grid. For example: the highest value in the bottom and rightmost 2×2 tiles in the LOD3 max table 1002b is "255", so the bottom-most rightmost cell in the LOD2 max table 1004b (at position (4,4)) is "255". In this regard, it should be understood that the LOD(i) min / max table of size (2 n +1)×(2 n +1). This means that for 0≤i≤n, the resulting min / max texture at LOD(i) in the min / max mipmap will have (2 i )×(2 i ), which advantageously corresponds to the geometry produced by the preferred tessellation mode in the present disclosure (which generates new vertices at the bisection points since it is a power of two tessellation scheme). In other words, the sampled original user-provided displacement map 1000 advantageously has dimensions (and indices) aligned with the maximum number (and positions) of tessellated vertices at the highest tessellation LOD of the tile. Similarly, each min / max map in the min / max mipmap has dimensions (and indices) aligned with the maximum number (and positions) of hierarchical bounding volumes at its corresponding tessellation LOD.

[0169] Subsequent minimum and maximum tables / grids are calculated from these minimum and maximum 1002a, 1002b grids, the principle being to retain the lowest and highest values ​​for a particular region. The two grids of the second highest LOD ("LOD2") each have 16 cells. At this level of granularity, each cell corresponds to, for example, Figure 7a According to LOD2 maps 1004a, 1004b, the sub-tiles may be of the size of the second-order sub-tiles shown in sub-tile 706 in FIG. Fig.10 The displacement map at LOD1 is calculated by the method shown in the minimum LOD1 map 1006a and the maximum LOD1 map 1006b in FIG. Each LOD1 map has four values, where each cell corresponds to a sub-patch equivalent to one-quarter of the area of ​​the parent patch, for example Figure 4b404. Finally, corresponding to the entire tile (e.g., 204), the lowest level of detail ("LOD0") is indicated as a single cell, with a value of 0 (corresponding to a normalized 0) for the smallest tile 1008a and a value of 255 (corresponding to a normalized 1) for the largest tile 1008b. In practice, the values ​​of the LOD0 tile are implicit (i.e., do not need to be stored) in examples where the values ​​are normalized, since they will always correspond to 0 and 2 for n-bit binary values. n -1.

[0170] At each stage of traversing the PLAS, the relevant min / max pair maps can be stored next to the tile or sub-tile (e.g., as per-tile data in the AS, or otherwise stored in a cache), depending on the LOD (e.g., a lower LOD that takes up fewer bytes may be more suitable as per-tile data) to save time in retrieving displacement data. In addition, since the tables are pre-calculated for each LOD, there is no need to query the texture sample based on the displacement data 1000 every time a lower LOD displacement value is needed. Storing 6 tables on three LODs uses more storage space (in this example, 128B+32B+8B=168B) than storing the original displacement map (81B). However, pre-calculating all displacement data that may be needed for each LOD improves the efficiency of the traversal, thereby ensuring that LOD updates can be performed in real time (e.g., frame by frame) in a ray tracing scheme.

[0171] For illustration Fig.10 The table used (i.e., the vertical extent of the bounding volume of the calculation hierarchy) will be Figure 4b Used as an example (although Fig.10 The values ​​in are not intended to reflect Figures 4a to 4d ). In this case, Figure 4a After reaching the first tessellation level of the first level of detail (LOD1) as shown, four sub-tiles can be identified within tile 204, one of which is sub-tile 404. Figure 5 404 and retrieve the sub-tile extents to calculate the size of the AABB. Therefore, the maximum value (in this case, 255) is read from one cell of the LOD1 table 1006b, and the minimum value (in this case, 0) is read from the minimum LOD1 table 1006a. Thus, the upper surface (Z 最大值 ) corresponds to the value 255, and the lower surface corresponds to the value 0. Ultimately, these values ​​have been derived from the full (sampled) displacement map 1000, however, the pre-calculation of the LOD1 min / max table means that Z 最小值 and Z 最大值 Only read from tables 1006a and 1006b respectively.

[0172] Fig.11a and Fig.11b Shows the compression Fig.10 1000). As described above, the minimum and maximum displacement data set value pairs may take up more storage space than the detailed map 1000. However, each pair of tables / grids / arrays may be compressed (i.e., quantized) into a single grid with the same number of cells. Fig.11a This is demonstrated for a table of LOD2 values. Grid 1004a represents a set of minimum values ​​for vertical displacement at LOD2, and 1004b represents the corresponding maximum displacement values. Each cell in each grid / array corresponds to a cell at the same position in the corresponding grid: for example, the minimum / maximum values ​​for the top left cell in grids 1004a and 1004b are 0 and 227, respectively. The inventors have determined that each pair of minimum / maximum values ​​can be encoded in a single value. Furthermore, a single encoded value may require fewer digits than each original value. Fig.11a , a pair of 8-bit displacement grids 1004a, 1004b are compressed 1100 to form a compressed LOD2 table 1104 having 16 values. Thus, data that originally took up 32B of storage space only requires 4B (sixteen 2-bit values) of storage space once compressed, corresponding to an 8x compression factor.

[0173] In the compression table 1104 of this example, a 2-bit compression system is used, where a pair of minimum / maximum values ​​represented by an 8-bit value is encoded into a 2-bit binary value according to the following formula:

[0174]

[0175] In normalized coordinates, max≥128and min≤127 corresponds to [0,1], max,min≤127 corresponds to [0,1 / 2], and max,min≥128 corresponds to [1 / 2,1]. In other words, if both the minimum and maximum values ​​are in the upper half of the interval (≥128), the compressed value is encoded as "10", and if both the minimum and maximum values ​​are in the lower half of the interval (≤127), the compressed value is encoded as "01". If the minimum and maximum values ​​are not in the same half of the interval (for example, if the maximum value is ≥128 and the minimum value is ≤127), the compressed value is encoded as "00". The compression scheme is nested because it works along the hierarchical structure during the PLAS traversal (i.e., from LOD0 to LOD1 and beyond) and is usually performed offline. During compression, the encoded (compressed) value of each consecutive LOD utilizes the encoded value of the previous LOD. In other words, when transitioning from one LOD to the next, the interval is updated. For example, when moving from LOD0 to LOD1, where the current interval of LOD0 is [0, 255] (i.e., corresponding to an 8-bit value in 1008b), the LOD1 encoding for a particular cell is "01". In the above compression scheme, "01" corresponds to max, min≤127, and the normalized interval is [0, 1 / 2]. Therefore, during the transition from LOD0 to LOD1, the 2-bit encoded value corresponding to LOD1 ("01") is obtained for a given cell, and the following update is performed: [0, 255]→[0, 1 / 2]*[0, 255]=[0, 127]. This result is retained and used as input for the next LOD. Advantageously, this means that for each "LODi", the encoded value benefits from 2i bits, and therefore higher precision is obtained further downstream in the hierarchy (where it is most needed). Similar to the compression scheme, the decompression scheme also works downward during the PLAS traversal, however, the decompression scheme can be performed dynamically to benefit from the advantages of compressing data at runtime, such as bandwidth and storage footprint reduction.

[0176] In this example, "11" is reserved to indicate some other characteristic associated with the corresponding sub-tile / primitive. For example, the value "11" may be reserved to encode transparency / validity information (e.g., derived from the alpha channel of the texture), for example, to allow a ray to immediately skip primitive intersection testing or further traversal of the tile sub-quad associated with that value. For example, when a primitive (or sub-quad) is determined to be fully transparent or "invalid" based on the compressed value "11", the intersection test may be immediately avoided (because it is considered fully transparent across the sub-tile, and therefore no ray intersection should occur in that sub-region.

[0177] The skilled person will recognize that the binary encoding is customizable and can be used to represent any choice of range, provided that the set of encodings includes intervals spanning the entire range. For example, a 3-digit encoding system (i.e., having eight possible values) can be used to define eight different minimum / maximum ranges (perhaps with some reserved encodings to support additional functionality).

[0178] Some information is lost during encoding due to representing 8-bit value pairs as 2-bit values ​​(i.e., quantization). Therefore, when the compressed values ​​are read and the min and max values ​​are calculated, the resulting min / max values ​​may be different from the original values. This is acceptable, provided that the compression is done conservatively, i.e., to ensure that the range encoded by the compressed values ​​encompasses (i.e., contains) the range defined by the original min / max values.

[0179] Thus, the compressed table 1104 may be decompressed 1102 according to the inverse of the above equation to provide a decompressed minimum LOD2 mesh 1106a and a decompressed maximum LOD2 mesh 1106b. It can be seen that some of the original values ​​in the LOD2 tables 1004a, 1004b have changed during compression, however, the compression is conservative such that the original minimum values ​​are at best rounded down and the original maximum values ​​are at best rounded up. Therefore, the compressed values ​​still provide displacement values ​​that will generate a conservative filled bounding volume and therefore impart water tightness at least with respect to the box intersection test. In some cases, compression does not result in loss. For example Fig.11b As shown, the LOD1 tables 1006a, 1006b are compressed 110 to form a 4×4 compressed grid 1108 having values ​​“00”. After decompression 1102, the decoded values ​​of the min / max grids 1110a, 1110b are the same as the values ​​in the original grids 1006a, 1006b. Furthermore, as explained above, generally due to the nested nature of compression, higher precision is achieved in the compressed values ​​further along the traversal of the hierarchy, and therefore fewer errors are produced.

[0180] In general, this method of compressing displacement values ​​has three advantages. First, fewer values ​​(and in some cases only a single 2-bit value) are required for each sub-tile (e.g., each quadrilateral) to determine the data used to construct the conservative bounding volume. This is consistent with the Fig.10The example in contrasts the two 8-bit values ​​that would otherwise be read from the table. Second, the compressed value takes up less storage space (e.g., instead of storing two n-bit numbers (e.g., n=8), for example, only one 2-bit or 3-bit number is stored). Therefore, some LOD grids (e.g., LOD1, LOD2, and LOD3) of the compressed minimum / maximum mipmap can be stored as part of the limited per-tile data in the acceleration structure (AS), and / or more higher LODs can be stored in local memory (e.g., cache) at once (due to the reduced footprint). In a third aspect, due to the greatly reduced storage requirements, bandwidth and latency are significantly reduced because the number of global memory fetches is reduced overall, which is expensive because they have associated longer latencies. For example, in the case of 16B reads, using the compression scheme, the entire compressed LOD3 table can be fetched at once, i.e., with a single 16-byte read (compared to the eight separate 16B reads required to fetch the uncompressed LOD3 table).

[0181] Mosaic method

[0182] The foregoing examples describe methods of combining tessellation of tiles with a ray tracing pipeline to generate the required LOD for a given ray on the fly. In rasterization embodiments, various methods of performing tessellation (i.e., subdivision) of tiles are known. The overall goal of tessellation in any rendering scheme is to produce a tessellated pattern with the desired subdivision level for each frame while maintaining the minimum number of visual artifacts and the minimum space / time complexity.

[0183] An exemplary algorithm type is described with respect to ray tracing, which confers specific advantages in ray tracing schemes, particularly removing visual artifacts from the final rendering and ensuring a watertight rendering. With respect to rasterization schemes, this example is disclosed in GB patent GB2533443B, the contents of which are incorporated by reference. This approach has the advantage of avoiding several types of mosaicking artifacts, including snapping (the effect of a large amount of mosaicking occurring instantaneously, known in other discrete, e.g., "integer" or other "power of two" methods), popping (a visual artifact where primitives suddenly change position / orientation, which occurs primarily when newly formed vertices are immediately displaced), cracking or "holes" (where an observer can see through the object, typically due to internal T-junctions or inconsistent mosaicking at patch edge boundaries), and wandering (where the geometry appears unstable due to the position of displaced vertices moving in domain space).

[0184] The inventors have identified that the above-described tessellation scheme has several specific and surprising advantages when applied to a ray tracing scheme:

[0185] 1) It performs tessellation into axis-aligned triangles and squares, which is particularly convenient for forming AABBs as bounding volumes;

[0186] 2) Once created, vertices do not move in domain space, so once created, the bounding volume is also static and does not need to be "refitted" as the tessellation factor changes, such as in fractional increments. This is in contrast to other known ray tracing embodiments, where "refitting" or "rebuilding" is required in order to render the scene at a higher geometric LOD;

[0187] 3) This is a "power of two" scheme, i.e., the subdivision involves bisecting the edges and triangles. This results in a 2×2 arrangement of sub-quadrilaterals that subdivides the square, making it straightforward to define the bounding volume of a (sub-)quadrilateral patch as the union of the bounding volumes of its corresponding sub-(sub-)quadrilateral patches;

[0188] 4) It is a recursively defined tessellation scheme, meaning that it coincides conveniently and surprisingly with the recursive traversal approach. In particular, the geometry (and similarly, the tessellation) LOD is aligned with the traversal LOD (both are also aligned with the texture LOD in the min / max mipmap chain).

[0189] This mosaic method uses the following parameters:

[0190] The mosaic threshold. This value is usually 0.

[0191] The tessellation factor (TF) V of the vertex. This has a value of at least 0 (no tessellation) and typically

[0192] No more than 6 (maximum tessellation). This involves taking the logarithmic tessellation amount to base 2, e.g.

[0193] The embedding factor 5 corresponds to 2 5 = 32 subdivisions.

[0194] The tessellation increment. This encodes the V (Tessellation factor) The amount by which the value is reduced.

[0195] The increment is usually 0.5 (which in practice corresponds to a tessellation representing "half" of a geometry LOD).

[0196] The tessellation steps coincide, i.e., two tessellation steps represent a transition to the next integer LOD).

[0197] α,f A symmetric function that gives the "average" of two, three, or four tessellation factors. α defines a similar function Where f(τ) =

[0198] min(α(τ),min(τ)+Δ)

[0199] The reason for using both α and f to calculate the updated tessellation factor is to avoid "T-junctions" in the geometry, which would cause cracking in the rendering. Therefore, to ensure there is no cracking, a modified version of f, α, is used instead.

[0200] Fig.12a The initial stages of tessellation of a quadrilateral patch / domain are shown. In a first example, a quadrilateral domain 1202 with four vertices labeled TL, TR, BL, BR is fed into a tessellation device (e.g., tessellation module 116). A new vertex 1206M is formed at the center of the quadrilateral. The tessellation factor associated with the center vertex M is given.

[0201] τ M =f(τ TL ,τ TR ,τ BL ,τ BR ).

[0202] Next, all tessellation factors associated with all five vertices are reduced by Δ (because one level of tessellation has occurred) to obtain an updated tessellation factor. Four new edges are then created, each between one TL, TR, BL, BR and the new vertex M. In other words, four new triangle sub-units are formed within the subdivided quadrilateral 1204. Depending on the new tessellation factor, the four triangle sub-units are then tessellated according to the algorithm, such as Figure 12b As shown in Figure 12b The steps shown in have been applied to Fig.12a After each of the four triangles in , LOD1 will be reached. From this stage on, each LOD increment will include two tessellation steps. The quadrilateral patch 1202 is a rectangle (preferably a square for numerical convenience) in domain and patch space, but the shape it represents in instance or world space (i.e., in a 3D environment where it forms part of the surface of an object) can be a different shape (e.g., any quadrilateral: parallelogram, rhombus, trapezoid, kite-shaped quadrilateral, increment, irregular trapezoid, etc.). Tessellation is usually performed in domain / patch space rather than in world or instance space.

[0203] Figure 12b Indicates how to perform tessellation on the triangle cell 1208, for example, Fig.12a The four subunit triangles in the tessellated quadrilateral 1204. The triangle patch / subunit 1208 is considered to be a set of three vertices (T, L, R) in order. The "first" vertex is considered to be the most vertex (e.g. Figure 12b ). Patch tessellation occurs as follows: Given a triangle patch, tessellation occurs if and only if the tessellation factor of the triangle satisfies the following condition: (τ L >τ0∨τ R>τ0). In the case where this condition is met, the new vertex M is formed as the bisector of edge LR, that is, at the point that bisects the longest edge of triangle 1210. Once formed, for the vertex LR defined by τ M =f(τ L ,τ R ) to calculate the tessellation factor for the new vertices given.

[0204] Next, two sub-triangle sub-cells are formed (M, T, L) and (M, R, T) to obtain a tessellated / bisected triangle sub-cell 1212. For each existing vertex in the new cell 1212, all four tessellation factors are reduced by Δ according to:

[0205]

[0206] If no further tessellation occurs, then the two triangle sub-units in the tessellation unit 1212 are determined to be primitives (e.g., according to S510). Therefore, the two triangle sub-units of the tessellation tile 1212 are added to the tessellation domain as primitives (with a clockwise or counterclockwise convention inherited from the winding of the tile corner vertices).

[0207] In general, for any geometry of the patch, since the tessellation factor is finite and Δ is a positive constant, the tessellation factor will be at most τ0 in a finite number of steps, so the process is guaranteed to terminate after a finite number of steps. Fig.12c The final state of the tessellated quadrilateral 1214 is shown, whose starting (log space) tessellation factors are (2, 1, 1, 1), corresponding to vertices (TL, TR, BL, BR). The final tessellation pattern of this quadrilateral corresponds to Figure 7b The final mosaic pattern of tiles 204 in .

[0208] Fig.13 It is shown that the embodiment of the present disclosure is consistent with the algorithm described above to generate Fig.12c 13. Example tessellation of quadrilateral tiles of a pattern in . As described above, the starting quadrilateral 1302 is associated with the (logarithmic space) tessellation factors (2, 1, 1, 1) shown. In this example, the tessellation threshold τ0 = 0.0 and the tessellation increment Δ = 0.5. As a first step, as with respect to Fig.12a As indicated, a new vertex 1304 is added at the center of a quadrilateral with a tessellation factor of 1.25 (corresponding to the arithmetic mean calculated using f as described above). Four triangle tiles corresponding to the first LOD are formed in the resulting tessellation unit 1306. Each tessellation factor for each vertex is then reduced by a tessellation increment of 0.5, but this can be done before or after forming the new edges / primitives.

[0209] As a next step, Figure 12bConsistent with the steps described, each triangular sub-unit in tile 1306 is subdivided in a recursive manner by placing four new vertices at the bisecting positions of the edge of the quadrilateral. New edges are then generated connecting the new bisecting vertices with each "top" vertex of each child triangle (i.e., corresponding to the center vertex 1304 of the parent quadrilateral tile 1306). Eight new sub-unit triangles are then formed in the new subdivided quadrilateral 1308. All tessellation factors of quadrilateral 1308 are then reduced by a tessellation increment of 0.5, as shown in quadrilateral 1310 with the updated tessellation factors. The resulting subdivided quadrilateral 1310 represents the first level of detail (i.e., LOD1).

[0210] In the next recursive step, for each of the eight triangle sub-units in quadrilateral 1310, the "bottom" edge (i.e., the longest edge shown) of each of the eight sub-triangles is subdivided by adding new vertices at bisecting points (i.e., halfway along the longest edge) (because the tessellation factor of the center vertex is 0.25 and therefore greater than the tessellation threshold of 0). Thus, a new tessellation factor is calculated for each of the eight new vertices. After eight new edges are generated between the eight new vertices and the "top" vertex of each sub-triangle, sixteen new sub-units are formed, as shown in subdivided quadrilateral 1312.

[0211] All tessellation factors for quadrilateral 1312 are again reduced by 0.5. The resulting tessellation factors are zero in all aspects except the top left vertex. Therefore, two final subdivisions are made at the top left corner, since only the tessellation factor of the top left vertex (with a tessellation factor of 0.5) is above the threshold. After this step and subsequent tessellation factor updates, all vertex tessellation factors are at most 0 (given that vertex tessellation factors are designed to be non-negative), and the process terminates. The result is as follows Fig.12c A fully tessellated patch 1214 in , which represents a second level of detail (ie, LOD2).

[0212] As mentioned above, the mosaicking of patches is performed in a domain space where the patches are planar (i.e., 2D space). Initially, Figure 2 As shown, the patch is in instance space (i.e., the 3D space that defines the geometry of the object) or even world space (the 3D space that defines the larger scene containing the object). Therefore, the patch, light and bounding volume need to be defined in the patch space or transformed into the patch space. Depending on the geometry of the patch in the instance space, different transformation algorithms can be used.

[0213] Fig.14 Three different transformations according to three different patch geometries are shown. Figures 2 to 7bIn the embodiment of , the patch is a parallelogram 1402a in the instance space. Therefore, the parallelogram patch 1402a satisfies P3=P1+P2-P0, and also satisfies |(P1-P0)×(P2-P0)|>0, that is, the patch is non-degenerate. Fig.14 The parallelogram patch 1402a shown in represents a patch in instance or world space, where the diagonal dashed lines indicate sides having the same length.

[0214] The transformation of patch 1402a begins with a translation to place a vertex (e.g., P0) at the origin of instance space coordinates, e.g., the lower left corner of square 1402b, corresponding to Figure 2 The next step involves transforming the matrix M -1 Applied to the light, where the transformation is a single linear transformation. In other words, a single matrix multiplication is applied, which preserves lines (collinearity) and parallelism, but does not necessarily preserve distances and angles. Therefore, after applying the transformation step 1404, the resulting patch 1402b is preferably a square (i.e., the angles and edge lengths have been transformed, for example, to right angles and normalized lengths, respectively, but the collinearity of the patch is maintained). As described above, the transformation is intentionally constructed to provide convenient 2D coordinates for the patch, and therefore, the transformation is explicitly applied to the light, but not to the patch. Therefore, the transformation of the patch is implicitly achieved by transforming the light by the inverse matrix described below. It is also possible to apply an arbitrary scaling factor by exploiting the degrees of freedom in the linear transformation (corresponding to the length of the Z axis in the patch space, i.e., the axis perpendicular to the XY domain space). Since the orientation of the patch space is flipped, it is convenient that this factor is positive to avoid flipping the orientation of the patch. The matrix M whose inverse represents a single linear transformation is constructed as follows:

[0215] x=P1-P0

[0216] y=P2-P0

[0217]

[0218]

[0219] In other words, the matrix M is given by the three column vectors x, y and z. Therefore, applied to the instance space coordinates P IS Transformation to obtain the patch space coordinates P PS ,as follows:

[0220] P PS =M -1 (P IS -P0)

[0221] The inverse matrix can be derived as:

[0222]

[0223] The inverse matrix is ​​preferably predetermined, e.g. calculated "offline" and stored for use. Advantageously, the values ​​of the matrix can be stored as per-tile data, replacing the tile vertex coordinates which (in domain / patch space) are no longer needed due to embedding in the affine transformation.

[0224] Other tile-related information is also transformed, e.g., tile normals used to compute a portion of the bounding volume extents. To avoid transforming multiple tile normals from world / instance space to tile space on the fly, which can be computationally expensive, the normals for each vertex of the tile are preferably transformed "offline" and stored as "patch space coordinates" in memory local to the tile. Since the vertex normals of the child tiles are calculated from the parent tile data (e.g., by interpolation), the transformation can be performed only once for each of the tile vertex normals.

[0225] The instance-to-patch space transformation 1404 modeled as an affine mapping is not sufficient to handle all degrees of freedom with non-parallelograms 1406a. Therefore, in an alternative example, a non-affine mapping, such as a piecewise affine mapping, can be used to handle non-parallelogram patches 1406a, 1410a. For example, a double transformation 1408 can be used to transform the non-parallelogram patch 1406a into the patch space. Although the affine mapping is sufficient to handle the degrees of freedom of the triangular patch, the mosaic method described herein will use a triple transformation into the patch space because the mosaic scheme currently described treats the triangular patch as three different quarters of a quadrilateral patch. However, in principle, given an appropriate mosaic scheme, any patch geometry can work.

[0226] Fig.14 A non-parallelogram patch 1406a with vertex coordinates is shown, for example, where there are at least three different edge lengths Q 0, , Q1, Q2, Q3. For such a non-parallel graph tile 1406a to be transformed 1408 (via one of the two-piece affine transformations) into a tile 1406b that can be tessellated according to the described method, the following values ​​are calculated, which can then be applied to the origin and to the inverse matrix transformation, M respectively. -1 As mentioned above:

[0227] 'P0'=Q0, x0=Q1-Q0, y0=Q2-Q0

[0228] 'P0'=Q3, x1=Q2-Q3, y1=Q1-Q3

[0229] In the case of the non-parallelogram patch 1406a, the transformed patch 1406b includes a portion 1406c (i.e., the shaded right triangle in 1406b) that represents half of a numerically convenient quadrilateral patch in the domain space as described above (i.e., where the triangle vertices are aligned with [0,1]). 2 ). Half of the instance space patch 1406a is transformed to form this portion 1406c, where the other half of the instance space patch has its own transformation to align it with the other half of the numerically convenient quadrilateral patch ( Fig.14 ). When processed as part of a ray tracing scheme, the shaded region 1406c (which represents half of a standard (single) quadrilateral patch in domain space) is bounded by a standard bounding volume, i.e. a rectangular AABB. Thus, in this case, the AABB contains a single triangle rather than a quadrilateral / square, and the other (non-shaded) triangle shown in 1406b (and any sub-triangles contained in this triangle, which are formed by subsequent subdivision of sub-quadrilaterals along shared diagonal edges) is eliminated from consideration (and processed separately with its own transformation and bounding volume, etc.). In other words, the ray tracing scheme operates in the same manner as parallelogram quadrilateral patches in terms of intersection testing and tessellation, with the difference that non-parallelogram patches are processed in a dual manner, with appropriate masking.

[0230] For a triangle patch 1410a in instance space (with vertices T0, T1, T2) to be transformed 1412 (via one of the three-piece affine transformations) into a tile 1410b that can be tessellated according to the described tessellation method, the following three values ​​are calculated, which can then be applied to the origin and to the inverse matrix transformation M, respectively. -1 , as above:

[0231]

[0232]

[0233]

[0234] In the transformed triangle patch 1410b, the shaded portion 1410c represents a right triangle and occupies one quarter of the quadrilateral patch with numerically convenient coordinates, i.e., occupies exactly one sub-triangle of a standard quadrilateral patch after the initial subdivision. In a manner similar to the non-parallelogram patch, this portion 1410c of the transformed triangle patch will preferably have its own transformation and be subject to its own AABB constraints during the ray tracing process, where tessellation will be handled in the same manner as described for the parallelogram embodiment (although in a threefold manner for the triangle patch example). It can be verified that before performing each of the three-piece affine transformations, at least one tessellation factor of the corner vertices of the triangle patch exceeds the tessellation threshold (e.g., is strictly greater than zero) to ensure that the initial subdivision of the triangle patch occurs. Otherwise, no transformation is performed, and the entire triangle patch is tested, for example by the TTU 114, for intersection with the ray as a single triangle primitive.

[0235] Fig.15 1 shows a computer system in which the graphics processing system described herein may be implemented. The computer system includes a CPU 1502, a GPU 1504, a memory 1506, a neural network accelerator (NNA) 1508, and other devices 1514, such as a display 1516, a speaker 1518, and a camera 1522. The processing block 102 (e.g. Figure 1 ) is implemented on GPU 1504. In other examples, one or more of the depicted components may be omitted from the system, and / or processing block 102 may be implemented on CPU 1502 or within NNA 1508. The components of the computer system may communicate with each other via communication bus 1520. Repository 1512 (corresponding to repository 104) is implemented as part of memory 1506.

[0236] Figure 1 The ray tracing system is shown as comprising several functional blocks. This is merely schematic and is not intended to define a strict division between different logical elements of such an entity. Each functional block may be provided in any suitable manner. It should be understood that the intermediate values ​​described herein as being formed by the ray tracing system need not be physically generated by the ray tracing system at any point in time, and may simply represent logical values ​​that are convenient for describing the processing performed by the ray tracing system between its input and output.

[0237] The ray tracing unit, specifically the intersection test module and other modules (including the mosaic module) included herein, can be embodied in hardware on an integrated circuit. The ray tracing unit described herein can be configured to perform any of the methods described herein. In general, any of the functions, methods, techniques or components described above can be implemented in software, firmware, hardware (e.g., fixed logic circuits), or any combination thereof. The terms "module", "functionality", "component", "element", "unit", "block" and "logic" can be used herein to generally represent software, firmware, hardware, or any combination thereof. In the case of software implementation, modules, functionalities, components, elements, units, blocks or logic represent program code that, when executed on a processor, performs a specified task. The algorithms and methods described herein can be performed by one or more processors that execute code, which prompts the processor to perform the algorithm / method. Examples of computer-readable storage media include random access memory (RAM), read-only memory (ROM), optical disks, flash memory, hard disk storage, and other memory devices that can use magnetic, optical and other technologies to store instructions or other data and can be accessed by a machine.

[0238] As used herein, the terms computer program code and computer readable instructions refer to any kind of executable code for a processor, including code expressed in a machine language, an interpreted language, or a scripting language. Executable code includes binary code, machine code, byte code, code that defines an integrated circuit (such as a hardware description language or a netlist), and code expressed in a programming language code 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, run in a virtual machine or other software environment, causes a processor of a computer system supporting the executable code to perform the tasks specified by the code.

[0239] A processor, computer or computer system may be any kind of device, machine or special purpose circuit, or a collection or part thereof, which has processing capabilities so that instructions can be executed. A processor may be or include any kind of general or special purpose processor, such as a CPU, GPU, NNA, system on 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.

[0240] The present invention is also intended to cover software (e.g., HDL (Hardware Description Language) software) that defines the configuration of hardware as described herein, which is used to design integrated circuits or to configure programmable chips to perform desired functions. That is, a computer-readable storage medium may be provided having encoded thereon computer-readable program code in the form of an integrated circuit definition data set, which, when processed (i.e., run) in an integrated circuit manufacturing system, configures the system to manufacture a ray tracing system or tracing unit configured to perform any of the methods described herein, or to manufacture a ray tracing system or ray tracing unit that includes any of the devices described herein. The integrated circuit definition data set may be, for example, an integrated circuit description.

[0241] Thus, a method of manufacturing a ray tracing mosaic system or a ray tracing unit as described herein at an integrated circuit manufacturing system may be provided. Furthermore, an integrated circuit definition data set may be provided, which when processed in an integrated circuit manufacturing system enables execution of the method of manufacturing a ray tracing mosaic system or a ray tracing unit.

[0242] The integrated circuit definition data set may be in the form of computer code, for example as a netlist, code for configuring a programmable chip, as a hardware description language that defines hardware suitable for fabrication at any level in an integrated circuit, including as register transfer level (RTL) code, as a high-level circuit representation such as Verilog or VHDL, and as a low-level circuit representation such as OASIS (RTM) and GDSII. Higher-level representations that logically define hardware suitable for fabrication in an integrated circuit, such as RTL, may be processed at a computer system configured to generate a manufacturing definition of the integrated circuit in the context of a software environment that includes definitions of circuit elements and rules for combining those elements to generate a manufacturing definition of the integrated circuit so defined by the representation. As is typically the case with software executed 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 a manufacturing definition of the integrated circuit to execute code that defines the integrated circuit to generate the manufacturing definition of the integrated circuit.

[0243] Now refer to Fig.16 An example of processing an integrated circuit definition data set at an integrated circuit manufacturing system to configure the system to manufacture a ray tracing tessellation system or a ray tracing unit is described.

[0244] Fig.16An example of an integrated circuit (IC) manufacturing system 1602 is shown that is configured to manufacture a ray tracing system as described in any of the examples herein. In particular, the IC manufacturing system 1602 includes a layout processing system 1604 and an integrated circuit generation system 1606. The IC manufacturing system 1602 is configured to receive an IC definition data set (e.g., defining a ray tracing system as described in any of the examples herein), process the IC definition data set, and generate an IC based on the IC definition data set (e.g., which embodies a ray tracing system as described in any of the examples herein). The processing of the IC definition data set configures the IC manufacturing system 1602 to manufacture an integrated circuit that embodies a ray tracing system as described in any of the examples herein.

[0245] The layout processing system 1604 is configured to receive and process an IC definition data set to determine a circuit layout. Methods for determining a circuit layout based on an IC definition data set are known in the art and may, for example, involve synthesizing RTL code to determine a gate-level representation of a circuit to be generated, such as in terms of logic components (e.g., NAND, NOR, AND, OR, MUX, and FLIP-FLOP components). By determining location information for the logic components, the circuit layout may be determined by the gate-level representation of the circuit. This may be done automatically or with user involvement in order to optimize the circuit layout. When the layout processing system 1604 has determined the circuit layout, it may output the circuit layout definition to the IC generation system 1606. The circuit layout definition may be, for example, a circuit layout description.

[0246] As is known in the art, IC generation system 1606 generates an IC according to the circuit layout definition. For example, IC generation system 1606 may implement a semiconductor device manufacturing process to generate the IC, 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 that can be used in a photolithography process to produce an IC according to the circuit definition. Alternatively, the circuit layout definition provided to IC generation system 1606 may be in the form of a computer readable code that IC generation system 1606 may use to form a suitable mask for generating the IC.

[0247] The different processes performed by IC manufacturing system 1602 may all be implemented at one location, such as by one party. Alternatively, IC manufacturing system 1602 may be a distributed system such that some processes may be performed at different locations and may be performed by different parties. For example, some of the following stages may be performed at different locations and / or by different parties: (i) synthesizing RTL code representing an IC definition data set to form a gate-level representation of a circuit to be produced; (ii) generating a circuit layout based on the gate-level representation; (iii) forming a mask based on the circuit layout; and (iv) using the mask to manufacture the integrated circuit.

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

[0249] In some embodiments, when processed in an integrated circuit manufacturing system, the integrated circuit manufacturing definition data set may cause the integrated circuit manufacturing system to produce an apparatus as described herein. Fig.16 Configuring an integrated circuit manufacturing system in the manner described may enable the manufacture of devices as described herein.

[0250] In some examples, the integrated circuit definition data set may include software that runs on, or in combination with, hardware defined at the data set. Fig.16 In the example shown in , the IC production system may also be configured by the integrated circuit definition data set to load firmware onto the integrated circuit according to the program code defined in the integrated circuit definition data set when manufacturing the integrated circuit, or otherwise provide program code to the integrated circuit for use by the integrated circuit.

[0251] When compared to known implementations, the implementation of the concepts described in this application in devices, equipment, modules and / or systems (and in the methods implemented herein) may cause performance improvements. Performance improvements may include one or more of improved computing performance, reduced latency, increased throughput and / or reduced power consumption. During the manufacture of such devices, devices, modules and systems (e.g., in integrated circuits), a trade-off may be made between performance improvements and physical implementations to improve manufacturing methods. For example, a trade-off may be made between performance improvements and layout area to match the performance of known implementations, but using less silicon. For example, this may be accomplished by reusing functional blocks in a serial manner or sharing functional blocks between elements of devices, devices, modules and / or systems. In contrast, the concepts described in this application that cause improvements in the physical implementations of devices, devices, modules and systems (e.g., reduced silicon area) may be weighed against performance improvements. This may be accomplished, for example, by manufacturing multiple instances of a module within a predefined area budget.

[0252] Applicants hereby independently disclose each individual feature described herein and any combination of two or more such features, to the extent that such feature or combination can be implemented based on the specification as a whole in view of the common general knowledge of a person skilled in the art, regardless of whether such feature or combination of features solves any problem disclosed herein. In view of the foregoing description, it will be clear to a person skilled in the art that various modifications can be made within the scope of the invention.

Claims

1. A method of compressing data representing displacement information in a ray tracing system, wherein the displacement information indicates displacements to be applied to geometric shapes in a scene rendered by the ray tracing system, the method comprising: retrieving a pair of data sets representing the displacement information, wherein a first data set of the data sets comprises a first array of values ​​and a second data set of the data sets comprises a second array of values; extracting values ​​from corresponding array positions in each of the first array and the second array, wherein the extracted values ​​form a pair of values ​​representing an upper limit and a lower limit of the displacement magnitude of the corresponding array position; identifying which of a plurality of predetermined conditions the pair of values ​​satisfies; and The pair of values ​​is encoded into a single value in the compressed data set, wherein the single value represents the identified predetermined condition.

2. The method according to claim 1 comprises repeatedly performing encoding on all value pairs included in a pair of data sets, wherein the compressed data set may include compressed displacement information of all information in the pair of data sets.

3. The method of claim 1, wherein the pair of data sets representing displacement information represents mipmaps that have been sampled from texture pixel data representing a texture to be applied to a geometric shape in the scene.

4. The method of claim 1, wherein the encoded single value representing the identified predetermined condition is represented using fewer bits than each value in a pair of values. The method according to claim 4 , wherein the encoded single value is represented using 2 bits or 3 bits.

6. The method of claim 1, comprising compressing a plurality of pairs of data sets representing displacement information to form a plurality of compressed data sets, wherein each compressed data set of the plurality of compressed data sets represents a different level of texture detail in a scene to be rendered. 7 . The method according to claim 6 , wherein each cell of each compressed data set is generated according to cells corresponding to a plurality of regions of the compressed data set having a finer level of texture detail. The method of claim 6 , wherein the texture level of detail of each compressed data set corresponds to a geometric level of detail.

9. The method according to claim 1, comprising: decoding a compressed data set to obtain at least one pair of values ​​representing an upper limit and a lower limit on a displacement magnitude, wherein the compressed data set is associated with a tile within the scene; determining a bounding volume that contains the tile, wherein at least one dimension of the bounding volume is determined based on the pair of values; and In response to determining that the ray intersects the bounding volume according to the tessellation indication associated with the tile, the tile is subdivided one or more times to obtain a plurality of tile sub-units.

10. The method of claim 1, wherein the predetermined condition is that a pair of values ​​is encompassed by a predetermined range of values, and wherein the encoded single value represents the predetermined range.

11. The method of claim 1, wherein one or more values ​​are retained that can be used to encode the pair of values ​​into a single value to represent a characteristic of a texture to be applied to a geometric shape in the scene.

12. The method of claim 1, wherein a first data set in the data sets comprises a first array of values ​​representing minimum displacements, and a second data set in the data sets comprises a second array of values ​​representing maximum displacements, wherein upper and lower limits of the displacement values ​​are represented by value pairs as corresponding maximum displacement values ​​and minimum displacement values.

13. The method of claim 1, wherein a first data set in the data sets comprises a first array of midpoint displacement values, and a second data set in the data sets comprises a second array representing half-width displacement values, wherein upper and lower limits of the displacement values ​​are represented by value pairs as corresponding midpoint values ​​and half-width values.

14. The method of claim 1, wherein upper and lower limits of the displacement magnitude are configured to define boundaries of a bounding volume associated with the corresponding position of the scene for use by the ray tracing system.

15. The method of claim 1, comprising decompressing the compressed data set by: retrieving a compressed data set comprising an array of values, wherein each value in the array of values ​​is an encoded value representing one of a plurality of predetermined conditions; retrieving a value from the compressed data set; selecting one of the plurality of predetermined conditions depending on the retrieved value; In response to determining that the selected predetermined condition represents a predetermined range of values: A pair of values ​​is generated, wherein the pair of values ​​represents upper and lower limits associated with a predetermined range of values ​​and relates to upper and lower limits of a displacement magnitude for a corresponding array position.

16. The method of claim 15, comprising repeatedly retrieving and decompressing values ​​included in a compressed data set to obtain a plurality of generated value pairs, wherein the plurality of generated value pairs form a pair of data sets representing displacement information, wherein a first data set in the data sets comprises a first array of values, and a second data set in the data sets comprises a second array of values.

17. The method of claim 16, wherein the first array of values ​​represents minimum displacements and the second array of values ​​represents maximum displacements, and wherein each generated pair represents a respective maximum displacement value and a minimum displacement value.

18. The method of claim 15, wherein the generated value pair representing the upper and lower limits of the displacement magnitude is configured to define the boundaries of a bounding volume associated with the corresponding location of the scene for use by the ray tracing system.

19. A hardware unit for use in a ray tracing system, wherein the hardware unit is configured to: retrieving a pair of data sets representing displacement information, wherein a first data set in the data sets comprises a first array of values ​​and a second data set in the data sets comprises a second array of values; retrieving a value from each of the first array and the second array corresponding to the array position, wherein the retrieved value forms a pair of values ​​representing an upper limit and a lower limit of the displacement magnitude corresponding to the array position; Identifying which of a pair of values ​​satisfies a plurality of predetermined conditions; and A pair of values ​​is encoded into a single value in the compressed data set, wherein the single value represents the identified predetermined condition.

20. A computer readable storage medium having stored thereon a computer readable description of an integrated circuit definition data set, the computer readable description, when processed in an integrated circuit manufacturing system, configures the integrated circuit manufacturing system to manufacture a hardware unit for use in a ray tracing system, wherein the hardware unit is configured to: retrieving a pair of data sets representing displacement information, wherein a first data set in the data sets comprises a first array of values ​​and a second data set in the data sets comprises a second array of values; retrieving a value from each of the first array and the second array corresponding to the array position, wherein the retrieved value forms a pair of values ​​representing an upper limit and a lower limit of the displacement magnitude corresponding to the array position; Identifying which of a pair of values ​​satisfies a plurality of predetermined conditions; and A pair of values ​​is encoded into a single value in the compressed data set, wherein the single value represents the identified predetermined condition.