QGLShaderProgram

注意

该类在 Qt4.6 引入

概要

函数

虚函数

静态函数

详细描述

PySide.QtOpenGL.QGLShaderProgram class allows OpenGL shader programs to be linked and used.

介绍

This class supports shader programs written in the OpenGL Shading Language (GLSL) and in the OpenGL/ES Shading Language (GLSL/ES).

PySide.QtOpenGL.QGLShader and PySide.QtOpenGL.QGLShaderProgram shelter the programmer from the details of compiling and linking vertex and fragment shaders.

The following example creates a vertex shader program using the supplied source code . Once compiled and linked, the shader program is activated in the current PySide.QtOpenGL.QGLContext 通过调用 QGLShaderProgram.bind() :

shader = QGLShader(QGLShader.Vertex)
shader.compileSourceCode(code)
program = QGLShaderProgram(context)
program.addShader(shader)
program.link()
program.bind()
											

Writing portable shaders

Shader programs can be difficult to reuse across OpenGL implementations because of varying levels of support for standard vertex attributes and uniform variables. In particular, GLSL/ES lacks all of the standard variables that are present on desktop OpenGL systems: gl_Vertex , gl_Normal , gl_Color , and so on. Desktop OpenGL lacks the variable qualifiers highp , mediump ,和 lowp .

PySide.QtOpenGL.QGLShaderProgram class makes the process of writing portable shaders easier by prefixing all shader programs with the following lines on desktop OpenGL:

#define highp
#define mediump
#define lowp
											

This makes it possible to run most GLSL/ES shader programs on desktop systems. The programmer should restrict themselves to just features that are present in GLSL/ES, and avoid standard variable names that only work on the desktop.

Simple shader example

program.addShaderFromSourceCode(QGLShader.Vertex,
    "attribute highp vec4 vertex\n" \
    "attribute mediump mat4 matrix\n" \
    "void main(void)\n" \
    "{\n" \
    "   gl_Position = matrix * vertex\n" \
    "}")
program.addShaderFromSourceCode(QGLShader.Fragment,
    "uniform mediump vec4 color\n" \
    "void main(void)\n" \
    "{\n" \
    "   gl_FragColor = color\n" \
    "}")
program.link()
program.bind()
vertexLocation = program.attributeLocation("vertex")
matrixLocation = program.attributeLocation("matrix")
colorLocation = program.uniformLocation("color")
											

With the above shader program active, we can draw a green triangle as follows:

triangleVertices = (
    60.0f,  10.0f,  0.0f,
    110.0f, 110.0f, 0.0f,
    10.0f,  110.0f, 0.0f)
