Game Development

Godot Loading Screen and Scene Transition Effects with a Shader

Build a shader-driven loading screen in Godot, style the UI overlay, and trigger it from your scene manager during level changes.

7 min read
A purple patterned loading screen with the word LOADING in the lower right corner.
A purple patterned loading overlay fills the screen during a level change. — footage: Rapid Vectors

To build a shader-driven scene transition in Godot, create a new CanvasLayer overlay with a custom ShaderMaterial using two blended noise textures. Preload and instance this screen from your manager script during level loading. After the transition completes, queue_free the transition scene so the new scene can take over smoothly.

Set up the scene transition screen

steps

  1. Open your Godot project and create a new scene with a CanvasLayer as the root node.

    Godot editor is open with a Create New Node dialog centered on the screen and CanvasLayer visible in the node picker.

    The Godot editor shows a new scene being created with the Create New Node dialog open and CanvasLayer visible. — Rapid Vectors

  2. Rename the CanvasLayer node to something like scene_transition_screen.

  3. Add a TextureRect node as a child of the CanvasLayer.

  4. Set the TextureRect’s anchor to Full Rect.

  5. Create and assign a new CanvasTexture to the TextureRect's Texture property.

Add the noise textures for the shader effect

steps

  1. Download a noise texture pack (see references if needed) and unzip the contents.

  2. Import two textures into your screen_transition folder: one from a cracks subfolder (e.g., cracks_02), and one from the craters or similar dissolve folder (e.g., crater_04).

    A Windows File Explorer window is open over the Godot editor, showing a folder of noise texture subfolders such as Cracks, Craters, Marble, Perlin, and Voronoi.

    A file browser is open to a noise texture pack folder with multiple texture subfolders listed. — Rapid Vectors

Build the shader effect

steps

  1. In the Inspector for the TextureRect, scroll to the Material section and create a new ShaderMaterial.

  2. For the ShaderMaterial, choose to write your shader in code (not the visual shader option).

    Godot Engine is open with a shader script editor showing code for a canvas item and a uniform sampler2D texture declaration.

    The shader script editor is open with shader code visible and a uniform texture parameter being added. — Rapid Vectors

  3. Double-click to open the shader editor. Set the shader type to canvas_item.

  4. Add uniform parameters for your imported noise textures, two colors, tiling, move speed, and subtraction speed.

  5. Sample both noise textures in the fragment function and combine them using a subtraction to create the dissolve effect.

  6. Animate the noise by modifying the UV with tiling and time-based motion.

  7. Mix two colors together in the final output using your blended noise to interpolate between them.

Example shader structure:

shader_type canvas_item;

uniform sampler2D noise_texture;
uniform sampler2D dissolve_noise_texture;
uniform vec4 color1 : source_color = vec4(0.0, 0.0, 0.0, 1.0);
uniform vec4 color2 : source_color = vec4(0.8, 0.5, 0.5, 1.0);
uniform float tiling_factor : hint_range(1.0, 10.0) = 1.0;
uniform float move_speed : hint_range(0.1, 5.0) = 0.1;
uniform float subtraction_speed : hint_range(0.1, 5.0) = 1.0;

void fragment() {
    vec2 uv = FRAGCOORD.xy / SCREEN_PIXEL_SIZE.xy;
    uv *= tiling_factor;
    uv = fract(uv);
    uv.y += TIME * move_speed;

    float noise_val = texture(noise_texture, uv).r;
    float dissolve_val = texture(dissolve_noise_texture, uv).r;

    float subtraction_factor = sin(TIME * subtraction_speed);
    float final_val = noise_val - dissolve_val * subtraction_factor;
    COLOR = mix(color1, color2, final_val);
}
  1. Assign your imported cracks image to noise_texture and the dissolve image to dissolve_noise_texture in the ShaderMaterial parameters.
  2. Tweak color, tiling, move speed, and subtraction speed as needed.

Style the loading text and UI polish

Test the transition screen in the editor

steps

  1. Open the scene transition screen in the Godot editor and click Play to preview it.

    Godot Engine editor displays a scene preview with a purple transition background and the word LOADING in large pixel text.

    The scene transition screen preview is open in the editor with the loading text visible. — Rapid Vectors

  2. Adjust the tiling, move speed, and subtraction speed shader parameters from the Inspector to tune the animation.

  3. Edit the color parameters as needed to match your game’s look.

Trigger the overlay from your scene manager

steps

  1. In your scene manager script, instance the transition and add it to the scene tree’s root:

    var transition = TransitionScreen.instantiate()
    get_tree().root.add_child(transition)

    Godot Engine script editor with the scene_manager.gd file open, showing a scenes dictionary and a transition_to_scene function in the code area.

    The scene manager script is open in the Godot script editor, with scene transition logic visible in the code pane. — Rapid Vectors

  2. Wait for the desired duration (e.g., yield or await with a timer) so the effect is visible before switching scenes.

  3. After switching, call queue_free() on the transition overlay to remove it:

    transition.queue_free()

Use the effect during level changes

FAQ

Godot shader loading screen tutorial

Create a new CanvasLayer scene, add a TextureRect with a ShaderMaterial that blends two noise textures, and overlay this as a loading screen during scene changes.

how to make scene transitions in Godot 4

Set up a CanvasLayer-based transition screen with a custom shader. Preload and instance it from your scene manager, wait during the transition, and remove it after changing levels for polished scene transitions.

loading screen effects for Godot games

Use a ShaderMaterial with noise-based animation for your loading overlay. Combine colors and textures in code to create dynamic, animated effects that play between gameplay scenes.

shader-based transition in Godot

A shader-based transition uses a CanvasItem shader to blend and animate noise textures, controlling tiling, motion, and color blends in the pixel output, creating visually smooth scene transitions.

Godot scene change polish tutorial

To add polish to scene changes, overlay a transition screen with animated shader effects and custom UI text, and manage it from your scene changer to fade in and out seamlessly.

Sources


Official reference: Godot documentation.

Sources

Screenshots on this page are frames from the videos below, used to illustrate the steps they describe. All rights remain with their creators.

Checked against: