Skip to main content

ROP Blend Filter Component

Overview

This component exposes new blend mode for blending the Graphic with the back buffer. Usually in Unity UI, a standard alpha blend is performed, but this component allows for custom Photoshop-like blend modes. It uses the standard hardware blending modes (during the ROP stage of the GPU pipeline), so not all blend modes are possible, but it's more than usual.

This is based on work by "The Code Corsair" in his blog post: "Photoshop Blend Modes Without Backbuffer Copy". This component doesn't implement all of the blend modes in his article, as some of them require two passes.

WebGL Demo

Properties

Component Screenshot

Property                            Type    Range    DefaultDescription
ColorColorWhiteAn optional color tint to apply (multiply) to the Graphic before it is blended.
Blend ModeEnumSubtractThe blend mode preset to use. If you select Custom then you'll be able to set the hardware blend modes yourself, however we did not find any other useful ones.
Blend Modes
Custom Blend Mode
    Custom OpEnumAdd
    Custom SrcEnumZero
    Custom DstEnumZero
Apply
    Render SpaceEnumCanvasWhich coordinate system use when rendering this filter. Options are:
Canvas: Render the filter before any transforms (scale/rotation/translation etc) are applied.
Screen: Render the filter after transforms have been applied.
Read more about this property here.
    StrengthFloat[0..1]1.0Strength of the effect.

Usage

Add this component to any GameObject that contains a UI Graphic component (eg Text, Image, RawImage, etc).

HDR Blend Modes

Some of the blending modes require HDR rendering (floating-point backbuffer). These modes are labeled as such.

FILTER ORDER

If you're stacking multiple filters, this component should always be the LAST one in the list to get correct blending results.

Usage with TextMeshPro

To use this filter effect with TextMeshPro - Text (UI) use the Filter Stack (TextMeshPro) component.