Super Mario World Transition

This is a post-processing shader adapted for Godot’s CanvasItem that simulates the iconic level transition or scene wipe seen in games like Super Mario World and other classic 16-bit titles.

The effect works in two distinct phases controlled by the progress_trans uniform:

  1. Pixelation: As the transition starts (progress_trans goes from 0.0 to approx 0.66), the SCREEN_TEXTURE is rendered at an increasingly lower resolution (res), creating a blocky, pixelated look.

  2. Color Fade: As the pixelation peaks (progress_trans goes from approx 0.66 to 1.0), the pixelated image is smoothly blended toward a solid transition_color, completing the scene change.

 

Adjustable Uniforms (Shader Parameters):

 

Parameter Type Description
progress_trans float The Master Control (0.0 to 1.0). Drives the entire transition from start (0.0) through pixelation to the final color fade (1.0).
transition_color vec4 The final solid color the screen fades to (e.g., black, white, or a specific scene color).
SCREEN_TEXTURE sampler2D Required Input: Automatically provides the rendered view of the scene before the transition begins.
Shader code
shader_type canvas_item;
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
uniform float progress_trans : hint_range(0.0, 1.0);
uniform vec4 transition_color : source_color;


void fragment() {
    float t = progress_trans * 3.0;
    vec2 iResolution = 1.0 / SCREEN_PIXEL_SIZE;
    vec2 uv = SCREEN_UV;
    float _Speed = 15.0;
    float res = floor(pow(t, 1.4) * _Speed) * 2.0 + 0.01;
    uv *= iResolution / res;
    uv = floor(uv);
    uv /= iResolution / res;
    uv += res * 0.002;
    vec4 texture_pixelada = texture(SCREEN_TEXTURE, uv);
    float fade_start = 1.0; 
    float fade_end = 2.0;  
    float mix_factor = smoothstep(fade_start, fade_end, t);
    COLOR = mix(texture_pixelada, transition_color, mix_factor);
}
Tags
animated, godotshader, MarioWorld, pixelart, pixelation, postprocess, retro, SceneWipe, transition
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

More from Gerardo LCDF

Reflective Crystalline Voronoi

Chromatic Spin

Abstract 3D

Related shaders

[SIG15] Mario World 1-1

Super Hex

MARIO STAR CLASSIC AND WHITE SHINE

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments