Graphics Reference
In-Depth Information
How it works…
As already covered in Chapter 1 , Getting Started with Direct3D , the tessellation phase of
the graphics pipeline incorporates three distinct stages, the hull shader, the fixed function
tessellator, and the domain shader.
The hull shader is made of two shader functions: the hull shader itself that is responsible for
outputting per control point properties, and the patch constant function that is responsible for
outputting per patch properties and tessellation factor that will be used by the fixed function
tessellator stage. Both the methods have access to the entire input patch. After the fixed
function tessellator stage is processed, the new geometry is passed to the domain shader,
where the attributes of each new control point can be determined.
Tessellation pipeline for a triangle domain
While creating the triangle hull shader, we have indicated with the domain attribute that the
domain of the tessellator is triangles, and this instructs the fixed function tessellator stage
to generate barycentric coordinates as the SV_DomainLocation parameter that is passed
to the domain shader. This domain attribute must be consistent across the hull and domain
shaders currently bound to the pipeline.
[domain("tri")]
The impact of the partitioning attribute upon the tessellator is shown in the previous
example output. You can see that depending on the selected partitioning method and for
the same tessellation factor, additional geometry of varying amount is generated at different
locations. This is best experienced by seeing the tessellation factor slowly increasing in time.
 
Search WWH ::




Custom Search