Skip to content

PostProcessingLayer

Widget wrapper applying post-processing shader effects and rendering scales to its child content.

Overview

PostProcessingLayer is a visual wrapper that intercepts rendering of its child content and applies post-processing shaders, effects, and custom scale factors.

Key capabilities: - Custom shader and effect chains (postEffect, effect). - Rendering scale manipulation (effectScale). - Non-invasive wrapping of complex widget trees without affecting internal event propagation.

Applying Post-Processing Effect to Child Widget

PostProcessingLayer layer = new PostProcessingLayer();
layer.effect("unigui:bloom");
layer.addChild(contentWidget);
  • PanelWidget: Base container for multi-child widgets managing hierarchy, deferred mutations, and rendering order.

API

PostProcessingLayer::effect()

Returns the effect identifier of the current post-processing chain, or empty string if none.

Returns String: The identifier of the active post-processing effect..

PostProcessingLayer::effect(String)

Configures a registered post-processing effect by its identifier string.

Parameter Type Description
effectId String Identifier of the post-processing shader effect.

Returns PostProcessingLayer: This widget instance for chaining..

PostProcessingLayer::effectScale()

Returns the offscreen target rendering scale factor.

Returns float: The rendering scale factor applied by the post-processing effect..

PostProcessingLayer::effectScale(float)

Sets the offscreen render target scale factor relative to layer bounds.

Parameter Type Description
effectScale float Post-processing effect rendering scale factor.

Returns PostProcessingLayer: This widget instance for chaining..

PostProcessingLayer::postEffect()

Returns a copy of the active post-processing effect chain.

Returns UiPostEffectChain: The active post-processing shader effect chain..

PostProcessingLayer::postEffect(UiPostEffectChain)

Sets the post-processing effect chain applied to this layer's subtree.

Parameter Type Description
postEffect UiPostEffectChain Post-processing shader effect chain.

Returns PostProcessingLayer: This widget instance for chaining..