color = QColor(0, 255, 0, 255)
pmvMatrix = QMatrix4x4()
pmvMatrix.ortho(self.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

Binary shaders may be specified using glShaderBinary() on the return value from QGLShader.shaderId() PySide.QtOpenGL.QGLShader instance containing the binary can then be added to the shader program with PySide.QtOpenGL.QGLShaderProgram.addShader() and linked in the usual fashion with PySide.QtOpenGL.QGLShaderProgram.link() .

Binary programs may be specified using glProgramBinaryOES() on the return value from PySide.QtOpenGL.QGLShaderProgram.programId() . Then the application should call PySide.QtOpenGL.QGLShaderProgram.link() , which will notice that the program has already been specified and linked, allowing other operations to be performed on the shader program.

class PySide.QtOpenGL. QGLShaderProgram ( [ parent=None ] )
class PySide.QtOpenGL. QGLShaderProgram ( context [ , parent=None ] )
参数:

Constructs a new shader program and attaches it to parent . The program will be invalid until PySide.QtOpenGL.QGLShaderProgram.addShader() 被调用。

The shader program will be associated with the current PySide.QtOpenGL.QGLContext .

Constructs a new shader program and attaches it to parent . The program will be invalid until PySide.QtOpenGL.QGLShaderProgram.addShader() 被调用。

The shader program will be associated with context .

PySide.QtOpenGL.QGLShaderProgram. addShader ( shader )
参数: shader PySide.QtOpenGL.QGLShader
返回类型: PySide.QtCore.bool

Adds a compiled shader to this shader program. Returns true if the shader could be added, or false otherwise.

Ownership of the shader object remains with the caller. It will not be deleted when this PySide.QtOpenGL.QGLShaderProgram instance is deleted. This allows the caller to add the same shader to multiple shader programs.

PySide.QtOpenGL.QGLShaderProgram. addShaderFromSourceCode ( type , source )
参数:
  • type PySide.QtOpenGL.QGLShader.ShaderType
  • source – unicode
返回类型:

PySide.QtCore.bool

PySide.QtOpenGL.QGLShaderProgram. addShaderFromSourceCode ( type , source )
参数:
  • type PySide.QtOpenGL.QGLShader.ShaderType
  • source – str
返回类型:

PySide.QtCore.bool

PySide.QtOpenGL.QGLShaderProgram. addShaderFromSourceCode ( type , source )
参数:
返回类型:

PySide.QtCore.bool

PySide.QtOpenGL.QGLShaderProgram. addShaderFromSourceFile ( type , fileName )
参数:
  • type PySide.QtOpenGL.QGLShader.ShaderType
  • fileName – unicode
返回类型:

PySide.QtCore.bool

PySide.QtOpenGL.QGLShaderProgram. attributeLocation ( name )
参数: name – str
返回类型: PySide.QtCore.int

Returns the location of the attribute name within this shader program's parameter list. Returns -1 if name is not a valid attribute for this shader program.

PySide.QtOpenGL.QGLShaderProgram. attributeLocation ( name )
参数: name – unicode
返回类型: PySide.QtCore.int

这是重载函数。

Returns the location of the attribute name within this shader program's parameter list. Returns -1 if name is not a valid attribute for this shader program.

PySide.QtOpenGL.QGLShaderProgram. attributeLocation ( name )
参数: name PySide.QtCore.QByteArray
返回类型: PySide.QtCore.int

这是重载函数。

Returns the location of the attribute name within this shader program's parameter list. Returns -1 if name is not a valid attribute for this shader program.

PySide.QtOpenGL.QGLShaderProgram. bind ( )
返回类型: PySide.QtCore.bool

Binds this shader program to the active PySide.QtOpenGL.QGLContext and makes it the current shader program. Any previously bound shader program is released. This is equivalent to calling glUseProgram() on PySide.QtOpenGL.QGLShaderProgram.programId() . Returns true if the program was successfully bound; false otherwise. If the shader program has not yet been linked, or it needs to be re-linked, this function will call PySide.QtOpenGL.QGLShaderProgram.link() .

PySide.QtOpenGL.QGLShaderProgram. bindAttributeLocation ( name , location )
参数:
  • name – str
  • location PySide.QtCore.int

Binds the attribute name 到指定 location . This function can be called before or after the program has been linked. Any attributes that have not been explicitly bound when the program is linked will be assigned locations automatically.

When this function is called after the program has been linked, the program will need to be relinked for the change to take effect.

PySide.QtOpenGL.QGLShaderProgram. bindAttributeLocation ( name , location )
参数:

这是重载函数。

Binds the attribute name 到指定 location . This function can be called before or after the program has been linked. Any attributes that have not been explicitly bound when the program is linked will be assigned locations automatically.

When this function is called after the program has been linked, the program will need to be relinked for the change to take effect.

PySide.QtOpenGL.QGLShaderProgram. bindAttributeLocation ( name , location )
参数:
  • name – unicode
  • location PySide.QtCore.int

这是重载函数。

Binds the attribute name 到指定 location . This function can be called before or after the program has been linked. Any attributes that have not been explicitly bound when the program is linked will be assigned locations automatically.

When this function is called after the program has been linked, the program will need to be relinked for the change to take effect.

PySide.QtOpenGL.QGLShaderProgram. disableAttributeArray ( name )
参数: name – str

这是重载函数。

Disables the vertex array called name in this shader program that was enabled by a previous call to PySide.QtOpenGL.QGLShaderProgram.enableAttributeArray() .

PySide.QtOpenGL.QGLShaderProgram. disableAttributeArray ( location )
参数: location PySide.QtCore.int

Disables the vertex array at location in this shader program that was enabled by a previous call to PySide.QtOpenGL.QGLShaderProgram.enableAttributeArray() .

PySide.QtOpenGL.QGLShaderProgram. enableAttributeArray ( name )
参数: name – str

这是重载函数。

Enables the vertex array called name in this shader program so that the value set by PySide.QtOpenGL.QGLShaderProgram.setAttributeArray() on name will be used by the shader program.

PySide.QtOpenGL.QGLShaderProgram. enableAttributeArray ( location )
参数: location PySide.QtCore.int

Enables the vertex array at location in this shader program so that the value set by PySide.QtOpenGL.QGLShaderProgram.setAttributeArray() on location will be used by the shader program.

PySide.QtOpenGL.QGLShaderProgram. geometryInputType ( )
返回类型: PySide.QtOpenGL.GLenum

Returns the geometry shader input type, if active.

This parameter takes effect the next time the program is linked.

PySide.QtOpenGL.QGLShaderProgram. geometryOutputType ( )
返回类型: PySide.QtOpenGL.GLenum

Returns the geometry shader output type, if active.

This parameter takes effect the next time the program is linked.

PySide.QtOpenGL.QGLShaderProgram. geometryOutputVertexCount ( )
返回类型: PySide.QtCore.int

Returns the maximum number of vertices the current geometry shader program will produce, if active.

This parameter takes effect the ntext time the program is linked.

static PySide.QtOpenGL.QGLShaderProgram. hasOpenGLShaderPrograms ( [ context=None ] )
参数: context PySide.QtOpenGL.QGLContext
返回类型: PySide.QtCore.bool

Returns true if shader programs written in the OpenGL Shading Language (GLSL) are supported on this system; false otherwise.

context is used to resolve the GLSL extensions. If context is null, then QGLContext.currentContext() 被使用。

PySide.QtOpenGL.QGLShaderProgram. init ( )
返回类型: PySide.QtCore.bool
PySide.QtOpenGL.QGLShaderProgram. isLinked ( )
返回类型: PySide.QtCore.bool

Returns true if this shader program has been linked; false otherwise.

返回类型: PySide.QtCore.bool

Links together the shaders that were added to this program with PySide.QtOpenGL.QGLShaderProgram.addShader() . Returns true if the link was successful or false otherwise. If the link failed, the error messages can be retrieved with PySide.QtOpenGL.QGLShaderProgram.log() .

Subclasses can override this function to initialize attributes and uniform variables for use in specific shader programs.

If the shader program was already linked, calling this function again will force it to be re-linked.

PySide.QtOpenGL.QGLShaderProgram. log ( )
返回类型: unicode

Returns the errors and warnings that occurred during the last PySide.QtOpenGL.QGLShaderProgram.link() or PySide.QtOpenGL.QGLShaderProgram.addShader() with explicitly specified source code.

PySide.QtOpenGL.QGLShaderProgram. maxGeometryOutputVertices ( )
返回类型: PySide.QtCore.int

Returns the hardware limit for how many vertices a geometry shader can output.

PySide.QtOpenGL.QGLShaderProgram. programId ( )
返回类型: PySide.QtOpenGL.GLuint

Returns the OpenGL identifier associated with this shader program.

PySide.QtOpenGL.QGLShaderProgram. release ( )

Releases the active shader program from the current PySide.QtOpenGL.QGLContext . This is equivalent to calling glUseProgram(0) .

PySide.QtOpenGL.QGLShaderProgram. removeAllShaders ( )

Removes all of the shaders that were added to this program previously. The PySide.QtOpenGL.QGLShader objects for the shaders will not be deleted if they were constructed externally. PySide.QtOpenGL.QGLShader objects that are constructed internally by PySide.QtOpenGL.QGLShaderProgram will be deleted.

PySide.QtOpenGL.QGLShaderProgram. removeShader ( shader )
参数: shader PySide.QtOpenGL.QGLShader

移除 shader from this shader program. The object is not deleted.

PySide.QtOpenGL.QGLShaderProgram. setAttributeArray2D ( location , values [ , stride=0 ] )
参数:

Sets an array of 2D vertex values on the attribute at location in this shader program. The stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in values .

The array will become active when PySide.QtOpenGL.QGLShaderProgram.enableAttributeArray() is called on the location . Otherwise the value specified with PySide.QtOpenGL.QGLShaderProgram.setAttributeValue() for location 会被使用。

PySide.QtOpenGL.QGLShaderProgram. setAttributeArray2D ( name , values [ , stride=0 ] )
参数:

这是重载函数。

Sets an array of 2D vertex values on the attribute called name in this shader program. The stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in values .

The array will become active when PySide.QtOpenGL.QGLShaderProgram.enableAttributeArray() is called on name . Otherwise the value specified with PySide.QtOpenGL.QGLShaderProgram.setAttributeValue() for name 会被使用。

PySide.QtOpenGL.QGLShaderProgram. setAttributeArray3D ( location , values [ , stride=0 ] )
参数:

Sets an array of 3D vertex values on the attribute at location in this shader program. The stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in values .

The array will become active when PySide.QtOpenGL.QGLShaderProgram.enableAttributeArray() is called on the location . Otherwise the value specified with PySide.QtOpenGL.QGLShaderProgram.setAttributeValue() for location 会被使用。

PySide.QtOpenGL.QGLShaderProgram. setAttributeArray3D ( name , values [ , stride=0 ] )
参数:

这是重载函数。

Sets an array of 3D vertex values on the attribute called name in this shader program. The stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in values .

The array will become active when PySide.QtOpenGL.QGLShaderProgram.enableAttributeArray() is called on name . Otherwise the value specified with PySide.QtOpenGL.QGLShaderProgram.setAttributeValue() for name 会被使用。

PySide.QtOpenGL.QGLShaderProgram. setAttributeArray4D ( location , values [ , stride=0 ] )
参数:

Sets an array of 4D vertex values on the attribute at location in this shader program. The stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in values .

The array will become active when PySide.QtOpenGL.QGLShaderProgram.enableAttributeArray() is called on the location . Otherwise the value specified with PySide.QtOpenGL.QGLShaderProgram.setAttributeValue() for location 会被使用。

PySide.QtOpenGL.QGLShaderProgram. setAttributeArray4D ( name , values [ , stride=0 ] )
参数:

这是重载函数。

Sets an array of 4D vertex values on the attribute called name in this shader program. The stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in values .

The array will become active when PySide.QtOpenGL.QGLShaderProgram.enableAttributeArray() is called on name . Otherwise the value specified with PySide.QtOpenGL.QGLShaderProgram.setAttributeValue() for name 会被使用。

PySide.QtOpenGL.QGLShaderProgram. setAttributeBuffer ( name , type , offset , tupleSize [ , stride=0 ] )
参数:
  • name – str
  • type PySide.QtOpenGL.GLenum
  • offset PySide.QtCore.int
  • tupleSize PySide.QtCore.int
  • stride PySide.QtCore.int

这是重载函数。

Sets an array of vertex values on the attribute called name in this shader program, starting at a specific offset in the currently bound vertex buffer. The stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in the value array.

type indicates the type of elements in the vertex value array, usually GL_FLOAT , GL_UNSIGNED_BYTE , etc. The tupleSize indicates the number of components per vertex: 1, 2, 3, or 4.

The array will become active when PySide.QtOpenGL.QGLShaderProgram.enableAttributeArray() is called on the name . Otherwise the value specified with PySide.QtOpenGL.QGLShaderProgram.setAttributeValue() for name 会被使用。

另请参阅

PySide.QtOpenGL.QGLShaderProgram.setAttributeArray()

PySide.QtOpenGL.QGLShaderProgram. setAttributeBuffer ( location , type , offset , tupleSize [ , stride=0 ] )
参数:
  • location PySide.QtCore.int
  • type PySide.QtOpenGL.GLenum
  • offset PySide.QtCore.int
  • tupleSize PySide.QtCore.int
  • stride PySide.QtCore.int

Sets an array of vertex values on the attribute at location in this shader program, starting at a specific offset in the currently bound vertex buffer. The stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in the value array.

type indicates the type of elements in the vertex value array, usually GL_FLOAT , GL_UNSIGNED_BYTE , etc. The tupleSize indicates the number of components per vertex: 1, 2, 3, or 4.

The array will become active when PySide.QtOpenGL.QGLShaderProgram.enableAttributeArray() is called on the location . Otherwise the value specified with PySide.QtOpenGL.QGLShaderProgram.setAttributeValue() for location 会被使用。

另请参阅

PySide.QtOpenGL.QGLShaderProgram.setAttributeArray()

PySide.QtOpenGL.QGLShaderProgram. setAttributeValue ( location , x , y , z , w )
参数:
  • location PySide.QtCore.int
  • x PySide.QtOpenGL.GLfloat
  • y PySide.QtOpenGL.GLfloat
  • z PySide.QtOpenGL.GLfloat
  • w PySide.QtOpenGL.GLfloat

Sets the attribute at location in the current context to the 4D vector ( x , y , z , w ).

PySide.QtOpenGL.QGLShaderProgram. setAttributeValue ( location , x , y , z )
参数:
  • location PySide.QtCore.int
  • x PySide.QtOpenGL.GLfloat
  • y PySide.QtOpenGL.GLfloat
  • z PySide.QtOpenGL.GLfloat

Sets the attribute at location in the current context to the 3D vector ( x , y , z ).

PySide.QtOpenGL.QGLShaderProgram. setAttributeValue ( location , x , y )
参数:
  • location PySide.QtCore.int
  • x PySide.QtOpenGL.GLfloat
  • y PySide.QtOpenGL.GLfloat

Sets the attribute at location in the current context to the 2D vector ( x , y ).

PySide.QtOpenGL.QGLShaderProgram. setAttributeValue ( location , value )
参数:

Sets the attribute at location in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setAttributeValue ( location , value )
参数:
  • location PySide.QtCore.int
  • value PySide.QtOpenGL.GLfloat

Sets the attribute at location in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setAttributeValue ( location , value )
参数:

Sets the attribute at location in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setAttributeValue ( location , value )
参数:

Sets the attribute at location in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setAttributeValue ( location , value )
参数:

Sets the attribute at location in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setAttributeValue ( name , value )
参数:

这是重载函数。

Sets the attribute called name in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setAttributeValue ( name , value )
参数:
  • name – str
  • value PySide.QtOpenGL.GLfloat

这是重载函数。

Sets the attribute called name in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setAttributeValue ( name , x , y )
参数:
  • name – str
  • x PySide.QtOpenGL.GLfloat
  • y PySide.QtOpenGL.GLfloat

这是重载函数。

Sets the attribute called name in the current context to the 2D vector ( x , y ).

PySide.QtOpenGL.QGLShaderProgram. setAttributeValue ( name , x , y , z )
参数:
  • name – str
  • x PySide.QtOpenGL.GLfloat
  • y PySide.QtOpenGL.GLfloat
  • z PySide.QtOpenGL.GLfloat

这是重载函数。

Sets the attribute called name in the current context to the 3D vector ( x , y , z ).

PySide.QtOpenGL.QGLShaderProgram. setAttributeValue ( name , x , y , z , w )
参数:
  • name – str
  • x PySide.QtOpenGL.GLfloat
  • y PySide.QtOpenGL.GLfloat
  • z PySide.QtOpenGL.GLfloat
  • w PySide.QtOpenGL.GLfloat

这是重载函数。

Sets the attribute called name in the current context to the 4D vector ( x , y , z , w ).

PySide.QtOpenGL.QGLShaderProgram. setAttributeValue ( name , value )
参数:

这是重载函数。

Sets the attribute called name in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setAttributeValue ( name , value )
参数:

这是重载函数。

Sets the attribute called name in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setAttributeValue ( name , value )
参数:

这是重载函数。

Sets the attribute called name in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setGeometryInputType ( inputType )
参数: inputType PySide.QtOpenGL.GLenum

Sets the input type from inputType .

This parameter takes effect the next time the program is linked.

PySide.QtOpenGL.QGLShaderProgram. setGeometryOutputType ( outputType )
参数: outputType PySide.QtOpenGL.GLenum

Sets the output type from the geometry shader, if active, to outputType .

This parameter takes effect the next time the program is linked.

PySide.QtOpenGL.QGLShaderProgram. setGeometryOutputVertexCount ( count )
参数: count PySide.QtCore.int

Sets the maximum number of vertices the current geometry shader program will produce, if active, to count .

This parameter takes effect the next time the program is linked.

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , value )
参数:
  • location PySide.QtCore.int
  • value PySide.QtOpenGL.GLuint

