It is possible to use them from both C++ and QML, as well as implement custom additional post-processing effects in C++.
Effects are provided by the following import:
import Kuesa.Effects 1.2
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.
Kuesa.ForwardRenderer { postProcessingEffects: [ thresholdFx, bloomFx ] } BloomEffect { id: bloom } ThresholdEffect { id: threshold }
Tone Mapping and Gamma Correction
To introduce a new effect, it is possible to inherit from Kuesa::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 Kuesa::FullScreenQuad utility class 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 :
renderingStyle == forward
.qrc:/kuesa/shaders/gl3/passthrough.vert
qrc:/kuesa/shaders/es2/passthrough.vert
qrc:/kuesa/shaders/es3/passthrough.vert
The render pass can be filtered by a Qt3DRender::QRenderPassFilter.
The implementation of the thresholding effect can give a good starting point to create simple post-processing effects. The implementation of the Gaussian blur effect can give a good starting point to create multi-pass post-processing effects.