Two orders of magnitude improvement in performance when object is close to camera! Combined with Distance Adaptive, almost as fast as without tessellation when viewed from far away. This seems unnatural because graphics applications usually have (0,0) in the top-left corner and (width,height) in the bottom-right corner, but its an excellent way to simplify 3D calculations and to stay resolution independent. HS_CONTROL_POINT_OUTPUT HS( InputPatch inputPatch, uint uCPID : SV_OutputControlPointID ) // end of for loopĤ5 Displacement Adaptive Tessellation Demo Just like a graph, the center has coordinates (0,0) and the y axis is positive above the center. Pd3dImmediateContext->VSSetShader( g_pTessellationVS, NULL, 0 ) pd3dImmediateContext->HSSetShader( g_pTessellationHS, NULL, 0) pd3dImmediateContext->DSSetShader( g_pTessellationDS, NULL, 0) pd3dImmediateContext->GSSetShader( NULL, NULL, 0 ) Pd3dImmediateContext->PSSetShader( g_pSimplePS, NULL, 0 ) // set the vertex buffer UINT stride = sizeof(Vertex) UINT offset = 0 pd3dImmediateContext->IASetVertexBuffers( 0, 1, &g_pMeshVB, &stride, &offset ) // set input layout pd3dImmediateContext->IASetInputLayout( g_pVertexLayout ) // set the primitive topology pd3dImmediateContext->IASetPrimitiveTopology( D3D11_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST) // Draw the model pd3dImmediateContext->Draw( g_iCount * 3, 0 ) ġ3 Simple Hull Shader (control point phase) PIXEL SHADER Displaced Mesh Final Image Diffuse Texture Normal Map HULL SHADER TESSELLATOR Triangle Patch Mesh Tessellated Meshġ0 A simple example of tessellation (part 2)ĭOMAIN SHADER Tessellated Mesh Displaced Mesh Displacement Mapġ1 A simple example of tessellation (part 3) Level 1.0 Level 1.5 Level 3.0ĭomain Shader Runs once per vertex for surface evaluation at each vertex Vertex data passed in as parametric coordinatesĩ A simple example of tessellation (part 1) Generates the new vertices Higher tessellation factors mean more triangles generated. Hull Shader Control point phase Runs once per control point Patch constant phase Runs once per input primitive Returns tessellation factors Tessellating unnecessarily! Triangles not seen Triangles too small Overview of Direct3D tessellation Design of Hull and Domain Shaders Two simple examples How to write efficient tessellation code An advanced exampleģ There are many really good reasons for using tessellationĬompact representation Real-time, continuous level of detail Better looking silhouettes Direct rendering of high-order surfaces created by modeling software Faster – Animations can be done on the lower resolution meshĤ. The function available for this purpose returns a handle for the container. The tessellation pipeline has three sub-stages: tessellation control, primitive generation, and tessellation evaluation. This constant can be queried with glGetIntegerv. The first step is creating an object which will act as a shader container. 1 glPatchParameteri ( GLPATCHVERTICES, verticesPerPatch ) where verticesPerPatch must be an integer in 1, GLMAXPATCHVERTICES. Presentation on theme: "Direct3D 11 Tutorial: Tessellation"- Presentation transcript:īill Bilodeau ISV Relations Group AMD V1.0 The following figure shows the necessary steps to create a shader.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |