- class QShaderProgramBuilder#
Generates a Shader Program content from loaded graphs. More…
Synopsis#
Properties#
Methods#
def
__init__()
def
enabledLayers()
def
shaderProgram()
Slots#
Signals#
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description#
A shader program builder consists of several different shader graphs used to generate shader code.
A cache of generated shader code is maintained. Generated shaders are by defaults saved in QStandardPaths::writableLocation(QStandardPaths::TempLocation)). This path can be overridden by setting environment variable QT3D_WRITABLE_CACHE_PATH to a valid writable path.
The use of the cache can be disabled by setting environment variable QT3D_DISABLE_SHADER_CACHE.
In most cases, changes made to a graph are detected by Qt 3D and a new cache entry will be generated. One case were this will not happen is when code snippets included by a graphs are changed. To work around that, clearing the cache directory or setting environment variable QT3D_REBUILD_SHADER_CACHE can be used to force shader code to be generated again.
Note
Properties can be used directly when
from __feature__ import true_property
is used or via accessor functions otherwise.- property computeShaderCodeᅟ: QByteArray#
Holds the generate compute shader code.
- Access functions:
Holds the URL to the compute shader graph used by this shader program builder.
- Access functions:
- property enabledLayersᅟ: list of strings#
Holds the list of layers this builder will activate on the shader graphs during code generation.
- Access functions:
- property fragmentShaderCodeᅟ: QByteArray#
Holds the generate fragment shader code.
- Access functions:
Holds the URL to the fragment shader graph used by this shader program builder.
- Access functions:
- property geometryShaderCodeᅟ: QByteArray#
Holds the generate geometry shader code.
- Access functions:
Holds the URL to the geometry shader graph used by this shader program builder.
- Access functions:
- property shaderProgramᅟ: QShaderProgram#
Holds the shader program on which this builder generates code.
- Access functions:
- property tessellationControlShaderCodeᅟ: QByteArray#
Holds the generate tessellation control shader code.
- Access functions:
Holds the URL to the tesselation control shader graph used by this shader program builder.
- Access functions:
- property tessellationEvaluationShaderCodeᅟ: QByteArray#
Holds the generate tessellation evaluation shader code.
- Access functions:
Holds the URL to the tesselation evaluation shader graph used by this shader program builder.
- Access functions:
- property vertexShaderCodeᅟ: QByteArray#
Holds the generate vertex shader code.
- Access functions:
Holds the URL to the vertex shader graph used by this shader program builder.
- Access functions:
- __init__([parent=None])#
- Parameters:
parent –
QNode
- computeShaderCode()#
- Return type:
Getter of property
computeShaderCodeᅟ
.- computeShaderCodeChanged(computeShaderCode)#
- Parameters:
computeShaderCode –
QByteArray
Notification signal of property
computeShaderCodeᅟ
.Getter of property
computeShaderGraphᅟ
.Notification signal of property
computeShaderGraphᅟ
.- enabledLayers()#
- Return type:
list of strings
See also
setEnabledLayers()
Getter of property
enabledLayersᅟ
.- enabledLayersChanged(layers)#
- Parameters:
layers – list of strings
Notification signal of property
enabledLayersᅟ
.- fragmentShaderCode()#
- Return type:
Getter of property
fragmentShaderCodeᅟ
.- fragmentShaderCodeChanged(fragmentShaderCode)#
- Parameters:
fragmentShaderCode –
QByteArray
Notification signal of property
fragmentShaderCodeᅟ
.Getter of property
fragmentShaderGraphᅟ
.Notification signal of property
fragmentShaderGraphᅟ
.- geometryShaderCode()#
- Return type:
Getter of property
geometryShaderCodeᅟ
.- geometryShaderCodeChanged(geometryShaderCode)#
- Parameters:
geometryShaderCode –
QByteArray
Notification signal of property
geometryShaderCodeᅟ
.Getter of property
geometryShaderGraphᅟ
.Notification signal of property
geometryShaderGraphᅟ
.- setComputeShaderGraph(computeShaderGraph)#
- Parameters:
computeShaderGraph –
QUrl
See also
computeShaderGraph()
Setter of property
computeShaderGraphᅟ
.- setEnabledLayers(layers)#
- Parameters:
layers – list of strings
See also
enabledLayers()
Setter of property
enabledLayersᅟ
.- setFragmentShaderGraph(fragmentShaderGraph)#
- Parameters:
fragmentShaderGraph –
QUrl
See also
fragmentShaderGraph()
Setter of property
fragmentShaderGraphᅟ
.- setGeometryShaderGraph(geometryShaderGraph)#
- Parameters:
geometryShaderGraph –
QUrl
See also
geometryShaderGraph()
Setter of property
geometryShaderGraphᅟ
.- setShaderProgram(program)#
- Parameters:
program –
QShaderProgram
See also
shaderProgram()
Setter of property
shaderProgramᅟ
.- setTessellationControlShaderGraph(tessellationControlShaderGraph)#
- Parameters:
tessellationControlShaderGraph –
QUrl
See also
tessellationControlShaderGraph()
Setter of property
tessellationControlShaderGraphᅟ
.- setTessellationEvaluationShaderGraph(tessellationEvaluationShaderGraph)#
- Parameters:
tessellationEvaluationShaderGraph –
QUrl
See also
tessellationEvaluationShaderGraph()
Setter of property
tessellationEvaluationShaderGraphᅟ
.- setVertexShaderGraph(vertexShaderGraph)#
- Parameters:
vertexShaderGraph –
QUrl
See also
vertexShaderGraph()
Setter of property
vertexShaderGraphᅟ
.- shaderProgram()#
- Return type:
QShaderProgram
See also
setShaderProgram()
Getter of property
shaderProgramᅟ
.- shaderProgramChanged(shaderProgram)#
- Parameters:
shaderProgram –
QShaderProgram
Notification signal of property
shaderProgramᅟ
.- tessellationControlShaderCode()#
- Return type:
Getter of property
tessellationControlShaderCodeᅟ
.- tessellationControlShaderCodeChanged(tessellationControlShaderCode)#
- Parameters:
tessellationControlShaderCode –
QByteArray
Notification signal of property
tessellationControlShaderCodeᅟ
.Getter of property
tessellationControlShaderGraphᅟ
.- tessellationControlShaderGraphChanged(tessellationControlShaderGraph)#
- Parameters:
tessellationControlShaderGraph –
QUrl
Notification signal of property
tessellationControlShaderGraphᅟ
.- tessellationEvaluationShaderCode()#
- Return type:
Getter of property
tessellationEvaluationShaderCodeᅟ
.- tessellationEvaluationShaderCodeChanged(tessellationEvaluationShaderCode)#
- Parameters:
tessellationEvaluationShaderCode –
QByteArray
Notification signal of property
tessellationEvaluationShaderCodeᅟ
.- tessellationEvaluationShaderGraph()#
- Return type:
See also
setTessellationEvaluationShaderGraph()
Getter of property
tessellationEvaluationShaderGraphᅟ
.- tessellationEvaluationShaderGraphChanged(tessellationEvaluationShaderGraph)#
- Parameters:
tessellationEvaluationShaderGraph –
QUrl
Notification signal of property
tessellationEvaluationShaderGraphᅟ
.- vertexShaderCode()#
- Return type:
Getter of property
vertexShaderCodeᅟ
.- vertexShaderCodeChanged(vertexShaderCode)#
- Parameters:
vertexShaderCode –
QByteArray
Notification signal of property
vertexShaderCodeᅟ
.Getter of property
vertexShaderGraphᅟ
.Notification signal of property
vertexShaderGraphᅟ
.