Segmentation method
By using the vertex subdivision factor method, the graphic patches are subdivided, and the visual artifact problem caused by subdivision discontinuity in the prior art is solved, and a smooth and high-quality subdivision process is achieved.
Patent Information
- Application Number
- CN202110540278.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2015-06-05
- Filing Date
- 2016-06-03
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2036-06-03
AI Technical Summary
The prior art is prone to visual artifacts during the subdivision process, especially when the level of detail changes steadily, the changes in subdivision are discontinuous, resulting in a "explosion".
The vertex subdivision factor segmentation method is used to subdivide the quadrilateral and triangle patches. By comparing the vertex subdivision factor with the threshold, we decide whether to re-divider the patch, and add new vertices when necessary to smooth the segmentation process.
It effectively avoids visual artifacts, especially "explosion", ensures the stability and continuity of the subdivision process, and improves rendering quality.
Smart Images

Figure CN113256774B_ABST
Abstract
Description
[0001] This application is a divisional application of an application filed on June 3, 2016, with application number 201610391081.1 and invention name “Subdivision Method”.
[0002] background
[0003] Subdivision is a technique used in computer graphics to split a set of surfaces representing objects in a scene into multiple smaller and simpler pieces, typically triangles, called primitives, which are easier to render. The resulting subdivided surface is typically an approximation of the original surface, but the accuracy of this approximation can be increased by increasing the number of primitives generated, which in turn typically results in smaller primitives. The amount of subdivision / subdivision is typically determined by the level of detail (LOD). An increased number of primitives is therefore typically used where a higher level of detail is required, for example because the object is closer to the viewer and / or the object has a more complex shape. However, the use of a greater number of triangles increases the processing effort required to render the scene.
[0004] Typically subdivision is performed on patches into triangular primitives, which are either square or triangular in shape (i.e., quadrilaterals or triangles) and may be curved to conform to the surface of the object they represent (and may therefore be referred to as "surface patches") and / or to have displacement mapping applied. However, subdivision is not performed on curved patches but instead is performed in the domain of the patch (e.g., as if the patch were planar, rather than defined by a polynomial equation), which may be defined in terms of (u,v) parameters and referred to as "parametric space". This means that the subdivision process is independent of any curvature present in the final surface.
[0005] The tessellation may be performed ahead of time (e.g., to compute multiple different views of a scene at different levels of detail and / or from different viewing angles) or may be performed on the fly (e.g., to provide a continuous or view-dependent level of detail). Using some existing tessellation methods, users may experience undesirable visual artifacts where, although the requested level of detail changes smoothly, the resulting tessellation changes in a discontinuous manner and may be referred to as "popping."
[0006] The embodiments described below are provided by way of example only and are not limitations of implementations that address any or all disadvantages of known methods and apparatus for performing segmentation.
[0007] Overview
[0008] 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 as an aid in determining the scope of the claimed subject matter.
[0009] A tessellation method using vertex tessellation factors is described. For a quadrilateral patch, the method involves comparing the vertex tessellation factor of each vertex of the quadrilateral patch to a threshold value, and if none exceeds the threshold value, the quadrilateral is subdivided into two or four triangles (e.g., depending on whether the patch is a top-level patch or a sub-quad formed by subdividing a top-level patch). If at least one of the four vertex tessellation factors exceeds the threshold value (which may be equal to one), a recursive or iterative method is used that considers each vertex of the quadrilateral patch and determines how to further subdivide the patch based on the value of the vertex tessellation factor of the selected vertex or based on the values of the vertex tessellation factors of the selected vertex and neighboring vertices. A similar method is described for triangular patches.
[0010] A first aspect provides a method for performing subdivision in a computer graphics system, the method comprising: a) receiving input including four vertices defining a quadrilateral patch, each vertex including domain space coordinates and a vertex subdivision factor; b) comparing the vertex subdivision factor with a threshold; c) in response to determining that all four vertex subdivision factors do not exceed the threshold, dividing the patch into two or four triangles; and d) in response to determining that at least one of the four vertex subdivision factors exceeds the threshold: generating a central vertex of the patch and calculating a vertex subdivision factor and a blending factor for the newly added central vertex; further selecting each of the four received vertices, and for each selected vertex: defining a vertex based on the selected vertex; in response to determining that the vertex subdivision factor of the selected vertex exceeds the threshold or the vertex of two adjacent vertices a point subdivision factor exceeds a threshold, adding two new vertices to subdivide each edge between the selected vertex and an adjacent vertex, calculating vertex subdivision factors and blending factors for the new vertices and providing four vertices defining a sub-quadrilateral and including the defined vertex, the central vertex and the two new vertices as further input to a); and in response to determining that the vertex subdivision factor of the selected vertex does not exceed the threshold and the vertex subdivision factor of exactly one adjacent vertex exceeds the threshold, adding new vertices to subdivide the edge between the selected vertex and the adjacent vertex having a vertex subdivision factor exceeding the threshold, and dividing the sub-quadrilateral into two triangles by connecting the defined vertex to diagonally opposite vertices in a sub-quadrilateral defined by the defined vertex, the newly added vertex, the central vertex and another adjacent vertex.
[0011] A second aspect provides a hardware subdivision unit including hardware logic, the hardware logic being configured to: a) receive input including four vertices defining a quadrilateral patch, each vertex including domain space coordinates and a vertex subdivision factor; b) compare the vertex subdivision factor with a threshold; c) in response to determining that all four vertex subdivision factors do not exceed the threshold, divide the patch into two or four triangles; and d) in response to determining that at least one of the four vertex subdivision factors exceeds the threshold: generate a central vertex of the patch and calculate the vertex subdivision factor and blending factor of the newly added central vertex; further select each of the four received vertices, and for each selected vertex: define a vertex based on the selected vertex; in response to determining that the vertex subdivision factor of the selected vertex exceeds the threshold or the vertex of two adjacent vertices a point subdivision factor exceeds a threshold, adding two new vertices to subdivide each edge between the selected vertex and an adjacent vertex, calculating vertex subdivision factors and blending factors for the new vertices and providing four vertices defining a sub-quadrilateral and including the defined vertex, the central vertex and the two new vertices as further input to a); and in response to determining that the vertex subdivision factor of the selected vertex does not exceed the threshold and the vertex subdivision factor of exactly one adjacent vertex exceeds the threshold, adding new vertices to subdivide the edge between the selected vertex and the adjacent vertex having a vertex subdivision factor exceeding the threshold, and dividing the sub-quadrilateral into two triangles by connecting the defined vertex to diagonally opposite vertices in a sub-quadrilateral defined by the defined vertex, the newly added vertex, the central vertex and another adjacent vertex.
[0012] Additional aspects provide a computer-readable storage medium having computer-executable program code stored thereon that, when executed, causes at least one processor to perform the methods described herein, a graphics processing unit including a hardware tessellation unit as described herein, a computer-readable storage medium having computer-readable program code encoded thereon defining a hardware tessellation unit as described herein, and a computer-readable storage medium having computer-readable program code encoded thereon defining a hardware tessellation unit configured to perform the methods described herein.
[0013] Other aspects of the present invention also relate to the following:
[0014] 1) A hardware subdivision unit comprising hardware logic, wherein the hardware logic is configured to:
[0015] a) receiving input comprising four vertices defining a quadrilateral patch, each vertex comprising domain space coordinates and a vertex subdivision factor;
[0016] b) comparing the vertex subdivision factor with a threshold;
[0017] c) in response to determining that all four vertex tessellation factors are less than or equal to the threshold, splitting the patch into two or four triangles; and
[0018] d) in response to determining that at least one of the four vertex subdivision factors exceeds the threshold:
[0019] Generating a central vertex of the patch and calculating a vertex subdivision factor and a blending factor of a newly added central vertex;
[0020] Then select each of the four received vertices, and for each selected vertex:
[0021] defining vertices based on the selected vertices;
[0022] In response to determining that the vertex subdivision factor of the selected vertex exceeds the threshold or the vertex subdivision factors of two neighboring vertices exceed the threshold, adding two new vertices to subdivide each edge between the selected vertex and the neighboring vertices, calculating vertex subdivision factors and blending factors for the new vertices and providing four vertices defining a sub-quadrilateral and including the defined vertex, the central vertex and the two new vertices as further input of a); and
[0023] In response to determining that the vertex subdivision factor of the selected vertex does not exceed the threshold and the vertex subdivision factor of exactly one neighboring vertex exceeds the threshold, a new vertex is added to subdivide the edge between the selected vertex and the neighboring vertex having a vertex subdivision factor exceeding the threshold, and the sub-quadrilateral is divided into two triangles by connecting the defined vertex to diagonally opposite vertices in the sub-quadrilateral defined by the defined vertex, the newly added vertex, the center vertex and another neighboring vertex.
[0024] 2) The hardware subdivision unit of 1), wherein the hardware logic configured to divide the patch into two or four triangles comprises hardware logic configured to perform the following operations:
[0025] determining whether the patch is a top-level patch;
[0026] In response to determining that the patch is a top-level patch, adding a central vertex and creating four triangles by connecting each input vertex to the central vertex; and
[0027] In response to determining that the patch is not a top-level patch, two triangles are created by connecting a source vertex of the patch to diagonally opposite vertices of the patch.
[0028] 3) The hardware subdivision unit of 1), wherein the hardware logic configured to generate the central vertex of the patch comprises hardware logic configured to perform the following operations:
[0029] For the top-level patch: generate a central vertex with a position given by a weighted mixture of (i) the average of the positions of all four corner vertices in N-dimensional space and (ii) the average of the positions of all four corner vertices in domain space which is then mapped to N-dimensional space; and
[0030] For a patch that is not a top-level patch: generate a central vertex with a position given by a weighted mixture of (i) the average of the positions of the selected vertex and the diagonally opposite vertex in N-dimensional space and (ii) the average of the positions of the selected vertex and the diagonally opposite vertex in domain space which is then mapped to N-dimensional space,
[0031] And wherein the weighted blending uses weights determined according to the vertex subdivision factor.
[0032] 4) The hardware subdivision unit as described in 3), wherein the weight is given by the following formula:
[0033] MAX i=0..3 (MIN(TF i –1,1)).
[0034] 5) The hardware subdivision unit of 1), wherein the hardware logic configured to calculate the vertex subdivision factor and the blending factor of the newly added central vertex comprises hardware logic configured to perform the following operations:
[0035] The initial vertex subdivision factor is calculated using the following formula:
[0036]
[0037] as well as
[0038] The vertex subdivision factor TF of the newly added central vertex is calculated by the following operation: centre and blending factor BW centre :
[0039] Determine InitialTF centre Is it less than two?
[0040] In response to determining InitialTF centre Less than 2.0, set TF centre =1 and BW centre =BlendWeightFunc(TF0,TF1,TF2,TF3), where:
[0041] BlendWeightFunc(TF0,…TF3).=MAX i=0..3 (MIN(TF i –1,1))
[0042] In response to determining InitialTF centre Not less than 2.0, set TF centre =InitialTF centre / 2 and BW centre =1.0.
[0043] 6) The hardware subdivision unit of 1), wherein the hardware logic configured to define vertices based on the selected vertices comprises hardware logic configured to perform the following operations:
[0044] Setting the domain space coordinates of the defined vertex equal to the domain space coordinates of the selected vertex;
[0045] Determining whether a vertex subdivision factor of the selected vertex is equal to 1.0 and whether a vertex subdivision factor of the selected vertex is less than 2.0;
[0046] In response to determining that the vertex tessellation factor of the selected vertex is equal to 1.0, setting the vertex tessellation factor of the defined vertex equal to 1.0 and setting the blending factor of the defined vertex equal to the blending factor of the selected vertex;
[0047] In response to determining that the vertex tessellation factor of the selected vertex is not equal to 1.0 and is less than 2.0, setting the vertex tessellation factor of the defined vertex equal to 1.0 and setting the blending factor of the defined vertex equal to one less than the vertex tessellation factor of the selected vertex; and
[0048] In response to determining that the vertex tessellation factor of the selected vertex is not less than 2.0, setting the vertex tessellation factor of the defined vertex equal to half the vertex tessellation factor of the selected vertex and setting the blending factor of the defined vertex equal to one.
[0049] 7) The hardware subdivision unit of 1), wherein the hardware logic configured to add two new vertices to subdivide each edge between the selected vertex and an adjacent vertex and calculate vertex subdivision factors and blending factors for the new vertices comprises hardware logic configured to perform the following operations: for the subdivision at vertex V A and V B Each new vertex V between the edges M :
[0050] Calculate V using the following formula M Initial vertex subdivision factor for:
[0051]
[0052] as well as
[0053] The newly added vertex V is calculated by the following operation M Vertex subdivision factor TF Mand blending factor BW M :
[0054] Determine InitialTF M Is it less than two?
[0055] In response to determining InitialTF M Less than 2.0, set TF M =1 and BW M =MAX(MIN(TF A -1,1),MIN(TF B -1,1));
[0056] In response to determining InitialTF M Not less than 2.0, set TF M =InitialTF M / 2 and BW M =1.0;
[0057] V in the domain space M The position is set to V A and V B The average value of the domain space coordinates and the use of BW in N-dimensional space M By (i) V in N-dimensional space A and V B The average value of the position and (ii) V in the domain space which is then mapped to the N-dimensional space M A weighted mixture of the positions of is given by the positions of .
[0058] 8) The hardware subdivision unit as described in 1) further includes hardware logic configured to perform the following operations:
[0059] receiving input including three vertices defining a triangle patch, each vertex including a domain space coordinate and a vertex tessellation factor;
[0060] comparing the vertex tessellation factor to a threshold; and
[0061] In response to determining that at least one of the three vertex subdivision factors exceeds the threshold,
[0062] Generating a central vertex of the patch and calculating vertex subdivision factors and blending factors of newly added vertices;
[0063] Then select each of the three received vertices, and for each selected vertex:
[0064] defining vertices based on the selected vertices;
[0065] In response to determining that the vertex subdivision factor of the selected vertex exceeds the threshold, adding two new vertices to subdivide each edge between the selected vertex and an adjacent vertex, calculating vertex subdivision factors and blending factors for the new vertices and providing four vertices defining a sub-quadrilateral and including the defined vertex, the central vertex and the two new vertices as further input to a); and
[0066] In response to determining that the vertex subdivision factor of the selected vertex does not exceed the threshold and the vertex subdivision factors of two neighboring vertices both exceed the threshold, adding two new vertices to subdivide each edge between the selected vertex and the neighboring vertices, and dividing the sub-quadrilateral defined by the defined vertex, the newly added vertex, and the central vertex into two triangles by connecting the defined vertex to diagonally opposite vertices in the sub-quadrilateral;
[0067] In response to determining that the vertex subdivision factor of the selected vertex does not exceed the threshold, the vertex subdivision factor of the next neighbor vertex exceeds the threshold, and the vertex subdivision factor of the previous neighbor vertex does not exceed the threshold, adding a new vertex to subdivide the edge between the selected vertex and the next neighbor vertex, and drawing a single triangle connecting the defined vertices, the newly added vertex, and the center vertex; and
[0068] In response to determining that the vertex subdivision factor of the selected vertex does not exceed the threshold, the vertex subdivision factor of the next neighbor vertex does not exceed the threshold, and the vertex subdivision factor of the previous neighbor vertex exceeds the threshold, a new vertex is added to subdivide the edge between the selected vertex and the previous neighbor vertex, and the sub-quadrilateral defined by the defined vertex, the newly added vertex, the center vertex and the next neighbor vertex is divided into two triangles by connecting the defined vertex to diagonally opposite vertices in the sub-quadrilateral.
[0069] 9) The hardware subdivision unit of 8), wherein the hardware logic configured to generate, for a triangle patch, a central vertex of the patch and calculate vertex subdivision factors and blending factors for newly added vertices comprises hardware logic configured to perform the following operations:
[0070] generating a central vertex having a position in domain space given by the average of the three vertices of the triangular patch;
[0071] The initial vertex subdivision factor is calculated using the following formula:
[0072]
[0073] as well as
[0074] The vertex subdivision factor TF of the newly added central vertex is calculated by the following operation centre and blending factor BWcentre :
[0075] Determine InitialTF centre Is it less than two?
[0076] In response to determining InitialTF centre Less than 2.0, set TF centre =1 and BW centre =BlendWeightFunc(TF0,TF1,TF2), where:
[0077] BlendWeightFunc(TF0,…TF2).=MAX i=0..2 (MIN(TF i –1,1))
[0078] In response to determining InitialTF centre Not less than 2.0, set TF centre =InitialTF centre / 2 and BW centre =1.0.
[0079] 10) The hardware tessellation unit of 8), wherein the hardware logic configured to define vertices for a triangle patch based on the selected vertices comprises hardware logic configured to perform the following operations:
[0080] Setting the domain space coordinates of the defined vertex equal to the domain space coordinates of the selected vertex;
[0081] Determining whether a vertex subdivision factor of the selected vertex is equal to 1.0 and whether a vertex subdivision factor of the selected vertex is less than 2.0;
[0082] In response to determining that the vertex tessellation factor of the selected vertex is equal to 1.0, setting the vertex tessellation factor of the defined vertex equal to 1.0 and setting the blending factor of the defined vertex equal to the blending factor of the selected vertex;
[0083] In response to determining that the vertex tessellation factor of the selected vertex is not equal to 1.0 and is less than 2.0, setting the vertex tessellation factor of the defined vertex equal to 1.0 and setting the blending factor of the defined vertex equal to one less than the vertex tessellation factor of the selected vertex; and
[0084] In response to determining that the vertex tessellation factor of the selected vertex is not less than 2.0, setting the vertex tessellation factor of the defined vertex equal to half the vertex tessellation factor of the selected vertex and setting the blending factor of the defined vertex equal to one.
[0085] 11) The hardware subdivision unit of 8), wherein the hardware logic configured to add a new vertex to a triangle patch to subdivide an edge between the selected vertex and an adjacent vertex and to calculate a vertex subdivision factor and a blending factor for the new vertex comprises hardware logic configured to perform the following operations: for the subdivided edge at vertex V A and V B Each new vertex V between the edges M :
[0086] Calculate V using the following formula M Initial vertex subdivision factor for:
[0087]
[0088] as well as
[0089] The newly added vertex V is calculated by the following operation M Vertex subdivision factor TF M and blending factor BW M :
[0090] Determine InitialTF M Is it less than two?
[0091] In response to determining InitialTF M Less than 2.0, set TF M =1 and BW M =MAX(MIN(TF A -1,1),MIN(TF B -1,1));
[0092] In response to determining InitialTF M Not less than 2.0, set TF M =InitialTF M / 2 and BW M =1.0;
[0093] V in the domain space M The position is set to V A and V B The average value of the domain space coordinates and the use of BW in N-dimensional space M By (i) V in N-dimensional space A and V B The average value of the position and (ii) V in the domain space which is then mapped to the N-dimensional space M A weighted mixture of the positions of is given by the positions of .
[0094] 12) The hardware subdivision unit as described in 1) further includes hardware logic configured to perform the following operations:
[0095] Receiving input comprising P vertices defining a P edge patch, where P>4, and each vertex comprises domain space coordinates and a vertex subdivision factor;
[0096] comparing the vertex subdivision factor to a threshold;
[0097] In response to determining that all P vertex subdivision factors do not exceed the threshold, adding a center vertex and dividing the patch into P triangles; and
[0098] In response to determining that at least one of the P vertex subdivision factors exceeds the threshold:
[0099] Generating a central vertex of the patch and calculating a vertex subdivision factor and a blending factor of a newly added central vertex;
[0100] Then select each of the P received vertices, and for each selected vertex:
[0101] defining vertices based on the selected vertices;
[0102] In response to determining that the vertex subdivision factor of the selected vertex exceeds the threshold or the vertex subdivision factors of two neighboring vertices exceed the threshold, adding two new vertices to subdivide each edge between the selected vertex and the neighboring vertices, calculating vertex subdivision factors and blending factors for the new vertices and providing four vertices defining a sub-quadrilateral and including the defined vertex, the central vertex and the two new vertices as further input to (a); and
[0103] In response to determining that the vertex subdivision factor of the selected vertex does not exceed the threshold and the vertex subdivision factor of exactly one neighboring vertex exceeds the threshold, adding a new vertex to subdivide the edge between the selected vertex and the neighboring vertex having a vertex subdivision factor exceeding the threshold, and dividing the sub-quadrilateral into two triangles by connecting the defined vertex to diagonally opposite vertices in the sub-quadrilateral defined by the defined vertex, the newly added vertex, the center vertex and another neighboring vertex.
[0104] 13) A hardware subdivision unit as described in any of 1)-12), further comprising a memory element arranged to store vertex data for reuse within a patch or sub-quadrilateral, so that vertices added to subdivide edges are determined only once per patch or sub-quadrilateral, and the edges are part of more than one subdivided part of the patch or sub-quadrilateral.
[0105] 14) A method for performing subdivision in a computer graphics system, the method comprising:
[0106] a) receiving input comprising four vertices defining a quadrilateral patch, each vertex comprising domain space coordinates and a vertex subdivision factor;
[0107] b) comparing the vertex subdivision factor with a threshold;
[0108] c) in response to determining that all four vertex tessellation factors do not exceed the threshold, splitting the patch into two or four triangles; and
[0109] d) in response to determining that at least one subdivision factor exceeds the threshold:
[0110] Generating a central vertex of the patch and calculating a vertex subdivision factor and a blending factor of a newly added central vertex;
[0111] Then select each of the four received vertices, and for each selected vertex:
[0112] defining vertices based on the selected vertices;
[0113] In response to determining that the vertex subdivision factor of the selected vertex exceeds the threshold or the vertex subdivision factors of two neighboring vertices exceed the threshold, adding two new vertices to subdivide each edge between the selected vertex and the neighboring vertices, calculating vertex subdivision factors and blending factors for the new vertices and providing four vertices defining a sub-quadrilateral and including the defined vertex, the central vertex and the two new vertices as further input of a); and
[0114] In response to determining that the vertex subdivision factor of the selected vertex does not exceed the threshold and the vertex subdivision factor of exactly one neighboring vertex exceeds the threshold, adding a new vertex to subdivide the edge between the selected vertex and the neighboring vertex having a vertex subdivision factor exceeding the threshold, and dividing the sub-quadrilateral defined by the defined vertex, the newly added vertex, the center vertex and another neighboring vertex into two triangles by connecting the defined vertex to diagonally opposite vertices in the sub-quadrilateral.
[0115] 15) The method of 14), wherein dividing the patch into two or four triangles comprises:
[0116] determining whether the patch is a top-level patch;
[0117] In response to determining that the patch is a top-level patch, adding a central vertex and creating four triangles by connecting each input vertex to the central vertex; and
[0118] In response to determining that the patch is not a top-level patch, two triangles are created by connecting a source vertex of the patch to diagonally opposite vertices of the patch.
[0119] 16) The method as described in 14), wherein generating the central vertex of the patch comprises:
[0120] For the top-level patch: generate a central vertex with a position given by a weighted mixture of (i) the average of the positions of all four corner vertices in N-dimensional space and (ii) the average of the positions of all four corner vertices in domain space which is then mapped to N-dimensional space; and
[0121] For a patch that is not a top-level patch: generate a central vertex with a position given by a weighted mixture of (i) the average of the positions of the selected vertex and the diagonally opposite vertex in N-dimensional space and (ii) the average of the positions of the selected vertex and the diagonally opposite vertex in domain space which is then mapped to N-dimensional space,
[0122] And wherein the weighted blending uses weights determined according to the vertex subdivision factor.
[0123] 17) The method of 14), wherein calculating the vertex subdivision factor and the blending factor of the newly added central vertex comprises:
[0124] The initial vertex subdivision factor is calculated using the following formula:
[0125]
[0126] as well as
[0127] The vertex subdivision factor TF of the newly added central vertex is calculated by the following operation: centre and blending factor BW centre :
[0128] Determine InitialTF centre Is it less than two?
[0129] In response to determining InitialTF centre Less than 2.0, set TF centre =1 and BW centre =BlendWeightFunc(TF0,TF1,TF2,TF3), where:
[0130] BlendWeightFunc(TF0,…TF3).=MAX i=0..3 (MIN(TF i –1,1))
[0131] In response to determining InitialTF centre Not less than 2.0, set TF centre =InitialTF centre / 2 and BW centre =1.0.
[0132] 18) The method of 14), wherein defining a vertex based on the selected vertex comprises:
[0133] Setting the domain space coordinates of the defined vertex equal to the domain space coordinates of the selected vertex;
[0134] Determining whether a vertex subdivision factor of the selected vertex is equal to 1.0 and whether a vertex subdivision factor of the selected vertex is less than 2.0;
[0135] In response to determining that the vertex tessellation factor of the selected vertex is equal to 1.0, setting the vertex tessellation factor of the defined vertex equal to 1.0 and setting the blending factor of the defined vertex equal to the blending factor of the selected vertex;
[0136] In response to determining that the vertex tessellation factor of the selected vertex is not equal to 1.0 and is less than 2.0, setting the vertex tessellation factor of the defined vertex equal to 1.0 and setting the blending factor of the defined vertex equal to one less than the vertex tessellation factor of the selected vertex; and
[0137] In response to determining that the vertex tessellation factor of the selected vertex is not less than 2.0, setting the vertex tessellation factor of the defined vertex equal to half the vertex tessellation factor of the selected vertex and setting the blending factor of the defined vertex equal to one.
[0138] 19) A method as described in any one of 14) to 18), wherein adding two new vertices to subdivide each edge between the selected vertex and the adjacent vertex and calculating the vertex subdivision factor and the blending factor of the new vertex comprises: for the subdivision at vertex V A and V B Each new vertex V between the edges M :
[0139] Calculate V using the following formula M Initial vertex subdivision factor for:
[0140]
[0141] as well as
[0142] The newly added vertex V is calculated by the following operation M Vertex subdivision factor TF M and blending factor BW M :
[0143] Determine InitialTF M Is it less than two?
[0144] In response to determining InitialTF M Less than 2.0, set TFM =1 and BW M =MAX(MIN(TF A -1,1),MIN(TF B -1,1));
[0145] In response to determining InitialTF M Not less than 2.0, set TF M =InitialTF M / 2 and BW M =1.0;
[0146] V in the domain space M The position is set to V A and V B The average value of the domain space coordinates and in N-dimensional space has the use of BW M By (i) V in N-dimensional space A and V B The average value of the position and (ii) V in the domain space which is then mapped to the N-dimensional space M A weighted mixture of the positions of is given by the positions of .
[0147] Preferred features may be combined as appropriate, as will be apparent to the skilled person, and may be combined with any aspect of the invention.
[0148] BRIEF DESCRIPTION OF THE DRAWINGS
[0149] Embodiments of the present invention will now be described by way of example with reference to the accompanying drawings, in which:
[0150] Figure 1 shows the results of using various known segmentation methods;
[0151] Figure 2 shows the use of displacement mapping with partial segmentation;
[0152] Figure 3 is a schematic diagram showing a method for producing a smooth transition when vertices are introduced;
[0153] Figure 4 is a schematic diagram showing an example of different results obtained using a prior art method with an edge subdivision factor and the method described herein using a vertex subdivision factor;
[0154] Figure 5 is a schematic diagram showing another example of different results obtained by using edge subdivision factors and vertex subdivision factors in a quadrilateral domain;
[0155] Figure 6 is a schematic diagram showing another example of different results obtained by using edge subdivision factors and vertex subdivision factors in a triangle domain;
[0156] Figure 7 is a flow chart of an example tessellation method using vertex tessellation factors as applied to a quadrilateral input patch;
[0157] Figure 8 is a flow chart of an example tessellation method using vertex tessellation factors as applied to a triangular input patch;
[0158] Fig. 9 It is shown Figure 7 A schematic diagram of the method;
[0159] Fig.10 Show use Figure 7 Examples of results obtained by the method:
[0160] Fig.11 It is shown Figure 8 A schematic diagram of the method;
[0161] Fig.12 It is shown that the use Figure 7 and 8 Examples of results obtained by the method:
[0162] Fig.13 is a schematic diagram of an example GPU pipeline;
[0163] Fig.14 Any form factor of computing and / or electronic device may be implemented and configured to implement Figure 7 and 8 An exemplary method of segmenting various components of a computing-based device;
[0164] Fig.15 Show use Figure 7 and 8 Additional examples of results obtained by the method; and
[0165] Fig.16 is a schematic diagram showing how the method described herein can be extended to the P-edge domain.
[0166] Common reference numbers are used throughout the drawings to indicate similar features.
[0167] Detailed Description
[0168] Embodiments of the present invention are described below as examples only. These examples represent the best way currently known to the applicant to implement the present invention, although they are not the only way this can be implemented. This description sets forth the functions of the examples and the order of steps for constructing and operating the examples. However, the same or equivalent functions and orders can be implemented by different examples.
[0169] There are several known subdivision methods using an edge subdivision factor (TF) which is defined for each edge of a (eg quadrilateral or triangle) patch and determines how many times the edge (and thus the patch) should be subdivided. Figure 1 Shows how the resulting triangles are different when using different edge subdivision factors, but the same subdivision factor for each edge.
[0170] exist Figure 1 The first five examples (a)-(e) in show:
[0171] (a) Integer partitioning, for all four edges, edge TF = 3
[0172] (b) Integer partitioning, for all four edges, edge TF = 4
[0173] (c) Second-power integer partitioning, for all four edges, edge TF = 2
[0174] (d) Second power integer partitioning, for all four edges, edge TF = 4
[0175] (e) Second power integer partitioning, for all four edges, edge TF = 8
[0176] With integer and power-of-two integer subdivision, vertices along each edge are always evenly spaced; however, unwanted visual artifacts (such as popping) are very likely to appear where the subdivision level changes and the triangles are not very small, but making polygons so small is undesirable as small polygons incur additional rendering overhead. This effect is particularly pronounced with power-of-two integer subdivision, because the step size can be much larger.
[0177] exist Figure 1 The last four examples (f)-(i) in show (unlike examples (a)-(e)) a method of partial segmentation that produces vertices at varying offsets:
[0178] f) Odd-part split, for all four edges, edge TF = 3.0
[0179] g) Odd-part split, for all four edges, edge TF = 4.0
[0180] h) Even-partial splitting, for all four edges, edge TF = 3.0
[0181] i) Even-numbered segmentation, for all four edges, edge TF = 4.0
[0182] Some known systems avoid "popping" artifacts along edges by allowing "partial" levels of detail (e.g., as shown in examples (f)-(i)), where any new vertices are initially created at the locations of existing vertices, and as the level of detail is increased, those vertices gradually "slide" into position, as in Figure 2 (a) for only one edge in parameter space. While abrupt jumps in the representation are largely eliminated, such schemes can suffer from disconcerting, unstable "floating / wobbling" artifacts that can be exacerbated by the use of displacement mapping, and this can be seen in Figure 2 (b) and (c) are described.
[0183] Figure 2 (b) shows an example displacement map cross section, while Figure 2 (c) shows how this cross section is applied to the edge when the subdivision factor changes (e.g. Figure 2 Arrows 201-204 show how the displacement of the vertices changes when the subdivision factor changes from 4.0 to 5.0 (arrows 201, 202) and from 5.0 to 6.0 (arrows 203, 204).
[0184] Described in GB Patent No. 2388507 and in Figure 3 Another solution to the burst is shown in . In this example, the curve can be considered as one of the edges of the patch, and points A and B are two of the corner vertices. If another subdivision is performed, this will produce a new point C on the curve, which will correspond to a possible position of the intermediate vertex. If, on the other hand, the number of subdivisions remains the same, the curve will be approximated by line AB, and the intermediate vertex will lie on the line at point D. In order to achieve a smooth transition between points C and D when the level of subdivision changes, a new point E is calculated along line CD, and this is used as the value of the intermediate vertex. The position of E can be calculated using the following formula:
[0185] E=wC+(1-w)D
[0186] Where w is the weight factor obtained from the fractional part of the subdivision ratio, D is the first vertex value obtained at a particular subdivision level, and C is the second vertex value obtained at a finer subdivision level. By using the above equation to calculate E, the new intermediate vertex smoothly transitions between points C and D.
[0187] Other considerations when choosing a tessellation method are not only the number of triangles produced for a given combination of edge tessellation settings, since the rendering cost of a tessellated model depends in part on the number of triangles, but also on the aspect ratio of those triangles. In general, a graphics system (software or hardware) will render "equilateral" triangles that imply a minimum perimeter to area ratio for a given screen area (i.e., screen pixels) faster than it will render (skinny) triangles that have the same area but a higher perimeter to area ratio. Furthermore, having more equilateral triangles should result in fewer artifacts when values such as shading results are calculated at the vertices and then interpolated across triangles.
[0188] Another consideration is the complexity of the algorithm used to generate the triangular pattern. Some known partial subdivision schemes (e.g., developed by Guardardo and and Haines in "Real-Time Rendering" (ISBN1-56881-182-9, pp. 524-525)) lead to non-uniform subdivision. This can reduce hardware or software implementation costs if the algorithm can be kept simple and / or regular (e.g., without many "special cases" that need to be handled differently).
[0189] A final desirable consideration is rotational / reflection symmetry in the tessellation pattern. For example, it would be preferable for a quadrilateral patch defined using vertices given in, say, clockwise order ABCD and using an appropriate tessellation factor to produce the same final triangle mesh as an "equivalent" quadrilateral with vertices listed as BCDA. Some existing tessellation schemes do not guarantee this property (see, for example, Figure 1 Examples of the middle square in (f) and (g) for the “odd” subdivision method).
[0190] The following describes a subdivision method that does not use edge subdivision factors but instead uses subdivision factors defined for each vertex (or angle) of a quadrilateral or triangle. These subdivision factors are referred to as "vertex subdivision factors" to distinguish them from the edge subdivision factors used in the known methods described above.
[0191] In this description, a surface patch refers to a generally finite N-dimensional surface (or, in the case of contours, an N-dimensional curve segment) that is the result of applying a parametric mapping function to a bounded 2D domain, which is a quadrilateral or triangle (or, in the case of contours, a 1D line segment). The resulting surface or contour may be considered N-dimensional, as it may include not only 3 (or 4) dimensions for Cartesian (or homogeneous) spatial positioning, but also other parameters such as texture coordinates. As mentioned above, surface patches may be curved to conform to the surface of the object they represent and / or to have displacement mapping applied. However, tessellation (i.e., subdivision of the patch) is not performed in "world space" (i.e., it is not performed on curved surface patches) but instead is performed in domain space (which may also be referred to as parametric space or parameter space), where any position in the domain may be described by two coordinates (u, v) referred to as domain space coordinates, which means that the tessellation process is independent of any curvature present in the final surface (although the user may take this curvature into account when determining the tessellation factor). When describing this tessellation method, the term "patch" is used to refer to an ordered set of two, three, or four vertices (for contours, triangles, or quadrilaterals, respectively) that form the boundaries of a domain. The term "vertex" is generally used to describe the positioning plus other attributes, where these attributes vary depending on the context. For example, the input control points and output vertices from the domain shader include the 3D position plus other parameters such as normals, tangents, textures, etc., while the vertices in the tessellation (i.e., the vertices used in the tessellation method) include domain space coordinates and vertex tessellation factors. These vertices in the tessellation are therefore different from the input control points or the resulting N-dimensional vertices that form the final triangles.
[0192] Specifying TFs at the corners of a patch results in less abrupt changes in the size and shape of the resulting triangles within the tessellated patch, because the division of the edge is not fixed (i.e. to the value specified by the edge TF), but is instead determined by the vertex TFs at each end of the edge, and changes smoothly not only along the original edge (in the 1D direction in parameter space) to produce a gradual transition between subdivision levels, but also in conjunction with other TFs to allow it to change smoothly across the patch in the 2D direction. This is in Figure 4 As shown in the figure, Figure 4 The difference between a tessellation factor defined at an edge (diagram 402) and a tessellation factor defined at a corner (or vertex, diagram 404) in parameter space using known methods is shown. The first diagram 402 is the result of using a tessellation factor defined as a power of two across the edge in the case of two quadrilaterals with edge tessellation factors of 2 and 4. The second diagram 404 uses the method described below and vertex tessellation factors of 2 (for vertices 406, 408) and 4 (for vertices 410-416).
[0193] As described below, along with vertex-based tessellation factors, this approach minimizes (or eliminates) undesirable visual artifacts because, in many embodiments, each vertex (e.g., each new vertex added as part of a subdivision into a triangle) is added a) at its final position in world space, b) at the midpoint of two or three other vertices at its final position in world space that are corners of the triangle in the immediately lower range of the TF, or c) at a point that is a linear blend of the previous two options (e.g., by applying Figure 3 The technique shown results in blending between the positions achieved by a) and b). The result is that when the level of detail (and thus TF) changes, the vertices are not as Figure 2 TF and some of the prior art techniques described above, which can cause floating / wobbling artifacts. Alternatively, as the level of detail (LOD) increases (e.g., as this can be determined by a viewer moving closer to the object), vertices initially introduced at the midpoint of two, three, or four vertices present in the "lesser" TF slowly "grow outward" to their final position in world space. The reverse process occurs as the LOD / TF decreases.
[0194] Figure 5 and 6 An additional comparison is shown between the results obtained using the method described below (which uses vertex subdivision factors) and the results obtained using other known subdivision methods (which use edge subdivision factors), again shown in parameter space. In these examples, the edge subdivision factors are set to the average of the corresponding angular subdivision factors in order to approximately produce the same level of subdivision in the edge-based subdivision scheme as in the new method. Figure 5 The first example 501 in shows a comparison of the results obtained using odd part splitting 511, even part splitting 512, integer splitting 513, and power-of-two integer splitting 514 for edge TFs of 3.0 for the top edge, 4.0 for the right edge, 3.0 for the bottom edge, and 2.0 for the left edge, with the result 515 obtained using the method described below with vertex TFs of 2.0 for the top left vertex, 4.0 for the top right vertex, 4.0 for the bottom right vertex, and 2.0 for the bottom left vertex. It can be seen that the method described below results in approximately the same number of subdivisions as the known technique; however, the transitions between levels of detail are handled more smoothly, resulting in far fewer long thin triangles, which are less desirable when rendering, as mentioned earlier. This is also Figure 5 In the second example 502, Figure 5A comparison is shown of the results obtained using odd part segmentation 521, even part segmentation 522, integer segmentation 523 and second power integer segmentation 524 for edge TFs of 3.0 at the top, 6.0 at the right, 8.0 at the bottom and 5.0 at the left, and the result 525 obtained using the method described below for vertex TFs of 2.0 at the top left, 4.0 at the top right, 8.0 at the bottom right and 8.0 at the bottom left.
[0195] Figure 6 The corresponding results for a triangular domain are shown in Figure 6 The first example 601 in the figure shows a comparison of the results obtained by using odd part segmentation 611, even part segmentation 612, integer segmentation 613 and second power integer segmentation 614 for the edge TF of 3.0 on the left and right sides 604, 605 and the edge TF of 4.0 on the lower edge 606, and the result 615 obtained by using the method described below with a vertex TF of 2.0 for the upper vertex 607 and a vertex TF of 4.0 for the two lower vertices 608, 609.
[0196] as Figure 5 As with the quadrilateral domain example, it can be seen that the method described below, when applied to a triangular domain, results in approximately the same number of subdivisions as the known technique; however, the transitions between levels of detail are handled more smoothly, resulting in far fewer long, thin triangles, which are less desirable when rendering, as mentioned earlier. This is also Figure 6 The second example 602 in FIG. 4 shows a comparison of the results obtained using odd part splitting 621, even part splitting 622, integer splitting 623 and second power integer splitting 624 for edge TFs of 3.0 on the left side 604, 6.0 on the right side 605 and 5.0 on the bottom side 606, with the result 625 obtained using the method described below with vertex TFs of 4.0 on the upper vertex 607, 2.0 on the lower left vertex 608 and 8.0 on the lower right vertex 609.
[0197] Furthermore, what is noteworthy about the second examples 502 and 602, and in particular for examples 521-523 and 621-623, is the relative complexity of the scheme. These prior art methods produce an interior portion having a relatively regular NxM subdivision pattern, to which the outer border is then "sewn" in a less desirable semi-regular manner. This not only increases the complexity of the subdivision process, which is undesirable, but also results in asymmetric subdivisions and less uniformly shaped triangles.
[0198] exist Figure 5 and 6In examples 515, 525, 615, and 625 in and in subsequent examples produced using the subdivision methods described herein, the images provide an indication (in parameter space) of the blending performed when new vertices are added (as described in more detail below). The vertices shown as squares in either example are in their "final" positions, while progressively larger circles are used to show vertices in an interpolated state, i.e., where their blending factors are in [0.0, 1.0).
[0199] For reference Figure 7 and 8 Describes the subdivision method using vertex subdivision factors, Figure 7 and 8 is a quadrilateral ( Figure 7 ) and triangle ( Figure 8 ) flow chart of the method. The subdivision method can achieve Figure 7 and 8 Either or both of the methods shown.
[0200] For reference Fig. 9 The example quadrilateral depicted ( Figure 7 The quadrilateral method accepts four vertices, each of which consists of domain space (i.e. (u,v)) coordinates and a vertex subdivision factor. These four vertices will be labeled V0, V1, V2, and V3 with corresponding subdivision factors TF0 to TF3. In addition to the subdivision factor, each vertex also maintains a blending factor BF i ∈[0.0,1.0] (where i is the vertex index). For the top-level patch, these per-vertex blending factors will be set to 1.0.
[0201] For a quad that is a top-level patch, any vertex may be labeled V0, and the remaining vertices are then labeled in a rotational order, i.e., in a clockwise or counterclockwise order around the quad. Regardless of which direction is used to label the vertices (i.e., clockwise or counterclockwise), a consistent order must be used throughout the subdivision method, and for the purposes of the following description, a clockwise labeling convention is employed. For the child quad, the four input vertices have actually been "labeled" V0 to V3, as these were formed from the corresponding parent quad. Those skilled in the art will recognize that there is at least one other equivalent reordering / relabeling that will maintain symmetry, but for simplicity in the example, the default input labeling is used.
[0202] If all four vertices of a quad have a tessellation factor of 1.0, it will be called an "end quad".
[0203] If the top-level patch ("yes" in block 704) is also a "terminal quad", i.e., all four vertex subdivision factors are equal to one ("yes" in block 702), then a central vertex is added (block 706), and four triangles are created by connecting each input vertex to the central vertex (block 708). The added central vertex (in block 706) is added at a position in the final N-dimensional space that is the average of the N-dimensional positions of the four vertices.
[0204] The term "top-level patch" refers to an input patch to the tessellation method, which may be a triangle or a quadrilateral, although at this point, it is determined (in block 704) whether only quadrilaterals (defined by four input vertices) are top-level patches. If a quadrilateral is not a top-level patch, it may be referred to as a sub-quadrilateral, where a sub-quadrilateral is formed by a subdivision of an input patch at a certain level, which may be a quadrilateral patch or a triangle patch as described below. A quadrilateral or triangle that is subdivided at a particular subdivision level to form a sub-quadrilateral is referred to as a parent of the sub-quadrilateral (where the parent may be an input patch or another sub-quadrilateral), and a sub-quadrilateral resulting from the subdivision of the parent is referred to as a child.
[0205] If the quadrilateral is a terminal quadrilateral, i.e., all four vertex subdivision factors are equal to one ("yes" in block 702), and the quadrilateral is not a top-level quadrilateral ("no" in block 704), i.e., it is a sub-quadrilateral as formed by subdivision of a top-level quadrilateral, a triangle (described below), or another sub-quadrilateral, then no central vertex is created, and instead the quadrilateral is split in half by drawing two triangles by connecting the source vertex (V0) of the sub-quadrilateral to the diagonally opposite vertex (V2) of the sub-quadrilateral. When the sub-quadrilateral is formed, the source vertex (V0) of the sub-quadrilateral is the selected vertex (of the parent quadrilateral / triangle). See below for more details. Fig. 9 This creation of the quadrilateral split in half (in block 710) is described in more detail.
[0206] The reason for identifying a "terminal quadrilateral top-level patch" (which is then split into four triangles, rather than splitting it into only two triangles as is done with the "terminal" sub-quadrilateral) is the desirable property of rotational / reflection symmetry as described earlier. This is not necessary for the terminal sub-quadrilaterals, since the symmetry is implicitly maintained due to the order of selection of the source vertices. If in a given implementation, the guaranteed symmetry of the terminal top-level patch quadrilateral is not desired, a small reduction in triangles can be achieved by splitting the terminal top-level patch into only two triangles.
[0207] If a finer granularity of subdivision is desired throughout the patch, an alternative implementation may choose to always split the "end quad" sub-quad into four triangles, however this will approximately double the number of triangles generated.
[0208] If at least one of the four vertex subdivision factors is not equal to one (“No” in block 702 ), that is, at least one of the four vertex subdivision factors is greater than one, a central vertex V is generated for the quadrilateral. Centre , which includes the calculation of subdivision and blending factors (block 712). The resulting center vertex (in block 712) has a position which, to avoid popping artifacts, is a weighted blend of: (i) the average of the positions of all four corner vertices in N-dimensional space for a "top patch", or the average of just two vertices - V0 and its diagonally opposite V2 for a "sub-quad" patch, and ii) the average of the positions calculated in domain space and mapped to N-dimensional space. The weight of the blend, which is a value in the range [0.0, 1.0], is determined as a function of the vertex subdivision factor, where a weight of zero returns case i), a weight of one returns case ii) and intermediate values are weighted sums. To avoid popping, the blend weighting function must be continuous and the calculated blend weight must approach zero when the subdivision factors of all vertices approach 1.0, i.e., when the quad approaches an "end quad". In this example, the blend weighting function is chosen to be:
[0209] Equation 1: BlendWeightFunc(TF0,…TF3).=MAX i=0..3 (MIN(TF i –1,1))
[0210] The vertex subdivision factor of the center vertex is calculated from the four vertex subdivision factors, so that the function is continuous, preferably symmetric, and produces a result initially bounded by the minimum and maximum input subdivision factors. In this example, the function is chosen to be:
[0211] Equation 2: Because the quadrilateral will be subdivided, this initial TF is "bisected" using the following method to produce the central TF and BW (or blending factor).
[0212]
[0213] Those skilled in the art will appreciate that if the subdivision factor is pre-modified (ie pre-biased by -1.0), the computational cost will be reduced. Additional savings can be obtained by using (base 2) logarithms, reducing the cost of multiplications and roots.
[0214] After the central vertex is determined (in block 712), each input vertex V0, V1, V2 and V3 is processed. In the example, these will be completed in a default sequential order, but it should be quickly apparent that the order in which these vertices are processed is not critical, and they can be processed sequentially or in parallel.
[0215] Select the first input vertex V from {V0,V1,V2,V3} i (Block 714), and this is used to define vertex W i 0 (Block 716). i The coordinates (u,v) are copied to W i 0 , and the corresponding subdivision factor WTF i 0 and blend weight WBW i 0 As follows, from the input TF i and BW i get:
[0216]
[0217] There are three different actions, depending on the input vertex TF i The value of the next and previous neighboring vertices, namely TF (i+1)mod4 and TF (i-1)mod4 For example, when vertices are labeled in a rotation order to circumvent a quadrilateral, if the selected vertex is V0, ie, i=0, then the next and previous neighbor vertices are V1 and V3, respectively.
[0218] If you enter TF i If both adjacent vertices have a vertex TF greater than 1, then (TF i >1)OR((TF (i+1)mod4 >1)AND(TF (i-1)mod4 >1)) is true (“yes” in block 720), then by adding a new vertex W i 1 and W i 3 And the previous split and the back side To subdivide each incoming edge (i.e., each edge between the selected vertex and an adjacent vertex), and to calculate the vertex subdivision factor and blending factor for each newly added vertex (block 726). i 0 , W i 1 、V Centre (It can be considered as W i 2 ) and W i 3 The four vertices of Figure 7 Within the method shown (block 728 and returning to block 702, as indicated by the dotted arrow).
[0219] The new vertex, W, is determined as follows i 1 and W i 3 For simplicity, let V M Denote the new vertex and let V A and V B Indicates V M Vertices at either end of the subdividing edge. Determine V in a similar manner as the center point M The vertex subdivision factor and blending weight, TF M and BW M , except that only two input vertices are used instead of four, i.e.
[0220] Equation 3:
[0221]
[0222] V M The (u,v) position in domain space is set to V A and V B To prevent bursting, V M Position in N-dimensional space using BW M The weights are given as a weighted mixture of: (i) V A and V B The average value of the N-dimensional position of V M The final N-dimensional position of the mapped (U, V) coordinates. As before, if BW M = 0.0, then the blend should return (i), otherwise if BW M =1.0, it should return (ii), and values in between are interpolated accordingly.
[0223] Referring to the vertex TF with TF0=1.5 (vertex 902), TF1=1.0 (vertex 904), TF2=1.0 (vertex 906), and TF3=1.0 (vertex 908), Fig. 9 For the quadrilateral 900 shown, since at least one vertex TF is not equal to one (“No” in block 702), the central vertex 910 is added (in block 712) and its initial vertex TF (before “bisection”) is calculated as And then "equal division" is set to "1.0" (i.e. TF centre :=1.0), blending factor BF centre is set to 0.5. Since the center vertex may form the "third" vertex in the sub-quad, it will also be referred to as WV0 2.
[0224] Vertex V0 is selected (in block 714) and used to define vertex W0 0 (Block 716). When the input vertex TF=1.5, the defined vertex will have WTF0 0 =1.0 and WBW0 0 = 0.5. When the input vertex TF is greater than one (“yes” in block 720), the remaining two vertices (W0 and W1, respectively) forming the sub-quadrilateral are added. 1 and W0 3 ) to split the two incoming edges again, and use the above equation 2 to calculate their vertex TF (block 726), so that WTF0 1 =1.0 and WBW0 1 = 0.5 (vertex 912), and WTF0 3 =1.0 and WBW0 3 = 0.5 (vertex 914). As shown by vertices 902, 912, 910 and 914 (which have WTF0 0 =1.0(vertex 902), WTF0 1 =1.0(vertex 912), WTF0 2 = 1.0 (vertex 910) and WTF0 3 =1.0 (vertex 914)) is then fed back to the beginning of the method so that W0 of the sub-quad becomes "V0", W1 becomes V1, and so on.
[0225] Considering this new child quadrilateral, all vertices TF are equal to one ("yes" in block 702) and the quadrilateral is not a top-level patch ("no" in block 704), and so the quadrilateral is divided in half by dividing it into two triangles (block 710), i.e., two triangles are drawn, one formed by vertices 902, 912 and 910 and the other formed by vertices 902, 910 and 914. The edge common to both triangles connects V0 and V2, which is the center vertex of the parent quadrilateral (vertex 910).
[0226] Return to the previous parent process, if ((TF i >1)OR((TF (i+1)mod4 >1)AND(TF (i-1)mod4 >1))) is false (“No” in block 720), then TF i must be equal to one. If the vertex TF of both adjacent vertices is also equal to one ("yes" in block 722), the selected vertex is skipped and the next vertex is selected (block 730) because any required subdivision will be achieved when other vertices in the quad are selected. When vertex 906 is the selected vertex, Fig. 9 This condition is shown in quadrilateral 900 as follows: its vertex TF is not greater than one and both adjacent vertices (vertices 904 and 908) have a vertex TF equal to one.
[0227] If the input vertex TF is equal to one and both neighboring vertices do not have a vertex TF that is also equal to one ("No" in both blocks 720 and 722), then exactly one neighboring vertex must have a vertex TF greater than one ("Yes" in block 724), although this is guaranteed as a result of the "No" in both blocks 720 and 722, this condition does not have to be checked and block 724 can be omitted. When exactly one neighboring vertex has a vertex TF greater than one, there are two possibilities: it is the next neighboring vertex ("Yes" in block 732) or the previous neighboring vertex ("No" in block 732).
[0228] In the case that it is the next neighbor vertex with a vertex TF greater than one (“yes” in block 732), the M The same expression as previously described for the case, namely, the edge between the selected vertex and the next adjacent vertex is subdivided by adding the new vertex at a position in the domain space given by the average of the positions of the selected vertex and the next adjacent vertex and the TF, BW, and N-dimensional position as previously described (see Equation 3 and the text below). This forms a sub-quadrilateral including the selected vertex, the newly added vertex, the center vertex, and the previous vertex. This sub-quadrilateral is divided into two halves by connecting the selected vertex to the diagonally opposite vertex (block 736). The method then selects the next vertex in the parent quadrilateral (block 730), such as V1, and the method repeats (back to block 716, as indicated by the arrow).
[0229] This is Fig. 9 , when vertex 908 is the selected vertex. Selected vertex 908 has a vertex TF of one, the previous vertex (vertex 906) also has a vertex TF of one, and the next vertex (vertex 902) has a vertex TF greater than one ("No" in blocks 720 and 722 and "Yes" in blocks 724 and 732). Therefore, the edge to the next vertex is subdivided by adding vertex 914, and the child quadrilateral (defined by vertices 908, 914, 910, 906) is formed by drawing two triangles: one is formed by vertices 908, 914 and 910, and the other is formed by vertices 908, 910 and 906. The edge shared by these two triangles connects the selected vertex (vertex 908) and the center vertex (vertex 910) of the parent quadrilateral.
[0230] In the case where it is a previous neighbor vertex with a vertex TF greater than one (“No” in block 732), the V MThe same expression as previously described, i.e., the edge between the selected vertex and the previous adjacent vertex is subdivided by adding the new vertex at a position in the domain space given by the average of the positions of the selected vertex and the previous adjacent vertex and the TF, BW, and N-dimensional position as previously described (see Equation 3 and the text below). This forms a sub-quadrilateral including the selected vertex, the next vertex, the center vertex, and the newly added vertex. This sub-quadrilateral is divided into two halves by connecting the selected vertex to the diagonally opposite vertex (block 736). The method then selects the next vertex in the parent quadrilateral (block 730), such as V1, and the method repeats (back to block 716, as indicated by the arrow).
[0231] This is Fig. 9 , when vertex 904 is the selected vertex. Selected vertex 904 has a vertex TF of one, the next vertex (vertex 906) also has a vertex TF of one, and the previous vertex (vertex 902) has a vertex TF greater than one ("No" in blocks 720 and 722 and "Yes" in block 724 and "No" in 732). Therefore, the edge to the previous vertex is subdivided by adding vertex 912, and the child quadrilateral (defined by vertices 904, 906, 910, 912) is formed by drawing two triangles: one is formed by vertices 904, 910 and 912, and the other is formed by vertices 904, 906 and 910. The edge shared by these two triangles connects the selected vertex (vertex 904) and the center vertex (vertex 910) of the parent quadrilateral.
[0232] Fig.10 Show use Figure 7 Three examples of subdivided quadrilaterals obtained by the method shown. The first example 1001 shows the vertex subdivision factors of TF0=1, TF1=2, TF2=2, TF3=1. The second example 1002 shows the vertex subdivision factors of TF0=2, TF1=4, TF2=8, TF3=8. The third example 1003 shows the vertex subdivision factors of TF0=3, TF1=5, TF2=32, TF3=32.
[0233] It should be apparent to those skilled in the art that although the examples may be described above, because the quad vertices are selected sequentially to calculate the "new vertices" of the sub-edges, each newly added vertex may be shared between the 2 child quads of the parent quad, and thus the calculations can be reduced by calculating these before traversing the children of the parent quad. For example, referring to Fig.10 In the third example 1003, the vertices of each side that divides the top-level quadrilateral can be calculated before traversing the top-level quadrilateral's children - the upper-left sub-quadrilateral (which is ultimately divided into two triangles), the upper-right sub-quadrilateral (which is ultimately divided into 26 triangles), the lower-right sub-quadrilateral, and the lower-left sub-quadrilateral.
[0234] Additional savings can be made where two parent quads share the same edge, and so the same "re-subdivided vertex" can both be computed. A simple cache memory / buffer / addressable memory indexed by, for example, (u,v) parameters can be used to store vertex data, and so reduce recomputation overhead. Where such a scratchpad of vertex data is used, it can be checked before computing new TF and BW for newly added vertices, and if a vertex with the same (u,v) parameters is stored, the TF and BW of that stored vertex can be used, rather than recalculating the values. In various examples, the scratchpad of vertex data may only store a limited number of vertices (rather than all previously added vertices), and even in such examples, the amount of recomputation can be significantly reduced.
[0235] For reference Fig.11 The example triangles 1101-1104 shown describe ( Figure 8 The triangle method receives three vertices, each vertex including domain space (i.e., (u, v)) coordinates and a vertex subdivision factor. If all three vertex subdivision factors are equal to one ("yes" in block 802), no subdivision is performed. This Fig.11 A first example triangle 1101 is shown in FIG.
[0236] If at least one of the three vertex subdivision factors is not equal to one ("No" in block 802), i.e., at least one of the three vertex subdivision factors is greater than one, then a central vertex is added to the triangle and a vertex subdivision factor is calculated for the newly added central vertex (block 804). The added central vertex is added (in block 804) at a position in the domain space that is the average of the three vertices. The vertex subdivision factor for the central vertex is calculated in a similar manner to the quadrilateral case, except that it is adapted for 3 vertices, i.e.,
[0237] Equation 4:
[0238]
[0239] The three vertices are denoted V0-V2, and their vertex subdivision factors are denoted TF0-TF2.
[0240] After the central vertex is created (in block 804), the first vertex V is selected i (e.g., V0) (block 806). For a triangle (which is always an input patch), any vertex may be labeled as V0, and then the remaining vertices are labeled in either clockwise or counterclockwise order around the triangle. Regardless of which direction is used to label the vertices (i.e., clockwise or counterclockwise), the same order must be used throughout the subdivision method, and for the purposes of the following description, a clockwise labeling convention is used.
[0241] Select Vertex V i Used to define the vertices W in a similar manner to the quadrilateral method described above i 0 (Block 808). i The coordinates (u,v) are copied to W i 0 , and the corresponding subdivision factor WTF i 0 and blend weight WBW i 0 As follows, from the input TF i and BW i get:
[0242]
[0243] With Figure 7 In a similar way to the quadrilateral method, there are three different actions, which depend on the input vertex TF i The value of the next and previous neighboring vertices, namely TF (i+1)mod3 and TF (i-1)mod3 The value of the vertex TF (as defined by the decisions in blocks 812-816) appears. When the vertices are labeled in a rotation order around the triangle, if the selected vertex is V0 (such that i=0), the neighboring vertices are the next vertex V1 and the previous vertex V2.
[0244] If you input vertex TF i is greater than one (“yes” in block 812), then by adding a new vertex W i 1 and W i 3 And the previous split and the back side To subdivide each incoming edge (i.e., each edge between the selected vertex and an adjacent vertex), and to compute the vertex subdivision factor and blending factor for each newly added vertex (block 818). i 0 , W i 1 、V Centre (It can be considered as W i 2 ) and W i 3 The four vertices of Figure 7 The quadrilateral method shown (block 820, i.e., starting at block 702).
[0245] As described above, for the quadrilateral case, new vertices, i.e., W i 1 and Wi 3 location and subdivision factor data, namely:
[0246] Equation 3:
[0247]
[0248] V M The (u,v) position in domain space is set to V A and V B To prevent bursting, V M The position in N-dimensional space is calculated using BW M The weights are given as a weighted mixture of: (i) V A and V B The average value of the N-dimensional position of V M The final N-dimensional position of the mapped (U, V) coordinates. As before, if BW M = 0.0, then the blend should return (i), otherwise if BW M =1.0, it should return (ii), and values in between are interpolated accordingly.
[0249] This can be seen in the example of the vertex TF having TF0>1.0 (vertex 1106), TF1=1.0 (vertex 1108), and TF2=1.0 (vertex 1110). Fig.11 The second example triangle 1102 is shown. All vertex TFs are not equal to one ("No" in block 802), so the center vertex 1112 is generated (in block 804) and its vertex TF and blending factor are calculated using equation 4 above. Vertex V0 is selected (in block 806) and vertex W is defined i 0 (in block 808). When the input vertex TF is greater than one ("yes" in block 812), the two incoming edges are subdivided by adding two new vertices 1114, 1116, and their vertex TFs and blending factors are calculated as described above (block 818). The sub-quadrilateral as defined by vertices 1106, 1114, 1112, and 1116, together with its vertex TF and blending factors (as calculated in blocks 808 and 818), is then fed into the quadrilateral method (block 820, i.e., to Figure 7 702).
[0250] Returning to the previous parent process, if the input vertex TF is not greater than one ("No" in block 812), the input vertex TF must be equal to one. If the vertex TFs of both adjacent vertices are greater than one ("Yes" in block 814), then the input vertex TF must be equal to one by using the vertex TF used to create V MThe same expression as previously described for the case is used to add new vertices (block 822), i.e., each incoming edge (i.e., each edge between the selected vertex and an adjacent vertex) is subdivided by adding the new vertex at a position in the domain space that is given by the average of the positions of the selected vertex and the next adjacent vertex and the TF, BW, and N-dimensional position as previously described (see Equation 3 and the text below). This forms a sub-quadrilateral that includes the selected vertex, the newly added vertex between the selected vertex and the next vertex, the center vertex, and the newly added vertex between the selected vertex and the previous vertex. This sub-quadrilateral is divided into two halves by connecting the selected vertex to the diagonally opposite vertices (block 824). The method then selects the next vertex in the parent triangle (block 826), such as V1, and the method repeats (back to block 808, as indicated by the arrow).
[0251] This can be seen in the example of the vertex TF with TF0=1.0 (vertex 1120), TF1>1.0 (vertex 1122), and TF2>1.0 (vertex 1124). Fig.11 The third example triangle 1103 is shown. All vertex TFs are not equal to one ("No" in block 802), so the center vertex 1126 is generated (in block 804) and its vertex TF and blending factor are calculated using equation 4 above. Vertex V0 is selected (in block 806) and used to define vertex W i 0 (In block 808). When the input vertex TF is not greater than one ("No" in block 812) but the vertex TFs of the two adjacent vertices are greater than one ("Yes" in block 814), the two incoming edges are further split by adding two new vertices 1128, 1130, which form the remaining two vertices of the sub-quadrilateral (W and W, respectively). i 1 and W i 3 ). The sub-quadrilateral as defined by vertices 1120, 1128, 1126, and 1130 is divided into two halves by drawing two triangles (in block 824): one formed by vertices 1120, 1128, and 1126, and the other formed by vertices 1120, 1126, and 1130. The edges common to these two triangles connect i 0 (Vertex 1120) and Wi 2 , which is the central vertex of the triangle (vertex 1126).
[0252] If the input vertex TF is equal to one and both neighboring vertices do not have a vertex TF greater than one ("No" in both blocks 812 and 814), then exactly one neighboring vertex must have a vertex TF greater than one ("Yes" in block 816), although this is guaranteed as a result of the "No" in both blocks 812 and 814, this condition does not have to be checked and block 816 can be omitted. When exactly one neighboring vertex has a vertex TF greater than one, there are two possibilities: it is the next neighboring vertex ("Yes" in block 828) and the previous neighboring vertex ("No" in block 828).
[0253] In the case that it is the next neighbor vertex with a vertex TF greater than one (“yes” in block 828), the V M The same expression as previously described for the case is used, i.e., the edge between the selected vertex and the next neighbor vertex is subdivided by adding the new vertex at a position in the domain space given by the average of the positions of the selected vertex and the next neighbor vertex and the TF, BW, and N-dimensional position as previously described (see Equation 3 and the text below). A single triangle is then formed, the triangle including the selected vertex, the newly added vertex, and the center vertex (block 832). The method then selects the next vertex in the triangle (block 826), such as V1, and the method repeats (back to block 808, as indicated by the arrow).
[0254] This is Fig.11 804). The second example triangle 1102 is shown in FIG. 804, when vertex 1110 is the selected vertex. Selected vertex 1110 has a vertex TF of one, the previous vertex (vertex 1108) also has a vertex TF of one, and the next vertex (vertex 1106) has a vertex TF greater than one ("No" in blocks 812 and 814 and "Yes" in blocks 816 and 828). Therefore, the edge to the next vertex is subdivided by adding vertex 1116, and a single triangle is formed by vertices 1110, 1116, and 1112 (the central vertex added in block 804).
[0255] In the case where it is a previous neighbor vertex with a vertex TF greater than one (“No” in block 828), the V MThe same expression as previously described for the case, i.e., the edge between the selected vertex and the previous adjacent vertex is subdivided by adding the new vertex at a position in the domain space given by the average of the positions of the selected vertex and the previous adjacent vertex and the TF, BW, and N-dimensional position as previously described (see Equation 3 and the text below). This forms a sub-quadrilateral including the selected vertex, the next vertex, the center vertex, and the newly added vertex. This sub-quadrilateral is divided into two halves by connecting the selected vertex to the diagonally opposite vertex (block 836). The method then selects the next vertex in the parent quadrilateral (block 826), such as V1, and the method repeats (returning to block 808, as indicated by the arrow).
[0256] This is Fig.11 1102, when vertex 1108 is the selected vertex. Selected vertex 1108 has a vertex TF of one, the next vertex (vertex 1110) also has a vertex TF of one, and the previous vertex (vertex 1106) has a vertex TF greater than one ("No" in blocks 812 and 814, "Yes" in block 816, and "No" in block 828). Therefore, the edge to the previous vertex is subdivided by adding vertex 1114, and the sub-quadrilateral (defined by vertices 1108, 1110, 1112, 1114) divided into two halves is formed by drawing two triangles: one formed by vertices 1108, 1112, and 1114, and the other formed by vertices 1108, 1110, and 1112. The edge common to these two triangles connects the selected vertex (vertex 1108) and the central vertex of the triangle (vertex 1112).
[0257] Fig.12 Show use Figure 7 and 8 Three examples of subdivided triangles obtained by the method shown. The first example 1201 shows the vertex subdivision factors of TF0=1, TF1=100, TF2=1. The second example 1202 shows the vertex subdivision factors of TF0=1, TF1=100, TF2=10. The third example 1203 shows the vertex subdivision factors of TF0=50, TF1=10, TF2=30. Fig.15 A further example is shown in , which comprises a sequence of wireframe subdivisions in 3D (it will be appreciated that the final subdivision system described herein is applicable to N dimensions). Fig.15 The example shown shows the changes when the vertex subdivision factor is changed from (1, 1, 1, 1) all the way to approximately (26.5, 16.7, 8.8, 4.9).
[0258] Although the segmentation method is described above (and in Figure 7 and 8) as involving comparisons between the vertex subdivision factor and a value of one (in blocks 702, 720-724, 730, 802, 812-816, and 828), in a variation of the method, the comparison may be performed with respect to a different threshold (i.e., to a threshold that is not equal to one, in which case the test to determine whether another subdivision is needed may be based on whether the subdivision factor is strictly greater than the threshold). This variation may be selected in order to reduce the number of triangles generated during the subdivision process, but may reduce the smoothness of the animation when the LOD changes.
[0259] Furthermore, although specific equations are used above to calculate the values of the vertex subdivision factor and the blending factor for the newly added vertices, in other examples, different equations may be used. For example, instead of using equation 2, the following equations may be used:
[0260] Equation 2A:
[0261] And instead of using equation 3, the following equation can be used:
[0262] Equation 3A:
[0263] If TF i ≠1 and TF neighbour ≠1, then
[0264] If TF i =1 or TF neighbour =1, then TF M =1
[0265] And instead of using equation 4, the following equation can be used:
[0266] Equation 4A:
[0267] As shown in the examples provided, by using the tessellation method described above that uses vertex TFs rather than edge TFs, the resulting triangles are more evenly sized and T-junctions (which can cause cracks in the resulting rendered image) are avoided. As the level of detail changes within a scene, transitions are handled smoothly (e.g., where the size of the triangles and the spacing of the vertices change gradually) and abrupt transitions (which can cause unwanted visual artifacts) are avoided. Similarly, where the level of detail changes over time (e.g., when objects are closer or farther away from the viewpoint), the transitions are smooth and the potential for unwanted visual artifacts due to the movement of vertices is avoided because each vertex is created at its final position in parametric space. Known techniques can be used in the depth (or height) direction (e.g., blending) to gradually introduce these new vertices (e.g., so that they appear to gradually "grow outward" from the surface).
[0268] Methods for subdividing quadrilaterals and triangles (such as Figure 7 and 8 The method (shown in Figure 1) is rotationally invariant so that the patch will be subdivided into triangles in the same way regardless of its orientation in the scene. This can be particularly important, for example, so that rotating objects in the scene do not produce unwanted visual artifacts when rendered. Furthermore, it does not matter which vertices of the input patch (e.g., quadrilateral or triangle) the method starts with, as the same results are achieved in all cases.
[0269] The vertex TFs input to the tessellation method may be generated by a separate application (e.g., based on the distance of the viewer from each vertex, e.g., the vertex TF of a vertex may be proportional to the inverse of the distance of the vertex from the eye). In various examples, an API may be provided that converts edge TFs to vertex TFs before inputting them into the methods described herein (e.g., by taking the average of all edge TFs of edges that meet at a vertex).
[0270] Although the above description of the subdivision method involves the use of recursion, it will be appreciated that the method may alternatively be implemented iteratively and / or in parallel rather than recursively, and that references to "recursion" or "iteration" in this description are by way of example only.
[0271] The subdivision method described above applies to triangular and quadrilateral domains, but because the initial domain subdivision involves traversing a 3 or 4 sided polygonal domain of vertices in time to produce sub-quadrilaterals, those skilled in the art will recognize that the process can be applied equally well to any N-sided domain such as pentagons or hexagons to produce sub-quadrilaterals, and thereafter continuing recursively with any produced sub-quadrilaterals.
[0272] refer to Fig.16 , consider P edge regions, where P ≥ 4. If the subdivision factor TF i For all P vertices equal to 1 (as in the first example 1601), then in a similar manner to the quadrilateral case, a central vertex 1603 is added at a position in the final N-dimensional space that is the average of the N-dimensional locations of the P vertices. Then for each i, by connecting V i 、V i+1modP And the added center vertex to generate P triangles, 0≤i <P。
[0273] If at least one of the subdivision factors exceeds 1 (as in the second example 1602), the process described above for quadrilateral subdivision applies, except for the following:
[0274] a) The mixing weighting function (in Equation 1 above) is generalized to:
[0275] BlendWeightFunc=MAXi=0..P-1 (MIN(TF i -1,1))
[0276] b) The function of the initial TF of the center (in Eq. 2 above) is generalized to:
[0277]
[0278] c) The indices of the previous and next vertices become V respectively (i-1)MOD P and V (i+1)MOD P .
[0279] For example, according to the above (and in Figure 7 ), if the vertex V is selected i With subdivision factor TF i >1.0 (e.g., vertex 1604), the two incoming edges are subdivided to produce two additional vertices and a sub-quadrilateral 1606 defined from the updated selected vertex, one of the additional vertices, the center vertex, and the remaining additional vertices. This sub-quadrilateral can then be provided as further input to Figure 7 method (e.g., as input to block 702).
[0280] The subdivision method using vertex subdivision factors described above (e.g., as shown in reference Figure 7 and 8 The method described above can be used to perform tessellation on the fly (eg, as the viewpoint changes in a 3D scene), or alternatively, the method can be used offline to pre-compute triangles for multiple different viewpoints.
[0281] The tessellation method described herein using vertex tessellation factors may be implemented in hardware (e.g., as described in reference Figure 7 and 8 In various examples, the Fig.13 The method is implemented in a hardware subdivision unit within a graphics processing unit (GPU) as shown. Fig.13 1 is a schematic diagram of an example GPU pipeline 1300 that may be implemented in hardware within a GPU. Fig.13 As shown, pipeline 1300 includes a vertex shader 1302, which is responsible for performing per-vertex calculations, including calculating all of the vertex tessellation factors (e.g., based on the vertex's position from the camera). Before calculating the vertex TF, the vertex shader transforms the vertex into world space and may apply one or more other linear transformations. Vertex shader 1302 is unaware of the mesh topology and only knows the current vertex fed into it.
[0282] Between the vertex shader 1302 and the hardware tessellation unit (or tessellation unit) 1304 (or between the vertex shader and Fig.131304, where pipeline 1300 includes one or more optional hull shaders between vertex shader 1302 and tessellator 1304, topology can be used to build patches (i.e., ordered sets of vertices). This patch information is passed to the hull shader (where provided). However, tessellator 1304 only uses the vertex TF, and the rest of the patch information is passed on to domain shader 1306.
[0283] Hardware tessellation unit (or tessellation device) 1304 includes hardware logic to implement the above-described methods using the received vertex TFs (e.g., as in Figure 7 and 8 ). Unlike the vertex shader, the hardware tessellation unit (and any optional hull shader) operates per patch rather than per vertex. To simplify the hardware required to implement the equations for calculating the TF of a new vertex (e.g., in blocks 718 and 810), the calculations may be performed in log2 and so may be implemented as additions and subtractions (otherwise multiplications and divisions would be used). The hardware tessellation unit 1304 may be configured to perform aspects of the method described above in parallel (e.g., recursion on different patches). The hardware tessellation unit 1304 outputs the domain space coordinates of each new vertex and passes it to the domain shader 1306 (e.g., by storing the details of each triangle formed in a buffer).
[0284] The domain shader 1306 acts as the second vertex shader for the vertices produced by the tessellation 1304 and is executed once per vertex (which is produced by the tessellation). The domain shader is provided with a domain space position (u,v) and given all patch information and outputs a full vertex structure. The domain shader uses the patch control points and domain space coordinates to construct a new vertex and apply any displacement mapping (e.g. by sampling some bumps or height map encoded in a texture).
[0285] After the domain shader 1306 is run for each generated vertex for each patch, the vertex is passed to the rasterizer (not in Fig.13 ). In tandem, primitives (in the form of index buffers) are passed from the tessellator to the rasterizer.
[0286] Fig.13 The GPU pipeline 1300 is shown only as an example, and the subdivision method using vertex TF described herein can be used in any GPU architecture. It will also be appreciated that the hardware subdivision unit 1304 can be used in the GPU pipeline, in addition to or instead of the vertex shader 1302, the optional shell shader and the domain shader 1306, the GPU also includes other shaders.
[0287] The subdivision method using vertex subdivision factors described above (e.g., as shown in reference Figure 7 and 8The described) can optionally be implemented in software (or a combination of software and hardware). Fig.14 Various components of an exemplary computing-based device 1400 are shown that may be implemented as any form of computing and / or electronic device and that may be configured to implement the segmentation method described above.
[0288] The computing-based device 1400 includes one or more processors 1402, which may be microprocessors, controllers, or other devices for processing computer-executable instructions to control the operation of the device in order to perform the segmentation method described above (e.g., as described in reference to Figure 7 and 8 1406). In some examples, such as where a system-on-chip architecture is used, the processor 1402 may include one or more fixed function blocks (also referred to as accelerators) that implement a portion of the segmentation method in hardware (rather than software or firmware). Platform software including an operating system 1404 or any other suitable platform software may be provided at the computing-based device to enable application software 1406 to execute on the device, and the application software may include a segmentation module 1408.
[0289] Computer executable instructions can be provided using any computer-readable medium accessible by computing-based device 1400. Computer-readable media may include, for example, computer storage media, such as memory 1410 and communication media. Computer storage media (i.e., non-temporary machine-readable media) such as memory 1410 include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include, but are not limited to, RAM, ROM, EPROM, EEPROM, flash memory or other storage technology, CD-ROM, digital versatile disk (DVD) or other optical storage, cassettes, magnetic tapes, disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information accessed by a computing device. On the contrary, communication media may embody computer-readable instructions, data structures, program modules or other data in modulated data signals such as carrier waves or other transmission mechanisms. As defined herein, computer storage media do not include communication media. Although computer storage media (ie, non-transitory machine-readable media such as memory 1410) are shown within computing-based device 1400, it will be appreciated that the memory may be distributed or located remotely and accessed via a network or other communications link (eg, using communications interface 1412).
[0290] Although not in Fig.14 As shown in FIG. 1 , the memory 1410 (or not in FIG. Fig.14A separate memory element (shown in ) may be used to store vertex data for newly added vertices in order to reduce the computational overhead caused by recalculating the same vertex for different (but adjacent) parent quadrilaterals.
[0291] The computing-based device 1400 may also include an input / output controller arranged to output display information to a display device that may be separate from or integral to the computing-based device 1400. The display information may provide a graphical user interface. The input / output controller may also be arranged to receive and process input from one or more devices, such as a user input device (e.g., a mouse or keyboard). In an embodiment, the display device may also act as a user input device if it is a touch-sensitive display device. The input / output controller may also output data to a device other than the display device, such as a locally connected printing device.
[0292] The terms "processor" and "computer" are used herein to refer to any device or part thereof having processing capabilities so that it can execute instructions. The term "processor" may include, for example, a central processing unit (CPU), a graphics processing unit (GPU or VPU), a physical processing unit (PPU), a radio processing unit (RPU), a digital signal processor (DSP), a general-purpose processor (e.g., a general-purpose GPU), a microprocessor, any processing unit designed to accelerate tasks outside the CPU, etc. Those skilled in the art will recognize that such processing capabilities are incorporated into many different devices, and therefore the term "computer" includes set-top boxes, media players, digital radios, PCs, servers, mobile phones, personal digital assistants, and many other devices.
[0293] Those skilled in the art will recognize that storage devices for storing program instructions can be distributed in the network. For example, a remote computer can store examples of processes described as software. A local or terminal computer can access the remote computer and download a portion or all of the software to run the program. Alternatively, the local computer can download fragments of the software as needed or execute some software instructions at a local terminal and execute some instructions at a remote computer (or computer network). Those skilled in the art will also recognize that all or part of the software instructions can be implemented by a dedicated circuit such as a DSP, a programmable logic array, etc. by utilizing conventional techniques known to those skilled in the art.
[0294] The methods described herein may be performed by a computer configured with software in a machine-readable form stored on a tangible storage medium, for example in the form of a computer program including computer-readable program code for configuring a computer to perform the components of the method or in the form of a computer program including computer program code modules suitable for performing all the steps of any method described herein when the program is run on a computer, and wherein the computer program may be embodied on a computer-readable storage medium. Examples of tangible (or non-transitory) storage media include disks, thumb drives, memory cards, etc., and do not include propagating signals. The software may be suitable for execution on a parallel processor or a serial processor, so that the method steps may be executed in any suitable order or simultaneously.
[0295] The hardware components described herein may be produced by a non-transitory computer-readable storage medium having a computer-readable program code encoded thereon.
[0296] It is intended to also include software that "describes" or defines the configuration of the hardware that implements the modules, functions, components or logic described above, such as HDL (hardware description language) software, such as used for designing integrated circuits or for configuring programmable chips to achieve the desired functions. That is, a computer-readable storage medium may be provided, which has a computer-readable program code stored thereon for generating a processing unit configured to perform any method described herein or for generating a processing unit including any device described herein. That is, a computer system may be configured to generate a representation of a digital circuit from the definition of circuit elements and data for defining the rules for combining those circuit elements, wherein a non-transitory computer-readable storage medium may have processor-executable instructions stored thereon, which when executed at such a computer system causes the computer system to generate a processing unit as described herein. For example, a non-transitory computer-readable storage medium may have computer-readable instructions stored thereon, which when executed at a computer system for generating a representation of an integrated circuit causes the computer system to generate a representation of a processor of a receiver as described in the examples herein or to generate a representation of a processor configured to perform the methods as described in the examples herein. The representation of a processor may be a representation of the processor itself or a representation of a processor (e.g., a mask), which may be used to generate a processor.
[0297] The memory storing the machine executable data used in implementing the disclosed aspects may be a non-transitory medium. The non-transitory medium may be volatile or non-volatile. Examples of volatile non-transitory media include semiconductor-based memories such as SRAM or DRAM. Examples of technologies that can be used to implement non-volatile memory include optical and magnetic memory technologies, flash memory, phase change memory, resistive RAM.
[0298] A specific reference to "logic" refers to a structure that performs one or more functions. Examples of logic include circuits arranged to perform those functions. For example, such circuits may include transistors and / or other hardware elements available in the manufacturing process. As an example, such transistors and / or other elements may be used to form a circuit or structure that implements and / or contains memories such as registers, flip-flops or latches, logic operators such as Boolean operations, mathematical operators such as adders, multipliers or shifters, and interconnections. Such elements may be provided as custom circuits or standard cell libraries, macros, or at other abstract levels. Such elements may be interconnected in a specific arrangement. Logic may include fixed-function circuits, and the circuits may be programmed to perform one or more functions; such programming may be provided from firmware or software updates or control mechanisms. Logic identified as performing a function may also include logic that implements the constituent functions of a subprocess. In an example, hardware logic has a circuit that implements a fixed-function operation or multiple operations, a state machine, or a process.
[0299] Any range or device value given herein may be expanded or altered without losing the effect sought, as will be apparent to the skilled artisan.
[0300] It will be understood that the benefits and advantages described above may relate to one embodiment or may relate to several embodiments. The embodiments are not limited to those that solve any or all of the stated problems or those that have any or all of the stated benefits and advantages.
[0301] Any reference to "an" item refers to one or more of those items. The term "comprising" is used herein to mean including the identified method blocks or elements, but such blocks or elements do not comprise an exclusive list, and the apparatus may include additional blocks or elements, and the method may include additional operations or elements. Furthermore, blocks, elements, and operations themselves are not implicitly closed.
[0302] The steps of the method described herein can be performed in any appropriate order or simultaneously on appropriate occasions. The arrows between the boxes in the accompanying drawings illustrate an example order of method steps, but are not intended to exclude the execution of other orders or parallel multiple steps. In addition, a separate block can be deleted from any method without departing from the spirit and scope of the subject matter described herein. The aspect of any example described above can be combined with any aspect of the other examples described to form other examples without losing the effect sought. In the occasions where the elements of the accompanying drawings are shown as being connected by arrows, it will be appreciated that these arrows illustrate only an example flow of the communication (including data and control messages) between the elements. The flow between the elements can be in either direction or in two directions.
[0303] It will be understood that the above description of the preferred embodiment is given only as an example, and various modifications may be made by those skilled in the art. Although various embodiments have been described above with a certain degree of detail or with reference to one or more individual embodiments, those skilled in the art may make many changes to the disclosed embodiments without departing from the spirit or scope of the invention.
Claims
1. A method for performing subdivision in a computer graphics system, the method comprising: receiving input including three vertices defining a triangle patch, each vertex including a domain space coordinate and a vertex tessellation factor; comparing the vertex tessellation factor to a threshold value (802); and In response to determining that at least one of the three vertex tessellation factors exceeds the threshold: Generate a central vertex of the patch and calculate a vertex subdivision factor and a blending factor of the newly added central vertex (804); Then select each of the three received vertices, and for each selected vertex: defining a vertex based on the selected vertex (808); In response to determining that the vertex subdivision factor of the selected vertex does not exceed the threshold, the vertex subdivision factor of the next neighbor vertex exceeds the threshold, and the vertex subdivision factor of the previous neighbor vertex does not exceed the threshold (816), adding a new vertex to subdivide the edge between the selected vertex and the next neighbor vertex (830), and drawing a single triangle connecting the defined vertex, the newly added vertex, and the center vertex (832); as well as In response to determining that the vertex subdivision factor of the selected vertex does not exceed the threshold, the vertex subdivision factor of the next neighbor vertex does not exceed the threshold, and the vertex subdivision factor of the previous neighbor vertex exceeds the threshold (816), a new vertex is added to subdivide the edge between the selected vertex and the previous neighbor vertex (834), and the sub-quadrilateral defined by the defined vertex, the newly added vertex, the center vertex and the next neighbor vertex is divided into two triangles by connecting the defined vertex to diagonally opposite vertices in the sub-quadrilateral (836).
2. The method of claim 1 , further comprising, for each selected vertex: In response to determining that the vertex subdivision factor of the selected vertex does not exceed the threshold and the vertex subdivision factors of two adjacent vertices both exceed the threshold (812, 814), two new vertices are added to subdivide each edge between the selected vertex and the adjacent vertices (822), and the sub-quadrilateral defined by the defined vertex, the newly added vertex and the central vertex is divided into two triangles by connecting the defined vertex to diagonally opposite vertices in the sub-quadrilateral (824).
3. The method according to claim 1, wherein: Generating the central vertex of the patch and calculating the vertex subdivision factor and the blending factor of the newly added central vertex includes: generating a central vertex having a position in domain space given by the average of the three vertices of the patch; The initial vertex subdivision factor is calculated using the following formula: as well as The vertex subdivision factor TF of the newly added central vertex is calculated by the following operation centre and blending factor BW centre : Determine InitialTF centre Is it less than two? In response to determining InitialTF centre Less than 2.0, set TF centre =1 and BW centre =BlendWeightFunc(TF0,TF1,TF2), where: BlendWeightFunc(TF 0, …TF2) . =MAX i=0..2 (MIN(TF i -1,1)) In response to determining InitialTF centre Not less than 2.0, set TF centre =InitialTF centre / 2 and BW centre =1.
0.
4. The method according to claim 1, wherein: Defining a vertex based on the selected vertex includes: Setting the domain space coordinates of the defined vertex equal to the domain space coordinates of the selected vertex; Determining whether a vertex subdivision factor of the selected vertex is equal to 1.0 and whether a vertex subdivision factor of the selected vertex is less than 2.0; In response to determining that the vertex tessellation factor of the selected vertex is equal to 1.0, setting the vertex tessellation factor of the defined vertex equal to 1.0 and setting the blending factor of the defined vertex equal to the blending factor of the selected vertex; In response to determining that the vertex tessellation factor of the selected vertex is not equal to 1.0 and is less than 2.0, setting the vertex tessellation factor of the defined vertex equal to 1.0 and setting the blending factor of the defined vertex equal to one less than the vertex tessellation factor of the selected vertex; and In response to determining that the vertex tessellation factor of the selected vertex is not less than 2.0, setting the vertex tessellation factor of the defined vertex equal to half the vertex tessellation factor of the selected vertex and setting the blending factor of the defined vertex equal to one.
5. The method according to claim 1, wherein: Adding a new vertex to subdivide the edge between the selected vertex and the adjacent vertex and calculating the vertex subdivision factor and blending factor of the new vertex includes, for the subdivision at the vertex V A and V B Each new vertex V between the edges M : Calculate V using the following formula M Initial vertex subdivision factor for: as well as The newly added vertex V is calculated by the following operation M Vertex subdivision factor TF M and blending factor BW M : Determine InitialTF M Is it less than two? In response to determining InitialTF M Less than 2.0, set TF M =1 and BW M =MAX(MIN(TF A -1,1),MIN(TF B -1,1)); In response to determining InitialTF M Not less than 2.0, set TF M =InitialTF M / 2 and BW M =1.0; V in the domain space M The position is set to V A and V B The average value of the domain space coordinates and the use of BW in N-dimensional space M By (i) V in N-dimensional space A and V B The average value of the position and (ii) V in the domain space which is then mapped to the N-dimensional space M A weighted mixture of the positions of is given by the positions of .
6. The method according to claim 1, wherein: The threshold is equal to one.
7. The method of claim 1 further comprises storing vertex data for reuse within the patch or sub-quadron such that vertices added to subdivide edges that are part of more than one subdivision of the patch or sub-quadron are determined only once per patch or sub-quadron.
8. The method according to claim 7, wherein: The subdivided parts of the patch or sub-quadrilateral are triangles or sub-quadrilaterals.
9. A hardware subdivision unit comprising hardware logic, the hardware logic being configured to: receiving input including three vertices defining a triangle patch, each vertex including a domain space coordinate and a vertex tessellation factor; comparing the vertex tessellation factor to a threshold value (802); and In response to determining that at least one of the three vertex subdivision factors exceeds the threshold, Generate a central vertex of the patch and calculate a vertex subdivision factor and a blending factor of the newly added central vertex (804); Then select each of the three received vertices, and for each selected vertex: defining a vertex based on the selected vertex (808); In response to determining that the vertex subdivision factor of the selected vertex does not exceed the threshold, The vertex subdivision factor of the next neighbor vertex exceeds the threshold and the vertex subdivision factor of the previous neighbor vertex does not exceed the threshold (816), adding a new vertex to subdivide the edge between the selected vertex and the next neighbor vertex (830), and drawing a single triangle connecting the defined vertex, the newly added vertex and the central vertex (832); as well as In response to determining that the vertex subdivision factor of the selected vertex does not exceed the threshold, The vertex subdivision factor of the next neighbor vertex does not exceed the threshold and the vertex subdivision factor of the previous neighbor vertex exceeds the threshold (816), a new vertex is added to subdivide the edge between the selected vertex and the previous neighbor vertex (834), and the sub-quadrilateral defined by the defined vertex, the newly added vertex, the center vertex and the next neighbor vertex is divided into two triangles by connecting the defined vertex to diagonally opposite vertices in the sub-quadrilateral (836).
10. The hardware tessellation unit of claim 9, further comprising, for each selected vertex, hardware logic configured to: In response to determining that the vertex subdivision factor of the selected vertex does not exceed the threshold and the vertex subdivision factors of two adjacent vertices both exceed the threshold (812, 814), two new vertices are added to subdivide each edge between the selected vertex and the adjacent vertices (822), and the sub-quadrilateral defined by the defined vertex, the newly added vertex and the central vertex is divided into two triangles by connecting the defined vertex to diagonally opposite vertices in the sub-quadrilateral (824).
11. The hardware subdivision unit according to claim 9, wherein: The hardware logic configured to generate the central vertex of the patch and calculate the vertex subdivision factor and the blending factor of the newly added central vertex includes hardware logic configured to perform the following operations: generating a central vertex having a position in domain space given by the average of the three vertices of the patch; The initial vertex subdivision factor is calculated using the following formula: as well as The vertex subdivision factor TF of the newly added central vertex is calculated by the following operation centre and blending factor BW centre : Determine InitialTF centre Is it less than two? In response to determining InitialTF centre Less than 2.0, set TF centre =1 and BW centre =BlendWeightFunc(TF0,TF1,TF2), where: BlendWeightFunc(TF 0, …TF2) . =MAX i=0..2 (MIN(TF i -1,1)) In response to determining InitialTF centre Not less than 2.0, set TF centre =InitialTF centre / 2 and BW centre =1.
0.
12. The hardware subdivision unit according to claim 9, wherein: The hardware logic configured to define a vertex based on the selected vertex includes hardware logic configured to: Setting the domain space coordinates of the defined vertex equal to the domain space coordinates of the selected vertex; Determining whether a vertex subdivision factor of the selected vertex is equal to 1.0 and whether a vertex subdivision factor of the selected vertex is less than 2.0; In response to determining that the vertex tessellation factor of the selected vertex is equal to 1.0, setting the vertex tessellation factor of the defined vertex equal to 1.0 and setting the blending factor of the defined vertex equal to the blending factor of the selected vertex; In response to determining that the vertex tessellation factor of the selected vertex is not equal to 1.0 and is less than 2.0, setting the vertex tessellation factor of the defined vertex equal to 1.0 and setting the blending factor of the defined vertex equal to one less than the vertex tessellation factor of the selected vertex; as well as In response to determining that the vertex tessellation factor of the selected vertex is not less than 2.0, setting the vertex tessellation factor of the defined vertex equal to half the vertex tessellation factor of the selected vertex and setting the blending factor of the defined vertex equal to one.
13. The hardware subdivision unit according to claim 9, wherein: The hardware logic configured to add a new vertex to subdivide the edge between the selected vertex and the neighboring vertex and calculate the vertex subdivision factor and the blending factor of the new vertex includes hardware logic configured to perform the following operations: for the subdivision at the vertex V A and V B Each new vertex V between the edges M : Calculate V using the following formula M Initial vertex subdivision factor for: as well as The newly added vertex V is calculated by the following operation M Vertex subdivision factor TF M and blending factor BW M : Determine InitialTF M Is it less than two? In response to determining InitialTF M Less than 2.0, set TF M =1 and BW M =MAX(MIN(TF A -1,1),MIN(TF B -1,1)); In response to determining InitialTF M Not less than 2.0, set TF M =InitialTF M / 2 and BW M =1.0; V in the domain space M The position is set to V A and V B The average value of the domain space coordinates and the use of BW in N-dimensional space M By (i) V in N-dimensional space A and V B The average value of the position and (ii) V in the domain space which is then mapped to the N-dimensional space M A weighted mixture of the positions of is given by the positions of .
14. A hardware tessellation unit according to claim 9, further comprising a memory element arranged to store vertex data for reuse within the patch or sub-quad, such that vertices added to subdivide edges that are part of more than one subdivided portion of the patch or sub-quad are determined only once per patch or sub-quad.
15. A computer-readable storage medium having computer-executable program code stored thereon, the computer-executable program code causing at least one processor to perform the method according to any one of claims 1-8 when executed.
16. A graphics processing unit, comprising the hardware subdivision unit according to any one of claims 9 to 14.
17. A computer readable storage medium having encoded thereon a computer readable program code defining a hardware subdivision unit according to any one of claims 9-14.
Citation Information
Patent Citations
Interface between a parametric modelling unit and polygon based rendering system
GB2388507A
Stitching for primitives in graphics processing
CN104584082A
Method for assigning tessellation factor per point, and device implementing said method
JP2015018551A