QGLShaderProgram Class Reference
[QtOpenGL module]
该QGLShaderProgram类允许的OpenGL着色器程序链接和使用。More…
继承QObject。
Methods
__init__ (self, QObject parent = None)
__init__ (self, QGLContext context, QObject parent = None)
bool addShader (self, QGLShader shader)
bool addShaderFromSourceCode (self, QGLShader.ShaderType type, QByteArray source)
bool addShaderFromSourceCode (self, QGLShader.ShaderType type, QString source)
bool addShaderFromSourceFile (self, QGLShader.ShaderType type, QString fileName)
int attributeLocation (self, QByteArray name)
int attributeLocation (self, QString name)
bool bind (self)
bindAttributeLocation (self, QByteArray name, int location)
bindAttributeLocation (self, QString name, int location)
disableAttributeArray (self, int location)
disableAttributeArray (self, str name)
enableAttributeArray (self, int location)
enableAttributeArray (self, str name)
int geometryInputType (self)
int geometryOutputType (self)
int geometryOutputVertexCount (self)
bool isLinked (self)
bool link (self)
QString log (self)
int programId (self)
release (self)
removeAllShaders (self)
removeShader (self, QGLShader shader)
setAttributeArray (self, int location, sequence values)
setAttributeArray (self, str name, sequence values)
setAttributeBuffer (self, int location, int type, int offset, int tupleSize, int stride = 0)
setAttributeBuffer (self, str name, int type, int offset, int tupleSize, int stride = 0)
setAttributeValue (self, int location, float value)
setAttributeValue (self, int location, float x, float y)
setAttributeValue (self, int location, float x, float y, float z)
setAttributeValue (self, int location, float x, float y, float z, float w)
setAttributeValue (self, int location, QVector2D value)
setAttributeValue (self, int location, QVector3D value)
setAttributeValue (self, int location, QVector4D value)
setAttributeValue (self, int location, QColor value)
setAttributeValue (self, str name, float value)
setAttributeValue (self, str name, float x, float y)
setAttributeValue (self, str name, float x, float y, float z)
setAttributeValue (self, str name, float x, float y, float z, float w)
setAttributeValue (self, str name, QVector2D value)
setAttributeValue (self, str name, QVector3D value)
setAttributeValue (self, str name, QVector4D value)
setAttributeValue (self, str name, QColor value)
setGeometryInputType (self, int inputType)
setGeometryOutputType (self, int outputType)
setGeometryOutputVertexCount (self, int count)
setUniformValue (self, int location, int value)
setUniformValue (self, int location, float value)
setUniformValue (self, int location, float x, float y)
setUniformValue (self, int location, float x, float y, float z)
setUniformValue (self, int location, float x, float y, float z, float w)
setUniformValue (self, int location, QVector2D value)
setUniformValue (self, int location, QVector3D value)
setUniformValue (self, int location, QVector4D value)
setUniformValue (self, int location, QColor color)
setUniformValue (self, int location, QPoint point)
setUniformValue (self, int location, QPointF point)
setUniformValue (self, int location, QSize size)
setUniformValue (self, int location, QSizeF size)
setUniformValue (self, int location, QMatrix2x2 value)
setUniformValue (self, int location, QMatrix2x3 value)
setUniformValue (self, int location, QMatrix2x4 value)
setUniformValue (self, int location, QMatrix3x2 value)
setUniformValue (self, int location, QMatrix3x3 value)
setUniformValue (self, int location, QMatrix3x4 value)
setUniformValue (self, int location, QMatrix4x2 value)
setUniformValue (self, int location, QMatrix4x3 value)
setUniformValue (self, int location, QMatrix4x4 value)
setUniformValue (self, int location, QTransform value)
setUniformValue (self, str name, int value)
setUniformValue (self, str name, float value)
setUniformValue (self, str name, float x, float y)
setUniformValue (self, str name, float x, float y, float z)
setUniformValue (self, str name, float x, float y, float z, float w)
setUniformValue (self, str name, QVector2D value)
setUniformValue (self, str name, QVector3D value)
setUniformValue (self, str name, QVector4D value)
setUniformValue (self, str name, QColor color)
setUniformValue (self, str name, QPoint point)
setUniformValue (self, str name, QPointF point)
setUniformValue (self, str name, QSize size)
setUniformValue (self, str name, QSizeF size)
setUniformValue (self, str name, QMatrix2x2 value)
setUniformValue (self, str name, QMatrix2x3 value)
setUniformValue (self, str name, QMatrix2x4 value)
setUniformValue (self, str name, QMatrix3x2 value)
setUniformValue (self, str name, QMatrix3x3 value)
setUniformValue (self, str name, QMatrix3x4 value)
setUniformValue (self, str name, QMatrix4x2 value)
setUniformValue (self, str name, QMatrix4x3 value)
setUniformValue (self, str name, QMatrix4x4 value)
setUniformValue (self, str name, QTransform value)
setUniformValueArray (self, int location, sequence values)
setUniformValueArray (self, str name, sequence values)
list-of-QGLShader shaders (self)
int uniformLocation (self, QByteArray name)
int uniformLocation (self, QString name)
Static Methods
bool hasOpenGLShaderPrograms (QGLContext context = None)
Detailed Description
该QGLShaderProgram类允许的OpenGL着色器程序链接和使用。
Introduction
此类支持写在OpenGL着色语言( GLSL )和OpenGL的/ ES着色语言( GLSL / ES)着色器程序。
QGLShader和QGLShaderProgram庇护程序员从编译和连接顶点和片段着色器的详细信息。
下面的示例创建使用附带的源顶点着色器程序code
。一旦编译和链接,着色器程序是在当前激活QGLContext通过调用QGLShaderProgram.bind():
[QGLShader]($docs-qglshader.html) shader([QGLShader]($docs-qglshader.html).Vertex);
shader.compileSourceCode(code);
QGLShaderProgram program(context);
program.addShader(shader);
program.link();
program.bind();
Writing portable shaders
着色器程序可能是因为不同的标准顶点属性和统一的变量支持水平难以跨越的OpenGL实现重用。特别是, GLSL / ES缺乏一切都存在于桌面OpenGL系统的标准变量:gl_Vertex
,gl_Normal
,gl_Color
,等等。桌面OpenGL缺少可变预选赛highp
,mediump
和lowp
。
该QGLShaderProgram类使得编写可移植着色器更容易的前缀与桌面OpenGL以下行的所有着色器程序的过程:
#define highp
#define mediump
#define lowp
这使得它可以运行在桌面系统最GLSL / ES着色器程序。程序员应该限制自己只是功能,是目前在GLSL / ES ,避免标准的变量名只能在桌面上。
Simple shader example
program.addShaderFromSourceCode([QGLShader]($docs-qglshader.html).Vertex,
"attribute highp vec4 vertex;\n"
"uniform highp mat4 matrix;\n"
"void main(void)\n"
"{\n"
" gl_Position = matrix * vertex;\n"
"}");
program.addShaderFromSourceCode([QGLShader]($docs-qglshader.html).Fragment,
"uniform mediump vec4 color;\n"
"void main(void)\n"
"{\n"
" gl_FragColor = color;\n"
"}");
program.link();
program.bind();
int vertexLocation = program.attributeLocation("vertex");
int matrixLocation = program.uniformLocation("matrix");
int colorLocation = program.uniformLocation("color");
有了上面的着色器程序活跃,我们可以得出一个绿色三角形如下:
static GLfloat const triangleVertices[] = {
60.0f, 10.0f, 0.0f,
110.0f, 110.0f, 0.0f,
10.0f, 110.0f, 0.0f
};
[QColor](qcolor.html) color(0, 255, 0, 255);
QMatrix4x4 pmvMatrix;
pmvMatrix.ortho(rect());
program.enableAttributeArray(vertexLocation);
program.setAttributeArray(vertexLocation, triangleVertices, 3);
program.setUniformValue(matrixLocation, pmvMatrix);
program.setUniformValue(colorLocation, color);
glDrawArrays(GL_TRIANGLES, 0, 3);
program.disableAttributeArray(vertexLocation);
Binary shaders and programs
二进制着色器可以使用指定glShaderBinary()
从返回值QGLShader.shaderId( ) 。该QGLShader实例包含二进制然后可以加入到着色器程序以addShader()和以通常的方式联系在一起link( ) 。
二进制程序可以使用指定glProgramBinaryOES()
从返回值programId( ) 。然后,应用程序应调用link(),它会注意到,该方案已经指定和链接,让其他操作要在着色器程序进行。
Method Documentation
QGLShaderProgram.__init__ (self, QObject parent = None)
该parent的说法,如果不是没有,原因self通过Qt的,而不是PyQt的拥有。
构造一个新的着色器程序并将其附加到parent。该计划将是无效的,直到addShader()被调用。
在着色器程序将与当前相关联QGLContext。
See also addShader( ) 。
QGLShaderProgram.__init__ (self, QGLContext context, QObject parent = None)
该parent的说法,如果不是没有,原因self通过Qt的,而不是PyQt的拥有。
构造一个新的着色器程序并将其附加到parent。该计划将是无效的,直到addShader()被调用。
该着色器程序将与关联context。
See also addShader( ) 。
bool QGLShaderProgram.addShader (self, QGLShader shader)
增加了一个编译shader该着色器程序。返回True如果着色器可以添加,否则返回False。
所有权shader对象保持与来电者。它不会被删除时,这QGLShaderProgram实例被删除。这允许调用者相同的着色器添加到多个着色器程序。
See also addShaderFromSourceCode( )addShaderFromSourceFile( )removeShader( )link()和removeAllShaders( ) 。
bool QGLShaderProgram.addShaderFromSourceCode (self, QGLShader.ShaderType type, QByteArray source)
编译source作为指定的着色器type并将其添加到该着色器程序。返回True如果编译成功,否则返回False。编译错误和警告将透过提供log( ) 。
该功能的目的是成为一个捷径可以快速添加顶点和片段着色器的着色器程序,而无需创建一个实例QGLShader第一。
See also addShader( )addShaderFromSourceFile( )removeShader( )link( )log()和removeAllShaders( ) 。
bool QGLShaderProgram.addShaderFromSourceCode (self, QGLShader.ShaderType type, QString source)
这是一个重载函数。
编译source作为指定的着色器type并将其添加到该着色器程序。返回True如果编译成功,否则返回False。编译错误和警告将透过提供log( ) 。
该功能的目的是成为一个捷径可以快速添加顶点和片段着色器的着色器程序,而无需创建一个实例QGLShader第一。
See also addShader( )addShaderFromSourceFile( )removeShader( )link( )log()和removeAllShaders( ) 。
bool QGLShaderProgram.addShaderFromSourceFile (self, QGLShader.ShaderType type, QString fileName)
编译的内容fileName作为指定的着色器type并将其添加到该着色器程序。返回True如果编译成功,否则返回False。编译错误和警告将透过提供log( ) 。
该功能的目的是成为一个捷径可以快速添加顶点和片段着色器的着色器程序,而无需创建一个实例QGLShader第一。
See also addShader()和addShaderFromSourceCode( ) 。
int QGLShaderProgram.attributeLocation (self, QByteArray name)
返回属性的位置name在此着色器程序的参数列表。返回-1,如果name是不是这个着色器程序的有效属性。
See also uniformLocation()和bindAttributeLocation( ) 。
int QGLShaderProgram.attributeLocation (self, QString name)
这是一个重载函数。
返回属性的位置name在此着色器程序的参数列表。返回-1,如果name是不是这个着色器程序的有效属性。
See also uniformLocation()和bindAttributeLocation( ) 。
bool QGLShaderProgram.bind (self)
此着色器程序绑定到活动QGLContext并使其成为当前着色器程序。所有以前绑定的着色器程序被释放。这等同于调用glUseProgram()
上programId( ) 。返回True如果该程序已成功绑定,否则为False 。如果着色器程序还没有被链接,或者它需要被重新链接,该函数将调用link( ) 。
QGLShaderProgram.bindAttributeLocation (self, QByteArray name, int location)
绑定属性name到指定的location。此功能可调用的程序已被证实与之前或之后。还没有当程序被链接被明确约束的任何属性将被自动分配位置。
当这个函数被调用的程序被连接后,该程序将需要重新链接至使更改生效。
See also attributeLocation( ) 。
QGLShaderProgram.bindAttributeLocation (self, QString name, int location)
这是一个重载函数。
绑定属性name到指定的location。此功能可调用的程序已被证实与之前或之后。还没有当程序被链接被明确约束的任何属性将被自动分配位置。
当这个函数被调用的程序被连接后,该程序将需要重新链接至使更改生效。
See also attributeLocation( ) 。
QGLShaderProgram.disableAttributeArray (self, int location)
禁用顶点数组location在由以前调用启用此着色器程序enableAttributeArray( ) 。
See also enableAttributeArray( )setAttributeArray( )setAttributeValue()和setUniformValue( ) 。
QGLShaderProgram.disableAttributeArray (self, str name)
这是一个重载函数。
禁用顶点数组称为name在由以前调用启用此着色器程序enableAttributeArray( ) 。
See also enableAttributeArray( )setAttributeArray( )setAttributeValue()和setUniformValue( ) 。
QGLShaderProgram.enableAttributeArray (self, int location)
启用顶点数组location在这个shader程序,以便通过设置的值setAttributeArray( )上location将用于由所述着色器程序。
See also disableAttributeArray( )setAttributeArray( )setAttributeValue()和setUniformValue( ) 。
QGLShaderProgram.enableAttributeArray (self, str name)
这是一个重载函数。
使顶点数组称为name在这个shader程序,以便通过设置的值setAttributeArray( )上name将用于由所述着色器程序。
See also disableAttributeArray( )setAttributeArray( )setAttributeValue()和setUniformValue( ) 。
int QGLShaderProgram.geometryInputType (self)
返回几何着色器输入类型,如果活跃。
此参数将在下次程序连动效应。
此功能被引入Qt的4.7 。
See also setGeometryInputType( ) 。
int QGLShaderProgram.geometryOutputType (self)
返回几何着色器输出类型,如果活跃。
此参数将在下次程序连动效应。
此功能被引入Qt的4.7 。
See also setGeometryOutputType( ) 。
int QGLShaderProgram.geometryOutputVertexCount (self)
返回顶点的当前几何着色器程序会产生,如果活跃的最大数目。
此参数生效ntext的时间程序链接。
此功能被引入Qt的4.7 。
See also setGeometryOutputVertexCount( ) 。
bool QGLShaderProgram.hasOpenGLShaderPrograms (QGLContext context = None)
否则返回False ,如果写在OpenGL着色语言( GLSL )着色器程序在该系统上都支持,则返回True 。
该context用于解析GLSL的扩展。如果context为null,则QGLContext.currentContext( )被使用。
bool QGLShaderProgram.isLinked (self)
返回True如果着色器程序已被链接,否则为False 。
See also link( ) 。
bool QGLShaderProgram.link (self)
链接在一起,加入到这个计划与着色器addShader( ) 。返回True如果链接成功,否则返回False。如果链接失败,错误消息可以检索与log( ) 。
子类可以重载这个函数来初始化属性和统一的变量在特定着色器程序中使用。
如果着色器程序已经联系在一起,再调用这个函数将迫使它重新链接。
QString QGLShaderProgram.log (self)
在过去的返回所发生的错误和警告link()或addShader( )和显式指定的源代码。
See also link( ) 。
int QGLShaderProgram.programId (self)
返回与此着色器程序相关联的OpenGL的标识符。
See also QGLShader.shaderId( ) 。
QGLShaderProgram.release (self)
释放从当前活动的着色器程序QGLContext。这等同于调用glUseProgram(0)
。
See also bind( ) 。
QGLShaderProgram.removeAllShaders (self)
删除所有被添加到这个程序,以前的着色器。该QGLShader如果他们在外部构造为着色器对象将不会被删除。QGLShader这是由内部构造的对象QGLShaderProgram将被删除。
See also addShader()和removeShader( ) 。
QGLShaderProgram.removeShader (self, QGLShader shader)
移除shader从这个着色器程序。对象不会被删除。
See also addShader( )link()和removeAllShaders( ) 。
QGLShaderProgram.setAttributeArray (self, int location, sequence values)
设置顶点数组values在上面的属性location在此着色器程序。该tupleSize表示每个顶点组件(4 1,2 ,3,或)的数量,以及stride表示顶点之间的字节数。默认stride零值表示该顶点被致密地填充values。
该阵列会变得活跃时enableAttributeArray( )被调用的location。否则,使用指定的值setAttributeValue( )为location将被使用。
See also setAttributeValue( )setUniformValue( )enableAttributeArray()和disableAttributeArray( ) 。
QGLShaderProgram.setAttributeArray (self, str name, sequence values)
设置二维顶点数组values在上面的属性location在此着色器程序。该stride表示顶点之间的字节数。默认stride零值表示该顶点被致密地填充values。
该阵列会变得活跃时enableAttributeArray( )被调用的location。否则,使用指定的值setAttributeValue( )为location将被使用。
See also setAttributeValue( )setUniformValue( )enableAttributeArray()和disableAttributeArray( ) 。
QGLShaderProgram.setAttributeBuffer (self, int location, int type, int offset, int tupleSize, int stride = 0)
设置在顶点属性值中的一个阵列location在此着色器程序,起始于一个特定的offset在当前绑定的顶点缓冲。该stride表示顶点之间的字节数。默认stride零值表示该顶点被密集的值的数组中。
该type表示元素的顶点值阵列中的类型,通常GL_FLOAT
,GL_UNSIGNED_BYTE
等。tupleSize表示每个顶点部件的数量:1,2 ,3,或4 。
该阵列会变得活跃时enableAttributeArray( )被调用的location。否则,使用指定的值setAttributeValue( )为location将被使用。
此功能被引入Qt的4.7 。
See also setAttributeArray( ) 。
QGLShaderProgram.setAttributeBuffer (self, str name, int type, int offset, int tupleSize, int stride = 0)
这是一个重载函数。
设置在顶点属性值的数组,称为name在此着色器程序,起始于一个特定的offset在当前绑定的顶点缓冲。该stride表示顶点之间的字节数。默认stride零值表示该顶点被密集的值的数组中。
该type表示元素的顶点值阵列中的类型,通常GL_FLOAT
,GL_UNSIGNED_BYTE
等。tupleSize表示每个顶点部件的数量:1,2 ,3,或4 。
该阵列会变得活跃时enableAttributeArray( )被调用的name。否则,使用指定的值setAttributeValue( )为name将被使用。
此功能被引入Qt的4.7 。
See also setAttributeArray( ) 。
QGLShaderProgram.setAttributeValue (self, int location, float value)
在设置该属性location在目前情况下,以value。
See also setUniformValue( ) 。
QGLShaderProgram.setAttributeValue (self, int location, float x, float y)
在设置该属性location在目前情况下,以二维矢量(x,y) 。
See also setUniformValue( ) 。
QGLShaderProgram.setAttributeValue (self, int location, float x, float y, float z)
在设置该属性location在当前上下文中的三维矢量(x,y,z) 。
See also setUniformValue( ) 。
QGLShaderProgram.setAttributeValue (self, int location, float x, float y, float z, float w)
在设置该属性location在目前情况下的4D向量(x,y,z,w) 。
See also setUniformValue( ) 。
QGLShaderProgram.setAttributeValue (self, int location, QVector2D value)
在设置该属性location在目前情况下,以value。
See also setUniformValue( ) 。
QGLShaderProgram.setAttributeValue (self, int location, QVector3D value)
在设置该属性location在目前情况下,以value。
See also setUniformValue( ) 。
QGLShaderProgram.setAttributeValue (self, int location, QVector4D value)
在设置该属性location在目前情况下,以value。
See also setUniformValue( ) 。
QGLShaderProgram.setAttributeValue (self, int location, QColor value)
在设置该属性location在目前情况下,以value。
See also setUniformValue( ) 。
QGLShaderProgram.setAttributeValue (self, str name, float value)
在设置该属性location在当前上下文中的内容values,其中包含columns元素,每个元素包括rows元素。该rows值应为1,2, 3,或4 。这个功能通常是用来设置矩阵值和列向量。
See also setUniformValue( ) 。
QGLShaderProgram.setAttributeValue (self, str name, float x, float y)
这是一个重载函数。
所谓设置该属性name在目前情况下,以value。
See also setUniformValue( ) 。
QGLShaderProgram.setAttributeValue (self, str name, float x, float y, float z)
这是一个重载函数。
所谓设置该属性name在目前情况下,以二维矢量(x,y) 。
See also setUniformValue( ) 。
QGLShaderProgram.setAttributeValue (self, str name, float x, float y, float z, float w)
这是一个重载函数。
所谓设置该属性name在当前上下文中的三维矢量(x,y,z) 。
See also setUniformValue( ) 。
QGLShaderProgram.setAttributeValue (self, str name, QVector2D value)
这是一个重载函数。
所谓设置该属性name在目前情况下的4D向量(x,y,z,w) 。
See also setUniformValue( ) 。
QGLShaderProgram.setAttributeValue (self, str name, QVector3D value)
这是一个重载函数。
所谓设置该属性name在目前情况下,以value。
See also setUniformValue( ) 。
QGLShaderProgram.setAttributeValue (self, str name, QVector4D value)
这是一个重载函数。
所谓设置该属性name在目前情况下,以value。
See also setUniformValue( ) 。
QGLShaderProgram.setAttributeValue (self, str name, QColor value)
这是一个重载函数。
所谓设置该属性name在目前情况下,以value。
See also setUniformValue( ) 。
QGLShaderProgram.setGeometryInputType (self, int inputType)
设定从输入型inputType。
此参数将在下次程序连动效应。
See also geometryInputType( ) 。
QGLShaderProgram.setGeometryOutputType (self, int outputType)
从几何着色器设置输出类型,如果活跃,outputType。
此参数将在下次程序连动效应。
此功能被引入Qt的4.7 。
See also geometryOutputType( ) 。
QGLShaderProgram.setGeometryOutputVertexCount (self, int count)
设置顶点的当前几何着色器程序会产生,如果活跃,最大数量count。
此参数将在下次程序连动效应。
此功能被引入Qt的4.7 。
See also geometryOutputVertexCount( ) 。
QGLShaderProgram.setUniformValue (self, int location, int value)
设置在匀变速location在目前情况下,以value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, float value)
设置在匀变速location在目前情况下,以value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, float x, float y)
设置在匀变速location在目前情况下,以value。设置采样值时,此功能应该被使用。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, float x, float y, float z)
设置在匀变速location在目前情况下,以二维矢量(x,y) 。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, float x, float y, float z, float w)
设置在匀变速location在当前上下文中的三维矢量(x,y,z) 。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, QVector2D value)
设置在匀变速location在目前情况下的4D向量(x,y,z,w) 。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, QVector3D value)
设置在匀变速location在目前情况下,以value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, QVector4D value)
设置在匀变速location在目前情况下,以value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, QColor color)
设置在匀变速location在目前情况下,以value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, QPoint point)
设置在匀变速location在当前背景下的红色,绿色,蓝色和alpha分量color。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, QPointF point)
设置在匀变速location在当前上下文中的x和y坐标point。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, QSize size)
设置在匀变速location在当前上下文中的x和y坐标point。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, QSizeF size)
设置在匀变速location在目前情况下,以给定的宽度和高度size。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, QMatrix2x2 value)
设置在匀变速location在目前情况下,以给定的宽度和高度size。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, QMatrix2x3 value)
设置在匀变速location在目前情况下,以一个2x2的矩阵value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, QMatrix2x4 value)
设置在匀变速location在目前情况下,以一个2×3矩阵value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, QMatrix3x2 value)
设置在匀变速location在目前情况下,以一个2x4的矩阵value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, QMatrix3x3 value)
设置在匀变速location在目前情况下,以一个3x2的矩阵value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, QMatrix3x4 value)
设置在匀变速location在目前情况下,以一个3x3矩阵value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, QMatrix4x2 value)
设置在匀变速location在目前情况下,以一个3x4的矩阵value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, QMatrix4x3 value)
设置在匀变速location在目前情况下,以一个4×2矩阵value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, QMatrix4x4 value)
设置在匀变速location在目前情况下,以一个4x3的矩阵value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, int location, QTransform value)
设置在匀变速location在目前情况下,以一个4x4矩阵value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, int value)
设置在匀变速location在目前情况下,以一个3x3变换矩阵value被指定为一个QTransform值。
要设置QTransform值作为着色器,使用一个4x4矩阵setUniformValue(location, QMatrix4x4(value))
。
QGLShaderProgram.setUniformValue (self, str name, float value)
这是一个重载函数。
设置叫做匀变速name在目前情况下,以value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, float x, float y)
这是一个重载函数。
设置叫做匀变速name在目前情况下,以value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, float x, float y, float z)
这是一个重载函数。
设置叫做匀变速name在目前情况下,以value。设置采样值时,此功能应该被使用。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, float x, float y, float z, float w)
这是一个重载函数。
设置叫做匀变速name在目前情况下,以二维矢量(x,y) 。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, QVector2D value)
这是一个重载函数。
设置叫做匀变速name在当前上下文中的三维矢量(x,y,z) 。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, QVector3D value)
这是一个重载函数。
设置叫做匀变速name在目前情况下的4D向量(x,y,z,w) 。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, QVector4D value)
这是一个重载函数。
设置叫做匀变速name在目前情况下,以value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, QColor color)
这是一个重载函数。
设置叫做匀变速name在目前情况下,以value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, QPoint point)
这是一个重载函数。
设置叫做匀变速name在目前情况下,以value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, QPointF point)
这是一个重载函数。
设置叫做匀变速name在当前背景下的红色,绿色,蓝色和alpha分量color。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, QSize size)
这是一个重载函数。
设置与统一的变量相关联name在当前上下文中的x和y坐标point。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, QSizeF size)
这是一个重载函数。
设置与统一的变量相关联name在当前上下文中的x和y坐标point。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, QMatrix2x2 value)
这是一个重载函数。
设置与统一的变量相关联name在目前情况下,以给定的宽度和高度size。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, QMatrix2x3 value)
这是一个重载函数。
设置与统一的变量相关联name在目前情况下,以给定的宽度和高度size。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, QMatrix2x4 value)
这是一个重载函数。
设置叫做匀变速name在目前情况下,以一个2x2的矩阵value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, QMatrix3x2 value)
这是一个重载函数。
设置叫做匀变速name在目前情况下,以一个2×3矩阵value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, QMatrix3x3 value)
这是一个重载函数。
设置叫做匀变速name在目前情况下,以一个2x4的矩阵value。
See also setAttributeValue().
QGLShaderProgram.setUniformValue (self, str name, QMatrix3x4 value)
这是一个重载函数。
设置叫做匀变速name在目前情况下,以一个3x2的矩阵value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, QMatrix4x2 value)
这是一个重载函数。
设置叫做匀变速name在目前情况下,以一个3x3矩阵value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, QMatrix4x3 value)
这是一个重载函数。
设置叫做匀变速name在目前情况下,以一个3x4的矩阵value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, QMatrix4x4 value)
这是一个重载函数。
设置叫做匀变速name在目前情况下,以一个4×2矩阵value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValue (self, str name, QTransform value)
这是一个重载函数。
设置叫做匀变速name在目前情况下,以一个4x3的矩阵value。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValueArray (self, int location, sequence values)
设置统一的变量数组location在目前情况下对count元素values。每个元素都有tupleSize组件。该tupleSize必须是1, 2,3,或4。
See also setAttributeValue( ) 。
QGLShaderProgram.setUniformValueArray (self, str name, sequence values)
设置统一的变量数组location在目前情况下对count元素values。
See also setAttributeValue( ) 。
list-of-QGLShader QGLShaderProgram.shaders (self)
返回已被添加到该着色器程序中所有着色器的使用列表addShader( ) 。
See also addShader()和removeShader( ) 。
int QGLShaderProgram.uniformLocation (self, QByteArray name)
返回均匀的变量的位置name在此着色器程序的参数列表。返回-1,如果name是不是这个着色器程序一个有效的统一变量。
See also attributeLocation( ) 。
int QGLShaderProgram.uniformLocation (self, QString name)
这是一个重载函数。
返回均匀的变量的位置name在此着色器程序的参数列表。返回-1,如果name是不是这个着色器程序一个有效的统一变量。
See also attributeLocation( ) 。