IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QShaderProgramBuilder Class

Generates a Shader Program content from loaded graphs.

This class was introduced in Qt 5.10.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QShaderProgramBuilder Class

  • Header: QShaderProgramBuilder

  • Since: Qt 5.10

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS 3drender)

    target_link_libraries(mytarget PRIVATE Qt6::3drender)

  • qmake: QT += 3drender

  • Inherited By:

  • Instantiated By: qml-qt3d-render-shaderprogrambuilder.xml

  • Inherits: Qt3DCore::QNode

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.

Property Documentation

 

[read-only, since 5.13] computeShaderCode : const QByteArray

Holds the generate compute shader code.

This property was introduced in Qt 5.13.

Access functions:

  • computeShaderCode() const

Notifier signal:

  • void computeShaderCodeChanged(const &computeShaderCode)

computeShaderGraph : QUrl

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

Access functions:

  • computeShaderGraph() const

  • void setComputeShaderGraph(const &computeShaderGraph)

Notifier signal:

  • void computeShaderGraphChanged(const &computeShaderGraph)

enabledLayers : QStringList

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

Access functions:

  • enabledLayers() const

  • void setEnabledLayers(const &layers)

Notifier signal:

  • void enabledLayersChanged(const &layers)

[read-only, since 5.13] fragmentShaderCode : const QByteArray

Holds the generate fragment shader code.

This property was introduced in Qt 5.13.

Access functions:

  • fragmentShaderCode() const

Notifier signal:

  • void fragmentShaderCodeChanged(const &fragmentShaderCode)

fragmentShaderGraph : QUrl

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

Access functions:

  • fragmentShaderGraph() const

  • void setFragmentShaderGraph(const &fragmentShaderGraph)

Notifier signal:

  • void fragmentShaderGraphChanged(const &fragmentShaderGraph)

[read-only, since 5.13] geometryShaderCode : const QByteArray

Holds the generate geometry shader code.

This property was introduced in Qt 5.13.

Access functions:

  • geometryShaderCode() const

Notifier signal:

  • void geometryShaderCodeChanged(const &geometryShaderCode)

geometryShaderGraph : QUrl

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

Access functions:

  • geometryShaderGraph() const

  • void setGeometryShaderGraph(const &geometryShaderGraph)

Notifier signal:

  • void geometryShaderGraphChanged(const &geometryShaderGraph)

shaderProgram : Qt3DRender::QShaderProgram*

Holds the shader program on which this builder generates code.

Access functions:

  • *shaderProgram() const

  • void setShaderProgram( *program)

Notifier signal:

  • void shaderProgramChanged( *shaderProgram)

[read-only, since 5.13] tessellationControlShaderCode : const QByteArray

Holds the generate tessellation control shader code.

This property was introduced in Qt 5.13.

Access functions:

  • tessellationControlShaderCode() const

Notifier signal:

  • void tessellationControlShaderCodeChanged(const &tessellationControlShaderCode)

tessellationControlShaderGraph : QUrl

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

Access functions:

  • tessellationControlShaderGraph() const

  • void setTessellationControlShaderGraph(const &tessellationControlShaderGraph)

Notifier signal:

  • void tessellationControlShaderGraphChanged(const &tessellationControlShaderGraph)

[read-only, since 5.13] tessellationEvaluationShaderCode : const QByteArray

Holds the generate tessellation evaluation shader code.

This property was introduced in Qt 5.13.

Access functions:

  • tessellationEvaluationShaderCode() const

Notifier signal:

  • void tessellationEvaluationShaderCodeChanged(const &tessellationEvaluationShaderCode)

tessellationEvaluationShaderGraph : QUrl

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

Access functions:

  • tessellationEvaluationShaderGraph() const

  • void setTessellationEvaluationShaderGraph(const &tessellationEvaluationShaderGraph)

Notifier signal:

  • void tessellationEvaluationShaderGraphChanged(const &tessellationEvaluationShaderGraph)

[read-only, since 5.13] vertexShaderCode : const QByteArray

Holds the generate vertex shader code.

This property was introduced in Qt 5.13.

Access functions:

  • vertexShaderCode() const

Notifier signal:

  • void vertexShaderCodeChanged(const &vertexShaderCode)

vertexShaderGraph : QUrl

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

Access functions:

  • vertexShaderGraph() const

  • void setVertexShaderGraph(const &vertexShaderGraph)

Notifier signal:

  • void vertexShaderGraphChanged(const &vertexShaderGraph)

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+