Sets the uniform variable at location in the current context to value . This function should be used when setting sampler values.

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , color )
参数:

Sets the uniform variable at location in the current context to the red, green, blue, and alpha components of color .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , value )
参数:

Sets the uniform variable at location in the current context to a 2x3 matrix value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , value )
参数:
  • location PySide.QtCore.int
  • value PySide.QtOpenGL.GLint

Sets the uniform variable at location in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , value )
参数:

Sets the uniform variable at location in the current context to a 2x2 matrix value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , x , y , z )
参数:
  • location PySide.QtCore.int
  • x PySide.QtOpenGL.GLfloat
  • y PySide.QtOpenGL.GLfloat
  • z PySide.QtOpenGL.GLfloat

Sets the uniform variable at location in the current context to the 3D vector ( x , y , z ).

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , x , y , z , w )
参数:
  • location PySide.QtCore.int
  • x PySide.QtOpenGL.GLfloat
  • y PySide.QtOpenGL.GLfloat
  • z PySide.QtOpenGL.GLfloat
  • w PySide.QtOpenGL.GLfloat

Sets the uniform variable at location in the current context to the 4D vector ( x , y , z , w ).

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , x , y )
参数:
  • location PySide.QtCore.int
  • x PySide.QtOpenGL.GLfloat
  • y PySide.QtOpenGL.GLfloat

