Skip to main content

Shader Filter (beta) Component

Overview

This company makes it possible to easily integrate your own custom shaders into the UIFX process.

Properties

Component Screenshot

Property                            TypeDetails
Material
    ShaderShaderThe custom shader to apply.
    Dynamic UpdateBoolWhether to update the shader every frame.
Apply
    Render SpaceEnumWhich 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.
    StrengthFloatStrength of the effect. Default value is 1.0, range is [0..1]

Usage

Add this component to any GameObject that contains a UI Graphic component (eg Text, Image, RawImage, etc). The object will now render with this shader applied.

Usage with TextMeshPro

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

Custom Shaders

Scripting

Namespace

The namespace
using ChocDino.UIFX;

Adding the ShaderFilter Component

Add the ShaderFilter component to your GameObject
// Add the component to your GameObject and set default properties
var filter = AddComponent<ShaderFilter>();

filter.BeginPropertyChange();
filter.Shader = null;
filter.DynamicUpdate = false;
filter.RenderSpace = FilterRenderSpace.Canvas;
filter.Strength = 1f;
filter.EndPropertyChange();

Applying a Custom Shader

Applying a Custom Shader
// Add the component to your GameObject
var filter = AddComponent<ShaderFilter>();

// Assign the shader to use
filter.Shader = Shader.Find("ChocDino/UIFX/AddNoise");

// Assign material properties
var material = filter.GetDisplayMaterial();
material.SetFloat("_Speed", 10f);

// Force the filter to update
filter.ForceUpdate();