![]() The number of control points produced by the control shader is set using an output layout qualifier in the control shader’s source code. The number of control points per patch can be changed such that the number of control points that is output by the tessellation control shader can differ from the number of control points that it consumes. That is, vertices are used as control points and the result of the vertex shader is passed in batches to the tessellation control shader as its input. ![]() When tessellation is active, the vertex shader runs once per control point, while the tessellation control shader runs in batches on groups of control points where the size of each batch is the same as the number of vertices per patch. The maximum number of control points that can be used to form a single patch is implementation defined, but is guaranteed to be at least 32. Thus, if this is what you want (as in our example application), you don’t need to call it at all. The prototype of glPatchParameteri() is void glPatchParameteri(GLenum pname,īy default, the number of control points per patch is three. The number of control points per patch is configurable and set by calling glPatchParameteri() with pname set to GL_PATCH_VERTICES and value set to the number of control points that will be used to construct each patch. Each patch is formed from a number of control points. Tessellation in OpenGL works by breaking down high-order surfaces known as patches into points, lines, or triangles. This shader takes its input from the vertex shader and is primarily responsible for two things: the determination of the level of tessellation that will be sent to the tessellation engine, and the generation of data that will be sent to the tessellation evaluation shader that is run after tessellation has occurred. The first of the three tessellation phases is the tessellation control shader (TCS sometimes known as simply the control shader). Logically, the tessellation phase sits directly after the vertex shading stage in the OpenGL pipeline and is made up of three parts: the tessellation control shader, the fixed-function tessellation engine, and the tessellation evaluation shader. OpenGL includes a fixed-function, configurable tessellation engine that is able to break up quadrilaterals, triangles, and lines into a potentially large number of smaller points, lines, or triangles that can be directly consumed by the normal rasterization hardware further down the pipeline. Tessellation is the process of breaking a high-order primitive (which is known as a patch in OpenGL) into many smaller, simpler primitives such as triangles for rendering. OpenGL Superbible: Comprehensive Tutorial and Reference, 7th Edition
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |