主权项 |
1. A hardware tessellation unit comprising hardware logic configured to:
a) receive an input comprising four vertices defining a quad patch, each vertex comprising a domain space coordinate and a vertex tessellation factor; b) compare the vertex tessellation factors to a threshold value; c) in response to determining that all four vertex tessellation factors are less than or equal to the threshold value, divide the patch into a plurality of triangles; and d) in response to determining that at least one of the four vertex tessellation factors exceeds the threshold value:
generate a center vertex to the patch and calculating a vertex tessellation factor and blend factor for the center vertex;select in turn, each one 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 tessellation factor of the selected vertex exceeds the threshold value or that the vertex tessellation factors of both neighbor vertices exceed the threshold value, add two new vertices to sub-divide each edge between the selected vertex and a neighbor vertex, calculate vertex tessellation factors and blend factors for the new vertices and provide the four vertices, which define a sub-quad and comprise the defined vertex, the center vertex and the two new vertices as a further input to (a) to allow for a rendering without unwanted artifacts; andin response to determining that the vertex tessellation factor of the selected vertex does not exceed the threshold value and the vertex tessellation factor of exactly one neighbor vertex exceeds the threshold value, add a new vertex to sub-divide an edge between the selected vertex and the neighbor vertex with the vertex tessellation factor which exceeds the threshold and divide a sub-quad defined by the defined vertex, the newly added vertex, the center vertex and the other neighbor vertex into two triangles by connecting the defined vertex to a diagonally opposite vertex in the sub-quad to allow for a rendering without unwanted artifacts. |