| effect.cpp |
|
1784 |
- |
| effect_p.h |
|
1264 |
- |
| filterkey.cpp |
|
1598 |
- |
| filterkey_p.h |
|
1425 |
- |
| material.cpp |
|
1784 |
- |
| material_p.h |
|
1294 |
- |
| materialsystem.qrc |
|
102 |
- |
| parameter.cpp |
|
2024 |
- |
| parameter_p.h |
|
1357 |
- |
| prototypes |
|
|
- |
| qeffect.cpp |
!
\class Qt3DRender::QEffect
\inmodule Qt3DRender
\inherits Qt3DCore::QNode
\since 5.7
\brief The base class for effects in a Qt 3D scene.
The QEffect class combines a set of techniques and parameters used by those techniques to
produce a rendering effect for a material.
An QEffect instance should be shared among several QMaterial instances when possible.
\note QEffect node can not be disabled.
\code
QEffect *effect = new QEffect();
// Create technique, render pass and shader
QTechnique *gl3Technique = new QTechnique();
QRenderPass *gl3Pass = new QRenderPass();
QShaderProgram *glShader = new QShaderProgram();
// Set the shader on the render pass
gl3Pass->setShaderProgram(glShader);
// Add the pass to the technique
gl3Technique->addRenderPass(gl3Pass);
// Set the targeted GL version for the technique
gl3Technique->graphicsApiFilter()->setApi(QGraphicsApiFilter::OpenGL);
gl3Technique->graphicsApiFilter()->setMajorVersion(3);
gl3Technique->graphicsApiFilter()->setMinorVersion(1);
gl3Technique->graphicsApiFilter()->setProfile(QGraphicsApiFilter::CoreProfile);
// Add the technique to the effect
effect->addTechnique(gl3Technique);
\endcode
A QParameter defined on a QEffect overrides parameter (of the same
name) defined in QTechnique and QRenderPass, but are overridden by parameter in
QRenderPassFilter, QTechniqueFilter and QMaterial.
\sa QMaterial, QTechnique, QParameter
|
6434 |
- |
| qeffect.h |
|
1028 |
- |
| qeffect_p.h |
|
1003 |
- |
| qfilterkey.cpp |
!
\class Qt3DRender::QFilterKey
\inmodule Qt3DRender
\inherits Qt3DCore::QNode
\since 5.5
\brief The QFilterKey class provides storage for filter keys and their values.
Filter keys are used by QTechnique and QRenderPass to specify at which stage of rendering the
technique or the render pass is used.
\note QFilterKey node can not be disabled.
|
2236 |
- |
| qfilterkey.h |
|
1099 |
- |
| qfilterkey_p.h |
|
936 |
- |
| qgraphicsapifilter.cpp |
!
\class Qt3DRender::QGraphicsApiFilter
\inmodule Qt3DRender
\since 5.5
\brief The QGraphicsApiFilter class identifies the API required for the attached QTechnique.
|
8907 |
- |
| qgraphicsapifilter.h |
|
2983 |
- |
| qgraphicsapifilter_p.h |
|
1706 |
- |
| qmaterial.cpp |
!
\qmltype Material
\nativetype Qt3DRender::QMaterial
\inqmlmodule Qt3D.Render
\brief Non-creatable abstract base for materials.
\since 5.5
Material provides a way to specify the rendering of an \l{Qt3D.Core::Entity}{entity}.
Any aspect can define its own subtype of Material so that a
Material can be used to describe a visual element; for example, the way
sound should reflect off an element, the temperature of a surface,
and so on.
In itself, a Material doesn't do anything. It's only when it references an
Effect node that a Material becomes useful.
In practice, it often happens that a single Effect is being referenced by
several Material components. This allows to only create the effect,
techniques, passes and shaders once while allowing to specify the material
by adding Parameter instances.
A Parameter defined on a Material overrides parameter (of the same
name) defined in a Effect, Technique and RenderPass, but are overridden by parameters in
RenderPassFilter and TechniqueFilter.
\code
Effect {
id: effect
techniques: [
Technique {
id: gl3Technique
graphicsApiFilter {
api: GraphicsApiFilter.OpenGL
profile: GraphicsApiFilter.CoreProfile
majorVersion: 3
minorVersion: 1
}
renderPasses: [
RenderPass {
id: gl3Pass
shaderProgram: ShaderProgram {
...
}
}
]
}
]
}
Material {
id: material1
parameters: [
Parameter { name: "color"; value: "green" }
]
}
Material {
id: material2
parameters: [
Parameter { name: "color"; value: "white" }
]
}
\endcode
\sa Effect, Technique, Parameter
|
7850 |
- |
| qmaterial.h |
|
1224 |
- |
| qmaterial_p.h |
|
974 |
- |
| qparameter.cpp |
!
\qmltype Parameter
\nativetype Qt3DRender::QParameter
\inqmlmodule Qt3D.Render
\brief Provides storage for a name and value pair. This maps to a shader uniform.
A Parameter can be referenced by a RenderPass, Technique, Effect, Material,
TechniqueFilter, RenderPassFilter. At runtime, depending on which shader is
selected for a given step of the rendering, the value contained in a
Parameter will be converted and uploaded if the shader contains a uniform
with a name matching that of the Parameter.
\code
Parameter {
name: "diffuseColor"
value: "blue"
}
// Works with the following GLSL uniform shader declarations
// uniform vec4 diffuseColor;
// uniform vec3 diffuseColor;
// uniform vec2 diffuseColor;
// uniform float diffuseColor;
\endcode
\note some care must be taken to ensure the value wrapped by a Parameter
can actually be converted to what the real uniform expect. Giving a value
stored as an int where the actual shader uniform is of type float could
result in undefined behaviors.
\note when the targeted uniform is an array, the name should be the name
of the uniform with [0] appended to it.
\note Parameter node can not be disabled.
\code
Parameter {
name: "diffuseValues[0]"
value: [0.0, 1.0. 2.0, 3.0, 4.0, 883.0, 1340.0, 1584.0]
}
// Matching GLSL shader uniform declaration
// uniform float diffuseValues[8];
\endcode
When it comes to texture support, the Parameter value should be set to the
appropriate \l {Qt3DRender::QAbstractTexture}{texture} subclass that matches the sampler type of the shader
uniform.
\code
Parameter {
name: "diffuseTexture"
value: Texture2D { ... }
}
// Works with the following GLSL uniform shader declaration
// uniform sampler2D diffuseTexture
\endcode
\sa Qt3DRender::QAbstractTexture
|
8289 |
- |
| qparameter.h |
|
1412 |
- |
| qparameter_p.h |
|
977 |
- |
| qrenderpass.cpp |
!
\qmltype RenderPass
\nativetype Qt3DRender::QRenderPass
\inqmlmodule Qt3D.Render
\inherits Node
\since 5.7
\brief Encapsulates a Render Pass.
A RenderPass specifies a single rendering pass - an instance of shader program
execution - used by Technique. A Render pass consists of a ShaderProgram and
a list of FilterKey objects, a list of RenderState objects and a list
of \l Parameter objects.
RenderPass executes the ShaderProgram using the given RenderState and
Parameter nodes when at least one of FilterKey nodes being referenced
matches any of the FilterKey nodes in RenderPassFilter or when no
RenderPassFilter is present in the FrameGraph.
If the RenderPass defines a Parameter, it will be overridden by a Parameter
with the same name if it exists in any of the Technique, Effect, Material,
TechniqueFilter, RenderPassFilter associated with the pass at runtime. This
still can be useful to define sane default values.
At render time, for each leaf node of the FrameGraph a base render state is
recorded by accumulating states defined by all RenderStateSet nodes in the
FrameGraph branch. Each RenderPass can overload this base render state by
specifying its own RenderState nodes.
\qml
Technique {
filterKeys: [
FilterKey { name: "renderingStyle"; value: "forward" }
]
graphicsApiFilter: {
api: GraphicsApiFilter.OpenGL
profile: GraphicsApiFilter.CoreProfile
majorVersion: 3
minorVersion: 1
}
renderPasses: [
RenderPass {
id: pass
shaderProgram: ShaderProgram {
// ...
}
parameters: [
Parameter { name: "color"; value: "red" }
]
renderStates: [
DepthTest {}
]
}
]
}
\endqml
\sa RenderPassFilter, FilterKey, Parameter, RenderState, Effect, Technique
|
11420 |
- |
| qrenderpass.h |
|
1735 |
- |
| qrenderpass_p.h |
|
1076 |
- |
| qshaderdata.cpp |
!
\class Qt3DRender::QShaderData
\inheaderfile Qt3DRender/QShaderData
\inmodule Qt3DRender
\brief Provides a way of specifying values of a Uniform Block or a shader
structure.
\note When subclassing and adding properties to QShaderData, note that if
you need to nest an inner Qt3DRender::QShaderData, the data type of the
property should be Qt3DRender::QShaderData* instead of the name of your
subclass.
\since 5.5
|
2557 |
- |
| qshaderdata.h |
|
1276 |
- |
| qshaderdata_p.h |
|
1730 |
- |
| qshaderimage.cpp |
|
25489 |
- |
| qshaderimage.h |
|
4710 |
- |
| qshaderimage_p.h |
|
1055 |
- |
| qshaderprogram.cpp |
|
25826 |
- |
| qshaderprogram.h |
|
4021 |
- |
| qshaderprogram_p.h |
|
1847 |
- |
| qshaderprogrambuilder.cpp |
!
\class Qt3DRender::QShaderProgramBuilder
\inmodule Qt3DRender
\brief Generates a Shader Program content from loaded graphs.
\inherits Qt3DCore::QNode
\since 5.10
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.
|
13696 |
- |
| qshaderprogrambuilder.h |
|
5167 |
- |
| qshaderprogrambuilder_p.h |
|
1593 |
- |
| qtechnique.cpp |
!
\qmltype Technique
\nativetype Qt3DRender::QTechnique
\inqmlmodule Qt3D.Render
\inherits Qt3D.Core::Node
\since 5.7
\brief Encapsulates a Technique.
A Technique specifies a set of RenderPass objects, FilterKey objects,
Parameter objects and a GraphicsApiFilter, which together define a
rendering technique the given graphics API can render. The filter keys are
used by TechniqueFilter to select specific techniques at specific parts of
the FrameGraph. A Parameter defined on a Technique overrides parameter
(of the same name) defined in RenderPass, but are overridden by
parameter in RenderPassFilter, TechniqueFilter, Material and Effect.
When creating an Effect that targets several versions of a graphics API, it
is useful to create several Technique nodes each with a graphicsApiFilter
set to match one of the targeted versions. At runtime, the Qt3D renderer
will select the most appropriate Technique based on which graphics API
versions are supported and (if specified) the FilterKey nodes that satisfy
a given TechniqueFilter in the FrameGraph.
\note When using OpenGL as the graphics API for rendering, Qt3D relies on
the QSurfaceFormat returned by QSurfaceFormat::defaultFormat() at runtime
to decide what is the most appropriate GL version available. If you need to
customize the QSurfaceFormat, do not forget to apply it with
QSurfaceFormat::setDefaultFormat(). Setting the QSurfaceFormat on the view
will likely have no effect on Qt3D related rendering.
\note Technique node can not be disabled.
\qml
Technique {
id: gl3Technique
parameters: [
Parameter { name: "color"; value: "orange" }
]
filterKeys: [
FilterKey { name: "renderingStyle"; value: "forward" }
]
graphicsApiFilter: {
api: GraphicsApiFilter.OpenGL
profile: GraphicsApiFilter.CoreProfile
majorVersion: 3
minorVersion: 1
}
renderPasses: [
RenderPass {
id: firstPass
shaderProgram: ShaderProgram {
// ...
}
},
RenderPass {
id: secondPass
shaderProgram: ShaderProgram {
// ...
}
}
]
}
\endqml
\sa Effect, RenderPass, TechniqueFilter
|
11374 |
- |
| qtechnique.h |
|
1573 |
- |
| qtechnique_p.h |
|
1162 |
- |
| renderpass.cpp |
|
2998 |
- |
| renderpass_p.h |
|
1953 |
- |
| shader.cpp |
|
6941 |
- |
| shader_p.h |
|
3847 |
- |
| shaderbuilder.cpp |
|
12190 |
- |
| shaderbuilder_p.h |
|
2502 |
- |
| shadercache_p.h |
|
1951 |
- |
| shaderdata.cpp |
|
9334 |
- |
| shaderdata_p.h |
|
3428 |
- |
| shaderimage.cpp |
|
2037 |
- |
| shaderimage_p.h |
|
1906 |
- |
| technique.cpp |
|
5826 |
- |
| technique_p.h |
|
2702 |
- |
| techniquemanager.cpp |
|
743 |
- |
| techniquemanager_p.h |
|
1226 |
- |