Encapsulates a Shader Program. 更多...
头: | #include <QShaderProgram> |
qmake: | QT += 3drender |
Since: | Qt 5.5 |
实例化: | ShaderProgram |
继承: | Qt3DCore::QNode |
enum | ShaderType { Vertex, Fragment, TessellationControl, TessellationEvaluation, Geometry, Compute } |
enum | Status { NotReady, Ready, Error } |
|
|
QShaderProgram (Qt3DCore::QNode * parent = nullptr) | |
~QShaderProgram () | |
QByteArray | computeShaderCode () const |
QByteArray | fragmentShaderCode () const |
QByteArray | geometryShaderCode () const |
QString | log () const |
void | setShaderCode (ShaderType type , const QByteArray & shaderCode ) |
QByteArray | shaderCode (ShaderType type ) const |
状态 | status () const |
QByteArray | tessellationControlShaderCode () const |
QByteArray | tessellationEvaluationShaderCode () const |
QByteArray | vertexShaderCode () const |
void | setComputeShaderCode (const QByteArray & computeShaderCode ) |
void | setFragmentShaderCode (const QByteArray & fragmentShaderCode ) |
void | setGeometryShaderCode (const QByteArray & geometryShaderCode ) |
void | setTessellationControlShaderCode (const QByteArray & tessellationControlShaderCode ) |
void | setTessellationEvaluationShaderCode (const QByteArray & tessellationEvaluationShaderCode ) |
void | setVertexShaderCode (const QByteArray & vertexShaderCode ) |
void | computeShaderCodeChanged (const QByteArray & computeShaderCode ) |
void | fragmentShaderCodeChanged (const QByteArray & fragmentShaderCode ) |
void | geometryShaderCodeChanged (const QByteArray & geometryShaderCode ) |
void | logChanged (const QString & log ) |
void | statusChanged (Status status ) |
void | tessellationControlShaderCodeChanged (const QByteArray & tessellationControlShaderCode ) |
void | tessellationEvaluationShaderCodeChanged (const QByteArray & tessellationEvaluationShaderCode ) |
void | vertexShaderCodeChanged (const QByteArray & vertexShaderCode ) |
QByteArray | loadSource (const QUrl & sourceUrl ) |
QShaderProgram (QShaderProgramPrivate & dd , Qt3DCore::QNode * parent = nullptr) | |
void | sceneChangeEvent (const Qt3DCore::QSceneChangePtr & change ) |
Encapsulates a Shader Program.
A shader program consists of several different shaders, such as vertex and fragment shaders.
This enum identifies the type of shader used.
常量 | 值 | 描述 |
---|---|---|
Qt3DRender::QShaderProgram::Vertex
|
0
|
Vertex shader |
Qt3DRender::QShaderProgram::Fragment
|
1
|
Fragment shader |
Qt3DRender::QShaderProgram::TessellationControl
|
2
|
Tesselation control shader |
Qt3DRender::QShaderProgram::TessellationEvaluation
|
3
|
Tesselation evaluation shader |
Qt3DRender::QShaderProgram::Geometry
|
4
|
Geometry shader |
Qt3DRender::QShaderProgram::Compute
|
5
|
Compute shader |
This enum identifies the status of shader used.
常量 | 值 | 描述 |
---|---|---|
Qt3DRender::QShaderProgram::NotReady
|
0
|
The shader hasn't been compiled and linked yet |
Qt3DRender::QShaderProgram::Ready
|
1
|
The shader was successfully compiled |
Qt3DRender::QShaderProgram::Error
|
2
|
An error occurred while compiling the shader |
Holds the compute shader code used by this shader program.
访问函数:
QByteArray | computeShaderCode () const |
void | setComputeShaderCode (const QByteArray & computeShaderCode ) |
通知程序信号:
void | computeShaderCodeChanged (const QByteArray & computeShaderCode ) |
Holds the fragment shader code used by this shader program.
访问函数:
QByteArray | fragmentShaderCode () const |
void | setFragmentShaderCode (const QByteArray & fragmentShaderCode ) |
通知程序信号:
void | fragmentShaderCodeChanged (const QByteArray & fragmentShaderCode ) |
Holds the geometry shader code used by this shader program.
访问函数:
QByteArray | geometryShaderCode () const |
void | setGeometryShaderCode (const QByteArray & geometryShaderCode ) |
通知程序信号:
void | geometryShaderCodeChanged (const QByteArray & geometryShaderCode ) |
Holds the log of the current shader program. This is useful to diagnose a compilation failure of the shader program.
访问函数:
QString | log () const |
通知程序信号:
void | logChanged (const QString & log ) |
Holds the status of the current shader program.
访问函数:
状态 | status () const |
通知程序信号:
void | statusChanged (Status status ) |
Holds the tesselation control shader code used by this shader program.
访问函数:
QByteArray | tessellationControlShaderCode () const |
void | setTessellationControlShaderCode (const QByteArray & tessellationControlShaderCode ) |
通知程序信号:
void | tessellationControlShaderCodeChanged (const QByteArray & tessellationControlShaderCode ) |
Holds the tesselation evaluation shader code used by this shader program.
访问函数:
QByteArray | tessellationEvaluationShaderCode () const |
void | setTessellationEvaluationShaderCode (const QByteArray & tessellationEvaluationShaderCode ) |
通知程序信号:
void | tessellationEvaluationShaderCodeChanged (const QByteArray & tessellationEvaluationShaderCode ) |
Holds the vertex shader code used by this shader program.
访问函数:
QByteArray | vertexShaderCode () const |
void | setVertexShaderCode (const QByteArray & vertexShaderCode ) |
通知程序信号:
void | vertexShaderCodeChanged (const QByteArray & vertexShaderCode ) |
Default constructs an instance of QShaderProgram.
[protected]
QShaderProgram::
QShaderProgram
(
QShaderProgramPrivate
&
dd
,
Qt3DCore::QNode
*
parent
= nullptr)
Copy constructor.
Destroys the instance of QShaderProgram.
[static]
QByteArray
QShaderProgram::
loadSource
(const
QUrl
&
sourceUrl
)
Returns the shader code loaded from sourceUrl .
[protected]
void
QShaderProgram::
sceneChangeEvent
(const
Qt3DCore::QSceneChangePtr
&
change
)
Posts a scene change with parameter change .
Sets the shader code for type of shader to the shaderCode .
另请参阅 shaderCode ().
Returns the shader code for type .
另请参阅 setShaderCode ().
Returns the status of the current shader program.
注意: Getter 函数对于特性 status .