AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Tessellation shader examples3/10/2024 ![]() The fixed function tessellator doesn't look at any other hull shader outputs (such as the patch constant data or any of the control points). A quad domain requires four tessellation factors for the edges and two additional factors (identified by SV_InsideTessFactor) for tessellating the inside of the patch. As a minimum, the function must calculate per-patch tessellation factors for the tessellator stage which are identified with SV_TessFactor.A patch function can see all the input control points for each patch, there are 32 control points per patch in this example. One input parameter is the input control points, declared in VS_CONTROL_POINT_OUTPUT in this example.One input specifies a variable containing a patch id, and is identified by the SV_PrimitiveID system value (see semantics in shader model 4).Properties of the patch constant function include: HS_CONSTANT_DATA_OUTPUT SubDToBezierConstantsHS( A patch constant function executes once for each patch to calculate any data that is constant for the entire patch (as opposed to per-control point data, which is computed in the hull shader). The domain shader - which is invoked for each point the fixed function tessellator generates - will see as its input all the hull shader's output control points and all the output patch constant data the shader evaluates the patch at its location.ĭefine a patch constant function. ![]() The fixed function tessellator doesn't look at any other hull shader outputs, such as other patch constant data or any of the control points. The required outputs are different for the triangle and isoline domains. Output patch constant data.įor a quad domain, SV_TessFactor defines 4 edge tessellation factors (to tessellate the edges), since the fixed function tessellator needs to know how much to tessellate. Input control pointĭefine output patch constant data. The hull shader implements calculations on each control point the hull shader also calls the patch constant function which implements calculations on each patch.Īfter you have designed a hull shader, see How To: Create a Hull Shader to learn how to create a hull shader.ĭefine hull shader input control and output control points. This topics shows how to design a hull shader.Ī hull shader requires two functions, the main hull shader and a patch constant function. A hull shader is the first of three stages that work together to implement tessellation (the other two stages are the tessellator and a domain shader).
0 Comments
Read More
Leave a Reply. |