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

RB.EffectShader

Method  -  Static

public static void EffectShader(ShaderAsset shader)

Parameters

shader ShaderAsset Shader asset

Returns

Nothing.

Description

Set a custom post-processing effect shader which was previously created with ShaderAsset.Load. Using this method any post-processing effect can be created which takes the RetroBlit display as input, and any other inputs provided by RetroBlit shader methods.

Note that some RetroBlit built-in shaders will not work if a custom shader is specified, because they themselves are created by a built-in RetroBlit shader which will be replaced by a call to RB.EffectShader. To revert back to the built-in shader call RB.EffectReset.

See Assets/RetroBlit/Internal/Materials/PresentBasicShader.shader for an example of a minimal present shader, and Assets/RetroBlit/Resources/Demos/DemoReel/PresentRippleShader.shader for a simple ripple-effect shader.

Example

ShaderAsset  shaderEffect = new ShaderAsset();

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

void Render() {
    // Animate a value in the post processing shader to create a moving ripple effect
    shaderEffect.FloatSet("wave"RB.Ticks / 25.0f);
}

See Also

RB.EffectSet
RB.EffectFilter
RB.EffectReset
RB.EffectApplyNow

See Docs

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