Sets the uniform variable at location in the current context to the 2D vector ( x , y ).

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , value )
参数:

Sets the uniform variable at location in the current context to a 2x4 matrix value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , value )
参数:
  • location PySide.QtCore.int
  • value PySide.QtOpenGL.GLfloat

Sets the uniform variable at location in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , value )
参数:

Sets the uniform variable at location in the current context to a 3x3 matrix value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , size )
参数:

Sets the uniform variable at location in the current context to the width and height of the given size .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , value )
参数:

Sets the uniform variable at location in the current context to a 3x2 matrix value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , value )
参数:

Sets the uniform variable at location in the current context to a 3x3 transformation matrix value that is specified as a PySide.QtGui.QTransform 值。

To set a PySide.QtGui.QTransform value as a 4x4 matrix in a shader, use setUniformValue(location, QMatrix4x4(value)) .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , value )
参数:

Sets the uniform variable at location in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , value )
参数:

Sets the uniform variable at location in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , value )
参数:

Sets the uniform variable at location in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , size )
参数:

Sets the uniform variable at location in the current context to the width and height of the given size .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , point )
参数:

Sets the uniform variable at location in the current context to the x and y coordinates of point .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , value )
参数:

Sets the uniform variable at location in the current context to a 3x4 matrix value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , value )
参数:

