![]() 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(并且vertex shader的执行结果就是tessellation control shader的输入). When tessellation is active, the vertex shader runs once per control point(当激活tessellation的时候,vertex shader是每个点会执行一次), 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(而tessellation control shader是按照patch执行的,每个patch中点数数目是用API去设置好的). The maximum number of control points that can be used to form a single patch is implementation defined(每个patch的控制点的上线个数会因为硬件不一样而不一样), but is guaranteed to be at least 32(但至少这个数目会有32个) Thus, if this is what you want(as in our example application), you don’t need to call it at all(如果你的 patch就是由三个点组成的话,你就不用调用这个API). Void glPatchParameteri(GLenum pname,GLint value) īy default, the number of control points per patch is three(缺省情况下,每个patch的控制点数量是3). The prototype of glPatchParameteri() is(这个API的定义如下) Tessellation in OpenGL works by breaking down high-order surfaces known as patches into points, lines, or triangles.(在OpenGL中,Tessellation主要是把高阶的patch图形变成点、线、三角形) Each patch is formed from a number of control points.(每一个patch的数据是从一堆控制点钟获取的) 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(控制点的数量是可以通过glPatchParameteri来设置的,pname参数传GL_PATCH_VERTICES,value参数设置每个patch的控制点个数). (tessellation shader的第一部分叫tessellation control shader) This shader takes its input from the vertex shader and is primarily responsible for two things(它的输入数据是由vertex shader给的,它主要干两件事): the determination of the level of tessellation that will be sent to the tessellation engine(第一件是确定发送给tessellation引擎的tessellation的级别), and the generation of data that will be sent to the tessellation evaluation shader that is run after tessellation has occurred(以及生成将会被在tessellation发生后,tessellation evaluation shader使用的数据) ![]() 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(逻辑上来说,tessellation阶段是紧接着vertex shader阶段的) and is made up of three parts: the tessellation control shader, the fixed-function tessellation engine, and the tessellation evaluation shader( 并且tessellation阶段由三个部分组成: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(OpenGL的固定功能部分,可以通过配置tessellation引擎,能够将一些四边形、三角形、线变成大量的硬件光栅化时可以支持处理的小的点、线和三角形). ![]() Tessellation is the process of breaking a high-order primitive (which is known as a patch in OpenGL) into many smaller(Tessellation就是把很多高阶的图元变成很多小图元的过程), simpler primitives such as triangles for rendering(比如说三角形这种简单的图元). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |