ShaderProgram QML Type

Encapsulates a Shader Program. More...

Import Statement: import Qt3D.Render 2.12
Since: Qt 5.5
Instantiates: QShaderProgram

Properties

Methods

Detailed Description

ShaderProgram class encapsulates a shader program. A shader program consists of several different shaders, such as vertex and fragment shaders.

Qt3D will automatically populate a set of default uniforms if they are encountered during the shader instrospection phase.

Default UniformAssociated Qt3D Parameter nameGLSL declaration
ModelMatrixmodelMatrixuniform mat4 modelMatrix;
ViewMatrixviewMatrixuniform mat4 viewMatrix;
ProjectionMatrixprojectionMatrixuniform mat4 projectionMatrix;
ModelViewMatrixmodelViewuniform mat4 modelView;
ViewProjectionMatrixviewProjectionMatrixuniform mat4 viewProjectionMatrix;
ModelViewProjectionMatrixmodelViewProjection
mvp
uniform mat4 modelViewProjection;
uniform mat4 mvp;
InverseModelMatrixinverseModelMatrixuniform mat4 inverseModelMatrix;
InverseViewMatrixinverseViewMatrixuniform mat4 inverseViewMatrix;
InverseProjectionMatrixinverseProjectionMatrixuniform mat4 inverseProjectionMatrix;
InverseModelViewMatrixinverseModelViewuniform mat4 inverseModelView;
InverseViewProjectionMatrixinverseViewProjectionMatrixuniform mat4 inverseViewProjectionMatrix;
InverseModelViewProjectionMatrixinverseModelViewProjectionuniform mat4 inverseModelViewProjection;
ModelNormalMatrixmodelNormalMatrixuniform mat3 modelNormalMatrix;
ModelViewNormalMatrixmodelViewNormaluniform mat3 modelViewNormal;
ViewportMatrixviewportMatrixuniform mat4 viewportMatrix;
InverseViewportMatrixinverseViewportMatrixuniform mat4 inverseViewportMatrix;
AspectRatio
(surface width / surface height)
aspectRatiouniform float aspectRatio;
Exposureexposureuniform float exposure;
Gammagammauniform float gamma;
Time
(in nano seconds)
timeuniform float time;
EyePositioneyePositionuniform vec3 eyePosition;
SkinningPaletteskinningPalette[0]const int maxJoints = 100;
uniform mat4 skinningPalette[maxJoints];

Property Documentation

computeShaderCode : string

Holds the compute shader code used by this shader program.


computeShaderGraph : string

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


fragmentShaderCode : string

Holds the fragment shader code used by this shader program.


fragmentShaderGraph : string

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


geometryShaderCode : string

Holds the geometry shader code used by this shader program.


geometryShaderGraph : string

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


log : string

Holds the log of the current shader program. This is useful to diagnose a compilation failure of the shader program.


status : string

Holds the status of the current shader program.


tessellationControlShaderCode : string

Holds the tesselation control shader code used by this shader program.


tessellationControlShaderGraph : string

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


tessellationEvaluationShaderCode : string

Holds the tesselation evaluation shader code used by this shader program.


tessellationEvaluationShaderGraph : string

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


vertexShaderCode : string

Holds the vertex shader code used by this shader program.


vertexShaderGraph : string

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


Method Documentation

string loadSource(url sourceUrl)

Returns the shader code loaded from sourceUrl.


© 2019 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.