openGL API glPatchParameteri函数详解

openGL系列文章目录

glPatchParameteri官网

官网

在这里插入图片描述

Name
glPatchParameter — specifies the parameters for patch primitives

C Specification
void glPatchParameteri( GLenum pname,
GLint value);

void glPatchParameterfv( GLenum pname,
const GLfloat *values);

Parameters
pname
Specifies the name of the parameter to set. The symbolc constants GL_PATCH_VERTICES, GL_PATCH_DEFAULT_OUTER_LEVEL, and GL_PATCH_DEFAULT_INNER_LEVEL are accepted.

value
Specifies the new value for the parameter given by pname.

values
Specifies the address of an array containing the new values for the parameter given by pname.

Description
glPatchParameter specifies the parameters that will be used for patch primitives. pname specifies the parameter to modify and must be either GL_PATCH_VERTICES, GL_PATCH_DEFAULT_OUTER_LEVEL or GL_PATCH_DEFAULT_INNER_LEVEL. For glPatchParameteri, value specifies the new value for the parameter specified by pname. For glPatchParameterfv, values specifies the address of an array containing the new values for the parameter specified by pname.

When pname is GL_PATCH_VERTICES, value specifies the number of vertices that will be used to make up a single patch primitive. Patch primitives are consumed by the tessellation control shader (if present) and subsequently used for tessellation. When primitives are specified using glDrawArrays or a similar function, each patch will be made from parameter control points, each represented by a vertex taken from the enabeld vertex arrays. parameter must be greater than zero, and less than or equal to the value of GL_MAX_PATCH_VERTICES.

When pname is GL_PATCH_DEFAULT_OUTER_LEVEL or GL_PATCH_DEFAULT_INNER_LEVEL, values contains the address of an array contiaining the default outer or inner tessellation levels, respectively, to be used when no tessellation control shader is present.

Errors
GL_INVALID_ENUM is generated if pname is not an accepted value.

GL_INVALID_VALUE is generated if pname is GL_PATCH_VERTICES and value is less than or equal to zero, or greater than the value of GL_MAX_PATCH_VERTICES.

Version Support
OpenGL Version
Function / Feature Name 2.0 2.1 3.0 3.1 3.2 3.3 4.0 4.1 4.2 4.3 4.4 4.5
glPatchParameterfv - - - - - - ✔ ✔ ✔ ✔ ✔ ✔
glPatchParameteri - - - - - - ✔ ✔ ✔ ✔ ✔ ✔
See Also
glDrawArrays, glDrawArraysInstanced, glDrawElements, glDrawRangeElements,

Copyright
Copyright © 2010-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

一、翻译

名称
glPatchParameteri —指定补丁原语的参数

C 规范
void glPatchParameteri( GLenum pname, GLint value);

参数
pname
指定要设置的参数的名称。接受符号常量GL_PATCH_VERTICES。
value
为pname给定的参数指定新值。

values
指定包含pname给定参数的新值的数组的地址。

描述
glPatchParameteri指定将用于修补程序原语的参数。 pname指定要修改的参数,并且必须为GL_PATCH_VERTICES。 value为pname指定的参数指定新值。

当pname为GL_PATCH_VERTICES时,value指定将用于构成单个面片基元的顶点数。修补程序基元由镶嵌细分控制着色器(如果存在)消耗,随后用于镶嵌细分。使用glDrawArrays或类似函数指定图元时,每个面片均由参数控制点组成,每个控制点均由从enabeld顶点数组中提取的顶点表示。参数必须大于零,并且小于或等于GL_MAX_PATCH_VERTICES的值。

错误
如果pname不是可接受的值,则生成GL_INVALID_ENUM。

如果pname为GL_PATCH_VERTICES,并且值小于或等于零,或者大于GL_MAX_PATCH_VERTICES的值,则生成GL_INVALID_VALUE。

API支持版本
函数名 2.0 3.0 3.1 3.2
glPatchParameteri - - - ✔
另见
glDrawArrays, glDrawArraysInstanced, glDrawElements, glDrawRangeElements,

版权
https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glPatchParameteri.xhtml
Copyright © 2010-2015 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值