When we asked for a top-level definition of tessellation, Willard explained (emphasis is ours): D3DRS_MINTESSELLATIONLEVEL and D3DRS_MAXTESSELLATIONLEVELĪnd their default values: D3DRS_MAXTESSELLATIONLEVEL = 1.Alan Willard Interview – What Is Tessellation?Īt a top-level, Willard explains that surfaces and walls (think of these as a flat surface) are built out of “quads.” Quads consist of two triangles that are “butted-up together” to make a square. New render states: D3DRS_ENABLEADAPTIVETESSELLATION // BOOL When D3DRS_ENABLEADAPTIVETESSELLATION is TRUE, triangle primitives (triangle lists, fans, strips) are drawn as N-patches, IDirect3DDevice9::SetNPatchMode has set value less than 1.0. If Te < D3DRS_MINTESSELLATIONLEVEL, then Te = D3DRS_MINTESSELLATIONLEVEL If Te > D3DRS_MAXTESSELLATIONLEVEL || Te < 0, then Te = D3DRS_MAXTESSELLATIONLEVEL Te2 = MaxTessellationLevel * TFactore2 / Ze2eye Te1 = MaxTessellationLevel * TFactore1 / Ze1eye The tessellation level (Te) for an edge e, represented by two control vertices (Ve1, Ve2), is computed as shown below : Vertex Vi: (Xi, Yi, Zi, TFactori (optional)). This is multiplied to the per-vertex tessellation level. This is supplied using the D3DDECLUSAGE_TESSFACTOR, for which usage index must be 0 and input type must be D3DDECLTYPE_FLOAT1. An application can optionally supply a single positive floating-point value per vertex, which can be used to control the rate of tessellation. With D3DORDER_CUBIC order: vertices (0) and (9) are used with pNumSegs, vertices (9) and (6) are used with pNumSegs and vertices (6) and (0) are used with pNumSegs.įor N-patches the triangle vertices are used.įor the rectangle and triangle patches with a Bezier basis, the corner-control vertices are used. ![]() ![]() For example, with D3DORDER_CUBIC order: vertices (1,1) and (1,width-2) are used with pNumSegs, vertices (1,width-2) and (height-2,height-2) are used with pNumSegs, vertices (height-2,width-2) and (1,width-2) are used with pNumSegs, and vertices (2,1) and (1,1) are used with pNumSegs.įor the triangle patches, the corner patch vertices are used. The algorithm for computing Ti for rectangle patches, triangle patches, and N-patches differs in what control vertices are used to compute the tessellation level.įor the rectangle patches with a B-spline basis, the four outermost control vertices are used. The Ti's for each vertex along an edge of a patch are averaged to obtain a tessellation level for that edge. The tessellation level is then clamped to values, defined by the two additional render states D3DRS_MINTESSELLATIONLEVEL and D3DRS_MAXTESSELLATIONLEVEL, which define the minimum and maximum tessellation levels to be clamped to. The MaxTessellationLevel is equal to a value set by IDirect3DDevice9::SetNPatchMode for N-patches and, for RT-patches, it is equal to pNumSegs. The function to compute a tessellation level Ti from Zieye is assumed to be (MaxTessellationLevel/Zieye), which means that the MaxTessellationLevel is the tessellation level at Z = 1 in eye space. It also could be used to apply a scale to Zieye. This 4-vector could be the third column of the concatenated world and view matrices. The 4D vector (Mdm) is specified by the application using four render states (D3DRS_ADAPTIVETESS_X, D3DRS_ADAPTIVETESS_Y, D3DRS_ADAPTIVETESS_Z, and D3DRS_ADAPTIVETESS_W). The z-coordinates (Zi) of control vertices (Vi), which are transformed into eye space (Zieye) by performing a dot product with a 4-vector, are used as the depth values. This feature is enabled by the D3DRS_ENABLEADAPTIVETESSELLATION and adaptively tessellates a patch, based on the depth value of the control vertex in eye space. Adaptive TessellationĪdaptive tessellation can be applied to high-order primitives including N-patches, rectangle patches, and triangle patches. typedef struct _D3DRECTPATCH_INFOĭrivers need to fix compilation errors that will result from this change when they compile with the new headers. The change in degree type affected two other structures. This used to be D3DORDERTYPE and D3DORDER* In Direct3D 9, the degree is now specified by D3DDEGREETYPE. ![]() In DirectX 8.x, what was called ORDER was really the degree. ![]() For more information about vertex declarations, see D3DVERTEXELEMENT9. If a vertex declaration containing these methods is used to draw a triangle patch, IDirect3DDevice9::DrawTriPatch will fail. This is specified through a vertex declaration using D3DDECLMETHOD_PARTIALU or D3DDECLMETHOD_PARTIALV. Look up per-vertex displacement values from a displacement map and pass them on to a vertex shader.Perform adaptive tessellation of all higher-order primitives.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |