class QShaderProgramBuilder

Generates a Shader Program content from loaded graphs. More

Inheritance diagram of PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder

Synopsis

Properties

Methods

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:
property computeShaderGraphᅟ: QUrl

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:
property fragmentShaderGraphᅟ: QUrl

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:
property geometryShaderGraphᅟ: QUrl

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:
property tessellationControlShaderGraphᅟ: QUrl

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:
property tessellationEvaluationShaderGraphᅟ: QUrl

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:
property vertexShaderGraphᅟ: QUrl

Holds the URL to the vertex shader graph used by this shader program builder.

Access functions:
__init__([parent=None])
Parameters:

parentQNode

computeShaderCode()
Return type:

QByteArray

Getter of property computeShaderCodeᅟ .

computeShaderCodeChanged(computeShaderCode)
Parameters:

computeShaderCodeQByteArray

Notification signal of property computeShaderCodeᅟ .

computeShaderGraph()
Return type:

QUrl

See also

setComputeShaderGraph()

Getter of property computeShaderGraphᅟ .

computeShaderGraphChanged(computeShaderGraph)
Parameters:

computeShaderGraphQUrl

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:

QByteArray

Getter of property fragmentShaderCodeᅟ .

fragmentShaderCodeChanged(fragmentShaderCode)
Parameters:

fragmentShaderCodeQByteArray

Notification signal of property fragmentShaderCodeᅟ .

fragmentShaderGraph()
Return type:

QUrl

See also

setFragmentShaderGraph()

Getter of property fragmentShaderGraphᅟ .

fragmentShaderGraphChanged(fragmentShaderGraph)
Parameters:

fragmentShaderGraphQUrl

Notification signal of property fragmentShaderGraphᅟ .

geometryShaderCode()
Return type:

QByteArray

Getter of property geometryShaderCodeᅟ .

geometryShaderCodeChanged(geometryShaderCode)
Parameters:

geometryShaderCodeQByteArray

Notification signal of property geometryShaderCodeᅟ .

geometryShaderGraph()
Return type:

QUrl

See also

setGeometryShaderGraph()

Getter of property geometryShaderGraphᅟ .

geometryShaderGraphChanged(geometryShaderGraph)
Parameters:

geometryShaderGraphQUrl

Notification signal of property geometryShaderGraphᅟ .

setComputeShaderGraph(computeShaderGraph)
Parameters:

computeShaderGraphQUrl

See also

computeShaderGraph()

Setter of property computeShaderGraphᅟ .

setEnabledLayers(layers)
Parameters:

layers – list of strings

See also

enabledLayers()

Setter of property enabledLayersᅟ .

setFragmentShaderGraph(fragmentShaderGraph)
Parameters:

fragmentShaderGraphQUrl

See also

fragmentShaderGraph()

Setter of property fragmentShaderGraphᅟ .

setGeometryShaderGraph(geometryShaderGraph)
Parameters:

geometryShaderGraphQUrl

See also

geometryShaderGraph()

Setter of property geometryShaderGraphᅟ .

setShaderProgram(program)
Parameters:

programQShaderProgram

See also

shaderProgram()

Setter of property shaderProgramᅟ .

setTessellationControlShaderGraph(tessellationControlShaderGraph)
Parameters:

tessellationControlShaderGraphQUrl

See also

tessellationControlShaderGraph()

Setter of property tessellationControlShaderGraphᅟ .

setTessellationEvaluationShaderGraph(tessellationEvaluationShaderGraph)
Parameters:

tessellationEvaluationShaderGraphQUrl

See also

tessellationEvaluationShaderGraph()

Setter of property tessellationEvaluationShaderGraphᅟ .

setVertexShaderGraph(vertexShaderGraph)
Parameters:

vertexShaderGraphQUrl

See also

vertexShaderGraph()

Setter of property vertexShaderGraphᅟ .

shaderProgram()
Return type:

QShaderProgram

See also

setShaderProgram()

Getter of property shaderProgramᅟ .

shaderProgramChanged(shaderProgram)
Parameters:

shaderProgramQShaderProgram

Notification signal of property shaderProgramᅟ .

tessellationControlShaderCode()
Return type:

QByteArray

Getter of property tessellationControlShaderCodeᅟ .

tessellationControlShaderCodeChanged(tessellationControlShaderCode)
Parameters:

tessellationControlShaderCodeQByteArray

Notification signal of property tessellationControlShaderCodeᅟ .

tessellationControlShaderGraph()
Return type:

QUrl

See also

setTessellationControlShaderGraph()

Getter of property tessellationControlShaderGraphᅟ .

tessellationControlShaderGraphChanged(tessellationControlShaderGraph)
Parameters:

tessellationControlShaderGraphQUrl

Notification signal of property tessellationControlShaderGraphᅟ .

tessellationEvaluationShaderCode()
Return type:

QByteArray

Getter of property tessellationEvaluationShaderCodeᅟ .

tessellationEvaluationShaderCodeChanged(tessellationEvaluationShaderCode)
Parameters:

tessellationEvaluationShaderCodeQByteArray

Notification signal of property tessellationEvaluationShaderCodeᅟ .

tessellationEvaluationShaderGraph()
Return type:

QUrl

See also

setTessellationEvaluationShaderGraph()

Getter of property tessellationEvaluationShaderGraphᅟ .

tessellationEvaluationShaderGraphChanged(tessellationEvaluationShaderGraph)
Parameters:

tessellationEvaluationShaderGraphQUrl

Notification signal of property tessellationEvaluationShaderGraphᅟ .

vertexShaderCode()
Return type:

QByteArray

Getter of property vertexShaderCodeᅟ .

vertexShaderCodeChanged(vertexShaderCode)
Parameters:

vertexShaderCodeQByteArray

Notification signal of property vertexShaderCodeᅟ .

vertexShaderGraph()
Return type:

QUrl

See also

setVertexShaderGraph()

Getter of property vertexShaderGraphᅟ .

vertexShaderGraphChanged(vertexShaderGraph)
Parameters:

vertexShaderGraphQUrl

Notification signal of property vertexShaderGraphᅟ .