Generates a Shader Program content from loaded graphs. More...
Header: | #include <QShaderProgramBuilder> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS 3drender) target_link_libraries(mytarget PRIVATE Qt6::3drender) |
qmake: | QT += 3drender |
Since: | Qt 5.10 |
Instantiated By: | ShaderProgramBuilder |
Inherits: | Qt3DCore::QNode |
|
|
QByteArray | computeShaderCode() const |
QUrl | computeShaderGraph() const |
QStringList | enabledLayers() const |
QByteArray | fragmentShaderCode() const |
QUrl | fragmentShaderGraph() const |
QByteArray | geometryShaderCode() const |
QUrl | geometryShaderGraph() const |
Qt3DRender::QShaderProgram * | shaderProgram() const |
QByteArray | tessellationControlShaderCode() const |
QUrl | tessellationControlShaderGraph() const |
QByteArray | tessellationEvaluationShaderCode() const |
QUrl | tessellationEvaluationShaderGraph() const |
QByteArray | vertexShaderCode() const |
QUrl | vertexShaderGraph() const |
void | setComputeShaderGraph(const QUrl &computeShaderGraph) |
void | setEnabledLayers(const QStringList &layers) |
void | setFragmentShaderGraph(const QUrl &fragmentShaderGraph) |
void | setGeometryShaderGraph(const QUrl &geometryShaderGraph) |
void | setShaderProgram(Qt3DRender::QShaderProgram *program) |
void | setTessellationControlShaderGraph(const QUrl &tessellationControlShaderGraph) |
void | setTessellationEvaluationShaderGraph(const QUrl &tessellationEvaluationShaderGraph) |
void | setVertexShaderGraph(const QUrl &vertexShaderGraph) |
void | computeShaderCodeChanged(const QByteArray &computeShaderCode) |
void | computeShaderGraphChanged(const QUrl &computeShaderGraph) |
void | enabledLayersChanged(const QStringList &layers) |
void | fragmentShaderCodeChanged(const QByteArray &fragmentShaderCode) |
void | fragmentShaderGraphChanged(const QUrl &fragmentShaderGraph) |
void | geometryShaderCodeChanged(const QByteArray &geometryShaderCode) |
void | geometryShaderGraphChanged(const QUrl &geometryShaderGraph) |
void | shaderProgramChanged(Qt3DRender::QShaderProgram *shaderProgram) |
void | tessellationControlShaderCodeChanged(const QByteArray &tessellationControlShaderCode) |
void | tessellationControlShaderGraphChanged(const QUrl &tessellationControlShaderGraph) |
void | tessellationEvaluationShaderCodeChanged(const QByteArray &tessellationEvaluationShaderCode) |
void | tessellationEvaluationShaderGraphChanged(const QUrl &tessellationEvaluationShaderGraph) |
void | vertexShaderCodeChanged(const QByteArray &vertexShaderCode) |
void | vertexShaderGraphChanged(const QUrl &vertexShaderGraph) |
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.
[read-only, since 5.13]
computeShaderCode : const QByteArrayHolds the generate compute shader code.
This property was introduced in Qt 5.13.
Access functions:
QByteArray | computeShaderCode() const |
Notifier signal:
void | computeShaderCodeChanged(const QByteArray &computeShaderCode) |
Holds the URL to the compute shader graph used by this shader program builder.
Access functions:
QUrl | computeShaderGraph() const |
void | setComputeShaderGraph(const QUrl &computeShaderGraph) |
Notifier signal:
void | computeShaderGraphChanged(const QUrl &computeShaderGraph) |
Holds the list of layers this builder will activate on the shader graphs during code generation.
Access functions:
QStringList | enabledLayers() const |
void | setEnabledLayers(const QStringList &layers) |
Notifier signal:
void | enabledLayersChanged(const QStringList &layers) |
[read-only, since 5.13]
fragmentShaderCode : const QByteArrayHolds the generate fragment shader code.
This property was introduced in Qt 5.13.
Access functions:
QByteArray | fragmentShaderCode() const |
Notifier signal:
void | fragmentShaderCodeChanged(const QByteArray &fragmentShaderCode) |
Holds the URL to the fragment shader graph used by this shader program builder.
Access functions:
QUrl | fragmentShaderGraph() const |
void | setFragmentShaderGraph(const QUrl &fragmentShaderGraph) |
Notifier signal:
void | fragmentShaderGraphChanged(const QUrl &fragmentShaderGraph) |
[read-only, since 5.13]
geometryShaderCode : const QByteArrayHolds the generate geometry shader code.
This property was introduced in Qt 5.13.
Access functions:
QByteArray | geometryShaderCode() const |
Notifier signal:
void | geometryShaderCodeChanged(const QByteArray &geometryShaderCode) |
Holds the URL to the geometry shader graph used by this shader program builder.
Access functions:
QUrl | geometryShaderGraph() const |
void | setGeometryShaderGraph(const QUrl &geometryShaderGraph) |
Notifier signal:
void | geometryShaderGraphChanged(const QUrl &geometryShaderGraph) |
Holds the shader program on which this builder generates code.
Access functions:
Qt3DRender::QShaderProgram * | shaderProgram() const |
void | setShaderProgram(Qt3DRender::QShaderProgram *program) |
Notifier signal:
void | shaderProgramChanged(Qt3DRender::QShaderProgram *shaderProgram) |
[read-only, since 5.13]
tessellationControlShaderCode : const QByteArrayHolds the generate tessellation control shader code.
This property was introduced in Qt 5.13.
Access functions:
QByteArray | tessellationControlShaderCode() const |
Notifier signal:
void | tessellationControlShaderCodeChanged(const QByteArray &tessellationControlShaderCode) |
Holds the URL to the tesselation control shader graph used by this shader program builder.
Access functions:
QUrl | tessellationControlShaderGraph() const |
void | setTessellationControlShaderGraph(const QUrl &tessellationControlShaderGraph) |
Notifier signal:
void | tessellationControlShaderGraphChanged(const QUrl &tessellationControlShaderGraph) |
[read-only, since 5.13]
tessellationEvaluationShaderCode : const QByteArrayHolds the generate tessellation evaluation shader code.
This property was introduced in Qt 5.13.
Access functions:
QByteArray | tessellationEvaluationShaderCode() const |
Notifier signal:
void | tessellationEvaluationShaderCodeChanged(const QByteArray &tessellationEvaluationShaderCode) |
Holds the URL to the tesselation evaluation shader graph used by this shader program builder.
Access functions:
QUrl | tessellationEvaluationShaderGraph() const |
void | setTessellationEvaluationShaderGraph(const QUrl &tessellationEvaluationShaderGraph) |
Notifier signal:
void | tessellationEvaluationShaderGraphChanged(const QUrl &tessellationEvaluationShaderGraph) |
[read-only, since 5.13]
vertexShaderCode : const QByteArrayHolds the generate vertex shader code.
This property was introduced in Qt 5.13.
Access functions:
QByteArray | vertexShaderCode() const |
Notifier signal:
void | vertexShaderCodeChanged(const QByteArray &vertexShaderCode) |
Holds the URL to the vertex shader graph used by this shader program builder.
Access functions:
QUrl | vertexShaderGraph() const |
void | setVertexShaderGraph(const QUrl &vertexShaderGraph) |
Notifier signal:
void | vertexShaderGraphChanged(const QUrl &vertexShaderGraph) |