Sets the uniform variable at location in the current context to a 4x4 matrix value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , point )
参数:

Sets the uniform variable at location in the current context to the x and y coordinates of point .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , value )
参数:

Sets the uniform variable at location in the current context to a 4x2 matrix value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( location , value )
参数:

Sets the uniform variable at location in the current context to a 4x3 matrix value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , value )
参数:
  • name – str
  • value PySide.QtOpenGL.GLint

这是重载函数。

Sets the uniform variable called name in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , value )
参数:

这是重载函数。

Sets the uniform variable called name in the current context to a 2x4 matrix value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , value )
参数:
  • name – str
  • value PySide.QtOpenGL.GLuint

这是重载函数。

Sets the uniform variable called name in the current context to value . This function should be used when setting sampler values.

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , value )
参数:

这是重载函数。

Sets the uniform variable called name in the current context to a 2x2 matrix value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , value )
参数:

这是重载函数。

Sets the uniform variable called name in the current context to a 2x3 matrix value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , color )
参数:

这是重载函数。

Sets the uniform variable called name in the current context to the red, green, blue, and alpha components of color .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , x , y , z , w )
参数:
  • name – str
  • x PySide.QtOpenGL.GLfloat
  • y PySide.QtOpenGL.GLfloat
  • z PySide.QtOpenGL.GLfloat
  • w PySide.QtOpenGL.GLfloat

