Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/g-js-api/G.js/llms.txt

Use this file to discover all available pages before exploring further.

Shader functions are available in Geometry Dash 2.2 and later. They apply full-screen post-processing effects by generating the corresponding shader triggers. Every shader function returns a GJsObject — you must call .add() on it to place the trigger in the level. For a narrative introduction to shaders and layering see Particles and Shaders.
Shader triggers are a GD 2.2-exclusive feature. Levels using them will not load on older versions of the game.

sepia

Applies a sepia-tone (warm brownish tint) effect to the screen.
import { sepia } from 'geometry-dash-gjs';

sepia(0.8, 1.5).add(); // 80% sepia, fade in over 1.5 s
strength
number
required
Effect intensity from 0 (none) to 1 (full sepia).
duration
number
default:"0"
Seconds to transition to the target strength.
Returns GJsObject — call .add().

hue_shift

Rotates all hues on the screen by the given angle.
import { hue_shift } from 'geometry-dash-gjs';

hue_shift(180, 2).add(); // rotate hues 180° over 2 s
shift
number
required
Hue rotation in degrees (0–360).
duration
number
default:"0"
Seconds to transition to the target hue shift.
Returns GJsObject — call .add().

grayscale

Desaturates the screen toward grayscale.
import { grayscale } from 'geometry-dash-gjs';

grayscale(1, 0.5).add(); // full grayscale instantly (0.5 s)
strength
number
required
Desaturation amount from 0 (original color) to 1 (fully grayscale).
duration
number
default:"0"
Seconds to transition.
Returns GJsObject — call .add().

pixelate

Applies a pixelation effect, making the screen look like a lower-resolution image.
import { pixelate } from 'geometry-dash-gjs';

pixelate(0.5).add(); // medium pixelation
strength
number
required
Pixel size from 0 (no effect) to 1 (maximum pixelation).
duration
number
default:"0"
Seconds to transition.
Returns GJsObject — call .add().

chromatic

Separates the red, green, and blue color channels to create a chromatic aberration effect.
import { chromatic } from 'geometry-dash-gjs';

chromatic(0.4, 1).add();
strength
number
required
Channel separation amount (0–1).
duration
number
default:"0"
Seconds to transition.
Returns GJsObject — call .add().

glitch

Adds a horizontal scan-line glitch distortion to the screen.
import { glitch } from 'geometry-dash-gjs';

glitch(0.6, 0.3).add();
strength
number
required
Glitch intensity (0–1).
duration
number
default:"0"
Seconds to transition.
Returns GJsObject — call .add().

bulge

Applies a lens-bulge (fisheye) distortion to the center of the screen.
import { bulge } from 'geometry-dash-gjs';

bulge(0.7, 1).add();
strength
number
required
Bulge amount (0–1). Negative values create a concave (pinch) effect.
duration
number
default:"0"
Seconds to transition.
Returns GJsObject — call .add().

split_screen

Splits the screen into two offset halves, creating a split-screen visual artifact.
import { split_screen } from 'geometry-dash-gjs';

split_screen(0.3, 0.5).add();
strength
number
required
Split offset amount (0–1).
duration
number
default:"0"
Seconds to transition.
Returns GJsObject — call .add().

shader_layers

Creates a Shader Layers trigger that controls how multiple shaders are composited together. Pass an array of layer strings produced by shader_layer.
import { shader_layers, shader_layer } from 'geometry-dash-gjs';

shader_layers([
  shader_layer(0, 0.8),
  shader_layer(1, 0.5),
]).add();
layers
any[]
required
Array of layer strings returned by shader_layer(layer, strength).
Returns GJsObject — call .add().

shader_layer

Creates a single shader layer descriptor string to be included in a shader_layers trigger.
import { shader_layer } from 'geometry-dash-gjs';

const layer0 = shader_layer(0, 1.0); // layer 0 at full strength
const layer1 = shader_layer(1, 0.5); // layer 1 at half strength
layer
number
required
Layer index (0–15).
strength
number
required
Strength of this layer (0–1).
Returns string — a layer descriptor to pass into shader_layers.

Combined Example

This example applies a glitch and chromatic aberration effect simultaneously using a layered shader setup, then fades both out.
import {
  glitch, chromatic, grayscale,
  shader_layers, shader_layer,
  trigger_function, wait
} from 'geometry-dash-gjs';

trigger_function(() => {
  // Activate shaders
  glitch(0.8).add();
  chromatic(0.5).add();
  grayscale(0.3).add();

  // Layer composition
  shader_layers([
    shader_layer(0, 1.0),
    shader_layer(1, 0.8),
    shader_layer(2, 0.3),
  ]).add();

  wait(2);

  // Fade all effects out over 1 second
  glitch(0, 1).add();
  chromatic(0, 1).add();
  grayscale(0, 1).add();
});
Shader strength transitions use GD’s built-in interpolation. Pass a non-zero duration to smoothly blend between effect intensities rather than cutting abruptly.

Build docs developers (and LLMs) love