Kuesa post-processing effects¶
Kuesa provides a set of built-in post-processing effects, which are applied after rendering by the default Kuesa renderer, ForwardRenderer
It is possible to use them from both C++ and QML, as well as implement custom additional post-processing effects in C++.
Using post-processing effects¶
Effects are provided by the following import:
1 |
|
They can be added to postProcessingEffects in Kuesa.ForwardRenderer. For example, the following example first applies a threshold effect to the scene, followed by a bloom.
1 2 3 4 5 |
|
Effect gallery¶
Tone Mapping and Gamma Correction
Implementing a custom effect.¶
To introduce a new effect, it is possible to inherit from AbstractPostProcessingEffect . The core idea will be to provide a set of frame graph nodes, and a layer, which implement the effect.
Both color and depth textures are available to implement effects.
In order to simplify effect implementation, the qmltypeclass is provided. It renders a given material in a plane mesh.
A typical simple effect which applies a fragment shader to the output will need :
- A Qt3DRender::QFrameGraphNode root framegraph node
- A Qt3DRender::QMaterial material
- An Qt3DRender::QEffect effect To indicate that the technique is to be used by the Kuesa forward renderer, it is necessary to add a Qt3DRender::QFilterKey filter key to your techniques to match
{renderingStyle == forward}
- A Qt3DRender::QRenderPass render pass
- Note that a default passthrough vertex shader is provided by Kuesa:
qrc:/kuesa/shaders/gl3/passthrough
.vertqrc:/kuesa/shaders/es2/passthrough
.vertqrc:/kuesa/shaders/es3/passthrough
.vert
- The render pass can be filtered by a qmltype
- Note that a default passthrough vertex shader is provided by Kuesa:
The implementation of the Thresholding effect to create simple post-processing effects. The implementation of the Gaussian blur effect to create multi-pass post-processing effects.
Updated on 2023-07-03 at 11:02:17 +0000