这是重载函数。

Sets the uniform variable called name in the current context to the 4D vector ( x , y , z , w ).

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , x , y , z )
参数:
  • name – str
  • x PySide.QtOpenGL.GLfloat
  • y PySide.QtOpenGL.GLfloat
  • z PySide.QtOpenGL.GLfloat

这是重载函数。

Sets the uniform variable called name in the current context to the 3D vector ( x , y , z ).

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , value )
参数:
  • name – str
  • value PySide.QtOpenGL.GLfloat

这是重载函数。

Sets the uniform variable called name in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , x , y )
参数:
  • name – str
  • x PySide.QtOpenGL.GLfloat
  • y PySide.QtOpenGL.GLfloat

这是重载函数。

Sets the uniform variable called name in the current context to the 2D vector ( x , y ).

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , value )
参数:

这是重载函数。

Sets the uniform variable called name in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , size )
参数:

这是重载函数。

Sets the uniform variable associated with name in the current context to the width and height of the given size .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , point )
参数:

这是重载函数。

Sets the uniform variable associated with name in the current context to the x and y coordinates of point .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , size )
参数:

这是重载函数。

Sets the uniform variable associated with name in the current context to the width and height of the given size .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , value )
参数:

这是重载函数。

Sets the uniform variable called name in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , value )
参数:

