QShaderProgramBuilder

Generates a Shader Program content from loaded graphs. More

Inheritance diagram of PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder

New in version 5.10.

Synopsis

Functions

Slots

Signals

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 writableLocation ( 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.

class PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder([parent=None])
Parameters

parentPySide6.Qt3DCore.Qt3DCore.QNode

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.computeShaderCode()
Return type

PySide6.QtCore.QByteArray

Holds the generate compute shader code.

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.computeShaderCodeChanged(computeShaderCode)
Parameters

computeShaderCodePySide6.QtCore.QByteArray

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.computeShaderGraph()
Return type

PySide6.QtCore.QUrl

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

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.computeShaderGraphChanged(computeShaderGraph)
Parameters

computeShaderGraphPySide6.QtCore.QUrl

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.enabledLayers()
Return type

list of strings

Holds the list of layers this builder will activate on the shader graphs during code generation.

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.enabledLayersChanged(layers)
Parameters

layers – list of strings

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.fragmentShaderCode()
Return type

PySide6.QtCore.QByteArray

Holds the generate fragment shader code.

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.fragmentShaderCodeChanged(fragmentShaderCode)
Parameters

fragmentShaderCodePySide6.QtCore.QByteArray

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.fragmentShaderGraph()
Return type

PySide6.QtCore.QUrl

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

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.fragmentShaderGraphChanged(fragmentShaderGraph)
Parameters

fragmentShaderGraphPySide6.QtCore.QUrl

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.geometryShaderCode()
Return type

PySide6.QtCore.QByteArray

Holds the generate geometry shader code.

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.geometryShaderCodeChanged(geometryShaderCode)
Parameters

geometryShaderCodePySide6.QtCore.QByteArray

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.geometryShaderGraph()
Return type

PySide6.QtCore.QUrl

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

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.geometryShaderGraphChanged(geometryShaderGraph)
Parameters

geometryShaderGraphPySide6.QtCore.QUrl

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.setComputeShaderGraph(computeShaderGraph)
Parameters

computeShaderGraphPySide6.QtCore.QUrl

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

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.setEnabledLayers(layers)
Parameters

layers – list of strings

Holds the list of layers this builder will activate on the shader graphs during code generation.

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.setFragmentShaderGraph(fragmentShaderGraph)
Parameters

fragmentShaderGraphPySide6.QtCore.QUrl

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

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.setGeometryShaderGraph(geometryShaderGraph)
Parameters

geometryShaderGraphPySide6.QtCore.QUrl

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

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.setShaderProgram(program)
Parameters

programPySide6.Qt3DRender.Qt3DRender.QShaderProgram

Holds the shader program on which this builder generates code.

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.setTessellationControlShaderGraph(tessellationControlShaderGraph)
Parameters

tessellationControlShaderGraphPySide6.QtCore.QUrl

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

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.setTessellationEvaluationShaderGraph(tessellationEvaluationShaderGraph)
Parameters

tessellationEvaluationShaderGraphPySide6.QtCore.QUrl

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

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.setVertexShaderGraph(vertexShaderGraph)
Parameters

vertexShaderGraphPySide6.QtCore.QUrl

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

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.shaderProgram()
Return type

PySide6.Qt3DRender.Qt3DRender.QShaderProgram

Holds the shader program on which this builder generates code.

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.shaderProgramChanged(shaderProgram)
Parameters

shaderProgramPySide6.Qt3DRender.Qt3DRender.QShaderProgram

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.tessellationControlShaderCode()
Return type

PySide6.QtCore.QByteArray

Holds the generate tessellation control shader code.

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.tessellationControlShaderCodeChanged(tessellationControlShaderCode)
Parameters

tessellationControlShaderCodePySide6.QtCore.QByteArray

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.tessellationControlShaderGraph()
Return type

PySide6.QtCore.QUrl

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

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.tessellationControlShaderGraphChanged(tessellationControlShaderGraph)
Parameters

tessellationControlShaderGraphPySide6.QtCore.QUrl

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.tessellationEvaluationShaderCode()
Return type

PySide6.QtCore.QByteArray

Holds the generate tessellation evaluation shader code.

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.tessellationEvaluationShaderCodeChanged(tessellationEvaluationShaderCode)
Parameters

tessellationEvaluationShaderCodePySide6.QtCore.QByteArray

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.tessellationEvaluationShaderGraph()
Return type

PySide6.QtCore.QUrl

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

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.tessellationEvaluationShaderGraphChanged(tessellationEvaluationShaderGraph)
Parameters

tessellationEvaluationShaderGraphPySide6.QtCore.QUrl

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.vertexShaderCode()
Return type

PySide6.QtCore.QByteArray

Holds the generate vertex shader code.

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.vertexShaderCodeChanged(vertexShaderCode)
Parameters

vertexShaderCodePySide6.QtCore.QByteArray

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.vertexShaderGraph()
Return type

PySide6.QtCore.QUrl

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

PySide6.Qt3DRender.Qt3DRender.QShaderProgramBuilder.vertexShaderGraphChanged(vertexShaderGraph)
Parameters

vertexShaderGraphPySide6.QtCore.QUrl