Skip to content

Stylize effects

Updated

Stylize effects give the whole image a look: chunky Pixelation, ASCII text art, a printed Dot Screen, CRT Scanlines, film-grain Noise and a digital Glitch. Each is one component on a camera.

ComponentTypeWhat it does
Pixelation Effectcomp-pixelation-effectDraws the image in large square pixels, like a retro game.
Ascii Effectcomp-ascii-effectRedraws the image as text characters.
Dot Screen Effectcomp-dot-screen-effectRedraws the image as halftone dots, like print.
Scanline Effectcomp-scanline-effectHorizontal lines over the image, like an old screen.
Noise Effectcomp-noise-effectAnimated film grain over the image.
Glitch Effectcomp-glitch-effectTears and shifts the image now and then, like a broken video signal.

PixelationEffectComponent draws the image in large square pixels.

Prop Type Default Description
granularity number 6 Size of a pixel block, in screen pixels, 0 to 128.

AsciiEffectComponent redraws the image as text characters.

Prop Type Default Description
characters string " .:,'-^=*+?!|0#X%WM@" Characters from darkest to brightest. An empty string restores the default.
font string 'inter' A font family by name: bundled, saved in the project, or registered by a script with Fonts.register.
fontSize number 54 Font size of the character atlas, in pixels, 8 to 256.
cellSize number 16 Size of a character cell on screen, in pixels, 1 to 128.
color string none One colour for every character; unset keeps the image’s colours.
invert boolean false Use the brightest characters for the darkest parts.

ASCII reads the image as the effects before it left it, so Bloom and Lens Drops show through the characters. It costs one more full-screen pass when another effect comes before it.

DotScreenEffectComponent redraws the image as halftone dots, like print.

Prop Type Default Description
intensity number 1 How strongly the dots replace the image, 0 to 1.
angle number 90 Angle of the dot grid, in degrees, -180 to 180.
scale number 1 Grid frequency, -2 to 2; higher magnitudes are finer.

ScanlineEffectComponent draws horizontal lines over the image, like an old screen.

Prop Type Default Description
intensity number 0.5 How dark the lines are, 0 to 1.
density number 1.25 Lines per screen pixel row, -2 to 2; higher is finer.
scrollSpeed number 0 How fast the lines roll down the screen, -5 to 5. 0 keeps them still.

NoiseEffectComponent adds animated film grain.

Prop Type Default Description
intensity number 0.25 How strong the grain is, 0 to 1.
premultiply boolean false Scale the grain by the image’s brightness, so dark areas stay clean.

GlitchEffectComponent tears and shifts the image now and then, like a broken video signal.

Prop Type Default Description
active boolean true Whether glitches happen. false keeps the effect ready but quiet.
delay [number, number] [1.5, 3.5] Seconds between glitches, as [min, max], each 0 to 10.
duration [number, number] [0.6, 1] Seconds a glitch lasts, as [min, max], each 0 to 5.
strength [number, number] [0.3, 1] Strength of weak and strong glitches, as [weak, strong], each 0 to 1.
columns number 0.05 Width of the torn columns, 0 to 1.
ratio number 0.85 Share of weak glitches, 0 to 1.

Pixelation, Scanline and Noise on the camera together make the scene look like an old monitor. Space fades all three in or out at once.

RetroScreen.jx
#pragma lifecycle(startup, update)
let pixels;
let lines;
let grain;
let retro = true;
let fade = null;
function setRetro(amount) {
pixels.setProps({ granularity: Math.max(1, Math.round(amount * 8)) });
lines.setProps({ intensity: amount * 0.3 });
grain.setProps({ intensity: amount * 0.08 });
}
function startup() {
const eye = findEntity('Main Camera');
pixels = eye.getComponent(PixelationEffectComponent);
lines = eye.getComponent(ScanlineEffectComponent);
grain = eye.getComponent(NoiseEffectComponent);
setRetro(1);
log('Retro screen on');
}
function update() {
if (!Input.keyboard.isKeyReleased(Key.Space)) return;
retro = !retro;
if (fade) fade.stop();
fade = Tween.value(retro ? 0 : 1, retro ? 1 : 0, setRetro, { duration: 0.6, ease: Ease.InOutQuad });
log(retro ? 'Retro screen on' : 'Clean picture');
}
  • One function, setRetro, sets all three effects from a single amount, so a tween of that amount fades the whole look.
  • granularity stays at least 1: a block of one screen pixel is the clean picture.
  • A new press stops the running tween first, so a quick double press turns the fade around instead of fighting it.