这是重载函数。

Sets the uniform variable called name in the current context to value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , value )
参数:

这是重载函数。

Sets the uniform variable called name in the current context to a 3x3 transformation matrix value that is specified as a PySide.QtGui.QTransform 值。

To set a PySide.QtGui.QTransform value as a 4x4 matrix in a shader, use setUniformValue(name, QMatrix4x4(value)) .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , value )
参数:

这是重载函数。

Sets the uniform variable called name in the current context to a 3x2 matrix value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , value )
参数:

这是重载函数。

Sets the uniform variable called name in the current context to a 3x3 matrix value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , value )
参数:

这是重载函数。

Sets the uniform variable called name in the current context to a 3x4 matrix value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , value )
参数:

这是重载函数。

Sets the uniform variable called name in the current context to a 4x2 matrix value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , point )
参数:

这是重载函数。

Sets the uniform variable associated with name in the current context to the x and y coordinates of point .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , value )
参数:

这是重载函数。

Sets the uniform variable called name in the current context to a 4x3 matrix value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValue ( name , value )
参数:

这是重载函数。

Sets the uniform variable called name in the current context to a 4x4 matrix value .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray2D ( location , values )
参数:

Sets the uniform variable array at location in the current context to the count 2D vector elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray2D ( name , values )
参数:

这是重载函数。

Sets the uniform variable array called name in the current context to the count 2D vector elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray2x2 ( location , values )
参数:

Sets the uniform variable array at location in the current context to the count 2x2 matrix elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray2x2 ( name , values )
参数:

这是重载函数。

Sets the uniform variable array called name in the current context to the count 2x2 matrix elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray2x3 ( name , values )
参数:

这是重载函数。

Sets the uniform variable array called name in the current context to the count 2x3 matrix elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray2x3 ( location , values )
参数:

Sets the uniform variable array at location in the current context to the count 2x3 matrix elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray2x4 ( location , values )
参数:

Sets the uniform variable array at location in the current context to the count 2x4 matrix elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray2x4 ( name , values )
参数:

这是重载函数。

