AudioAsset
Ease
FastString
FontAsset
NineSlice
PackedSprite
PackedSpriteID
RB
   HardwareSettings
   IRetroBlitGame
RBAsset
Rect2i
ShaderAsset
SoundReference
SpriteGrid
SpriteSheetAsset
TMXMapAsset
   TMXLayer
   TMXLayerLoadState
   TMXObject
   TMXObjectGroup
   TMXProperties
Vector2i

RB.EffectApplyNow

Method  -  Static

public static void EffectApplyNow()

Parameters

No parameters.

Returns

Nothing.

Description

Apply post-processing effects immediately. This can be useful if the post processing effects should only be applied to certain layers of the scene. For example, it might be desirable to apply the Shake effect to the game board, but not to the game UI.

After calling RB.EffectApplyNow it is usually desirable to then reset post processing effects with RB.EffectReset, or change parameters of the effects currently applied with RB.EffectSet.

RB.EffectApplyNow is called automatically at the end of IRetroBlitGame.Render.

Example

ShaderAsset  shaderEffect = new ShaderAsset();

void Initialize() {
    shaderEffect.Load("shaders/ripple");
}

void Render() {
    // Enable a custom shader as a post processing effect, and render the game board
    RB.EffectShader(shaderEffect);
    shaderEffect.FloatSet("wave"RB.Ticks / 25.0f);
    RenderGameBoard();

    // Immediately apply post processing effect
    RB.EffectApplyNow();

    // Reset post processing effects and render the game UI without any effects.
    RB.EffectReset();
    RenderUI();
}

See Also

RB.EffectSet
RB.EffectShader
RB.EffectFilter
RB.EffectReset

See Docs

Features - Post-Processing Effects
Features - Post-Processing Shaders