Skip to content

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
import Kuesa.Effects 2.0

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
Kuesa.ForwardRenderer {
    postProcessingEffects: [ thresholdFx, bloomFx ]
}
BloomEffect { id: bloom }
ThresholdEffect { id: threshold }

Effect gallery

Depth Of Field

dof_range_2.png

Opacity Masking

noalpha.png

Thresholding

t35.png

Gaussian Blur

blur.png

Bloom

bloom.png

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.vert
      • qrc:/kuesa/shaders/es2/passthrough.vert
      • qrc:/kuesa/shaders/es3/passthrough.vert
    • The render pass can be filtered by a qmltype

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