Sets the uniform variable array called name in the current context to the count 2x4 matrix elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray3D ( name , values )
参数:

这是重载函数。

Sets the uniform variable array called name in the current context to the count 3D vector elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray3D ( location , values )
参数:

Sets the uniform variable array at location in the current context to the count 3D vector elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray3x2 ( name , values )
参数:

这是重载函数。

Sets the uniform variable array called name in the current context to the count 3x2 matrix elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray3x2 ( location , values )
参数:

Sets the uniform variable array at location in the current context to the count 3x2 matrix elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray3x3 ( name , values )
参数:

这是重载函数。

Sets the uniform variable array called name in the current context to the count 3x3 matrix elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray3x3 ( location , values )
参数:

Sets the uniform variable array at location in the current context to the count 3x3 matrix elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray3x4 ( location , values )
参数:

Sets the uniform variable array at location in the current context to the count 3x4 matrix elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray3x4 ( name , values )
参数:

这是重载函数。

Sets the uniform variable array called name in the current context to the count 3x4 matrix elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray4D ( name , values )
参数:

这是重载函数。

Sets the uniform variable array called name in the current context to the count 4D vector elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray4D ( location , values )
参数:

Sets the uniform variable array at location in the current context to the count 4D vector elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray4x2 ( location , values )
参数:

Sets the uniform variable array at location in the current context to the count 4x2 matrix elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray4x2 ( name , values )
参数:

这是重载函数。

Sets the uniform variable array called name in the current context to the count 4x2 matrix elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray4x3 ( name , values )
参数:

这是重载函数。

Sets the uniform variable array called name in the current context to the count 4x3 matrix elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray4x3 ( location , values )
参数:

Sets the uniform variable array at location in the current context to the count 4x3 matrix elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray4x4 ( name , values )
参数:

这是重载函数。

Sets the uniform variable array called name in the current context to the count 4x4 matrix elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArray4x4 ( location , values )
参数:

Sets the uniform variable array at location in the current context to the count 4x4 matrix elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArrayInt ( name , values )
参数:
  • name – str
  • values PySide.QtOpenGL.GLint

这是重载函数。

Sets the uniform variable array called name in the current context to the count elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArrayInt ( location , values )
参数:
  • location PySide.QtCore.int
  • values PySide.QtOpenGL.GLint

Sets the uniform variable array at location in the current context to the count elements of values .

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArrayUint ( name , values )
参数:
  • name – str
  • values PySide.QtOpenGL.GLuint

这是重载函数。

Sets the uniform variable array called name in the current context to the count elements of values . This overload should be used when setting an array of sampler values.

PySide.QtOpenGL.QGLShaderProgram. setUniformValueArrayUint ( location , values )
参数:
  • location PySide.QtCore.int
  • values PySide.QtOpenGL.GLuint

Sets the uniform variable array at location in the current context to the count elements of values . This overload should be used when setting an array of sampler values.

PySide.QtOpenGL.QGLShaderProgram. shaderDestroyed ( )
PySide.QtOpenGL.QGLShaderProgram. shaders ( )
返回类型:

Returns a list of all shaders that have been added to this shader program using PySide.QtOpenGL.QGLShaderProgram.addShader() .

PySide.QtOpenGL.QGLShaderProgram. uniformLocation ( name )
参数: name PySide.QtCore.QByteArray
返回类型: PySide.QtCore.int

这是重载函数。

Returns the location of the uniform variable name within this shader program's parameter list. Returns -1 if name is not a valid uniform variable for this shader program.

PySide.QtOpenGL.QGLShaderProgram. uniformLocation ( name )
参数: name – unicode
返回类型: PySide.QtCore.int

这是重载函数。

Returns the location of the uniform variable name within this shader program's parameter list. Returns -1 if name is not a valid uniform variable for this shader program.

PySide.QtOpenGL.QGLShaderProgram. uniformLocation ( name )
参数: name – str
返回类型: PySide.QtCore.int

Returns the location of the uniform variable name within this shader program's parameter list. Returns -1 if name is not a valid uniform variable for this shader program.