The PS1 wobble comes from vertices landing on whole pixels of a low-resolution screen. Many shaders copy the look by rounding VERTEX in view space to a fixed step, but a step in metres is many pixels close up and less than one far away. In our Godot 4.7 test, a quad sliding sideways jumped 4 px at a time at 3 m and moved smoothly, 1 px at a time, at 12 m, the same as with no snapping. The script below snaps in clip space, after the projection, to a 320 by 240 grid and writes POSITION: 3 px steps at 3 m and at 12 m, which is one 320-wide pixel on our 960 px screen.
The code
Save it as psx_snap.gd and load it with const PsxSnap := preload("res://psx_snap.gd"). Then $Crate.material_override = PsxSnap.make(preload("res://textures/crate.png")), with the grid size as an optional second value. The shader code is in the script, so you can also copy it into a .gdshader file.
extends RefCounted
## PS1-style vertex wobble: snap every vertex to a low-resolution screen grid,
## so the wobble is the same size in pixels near and far.
## const PsxSnap := preload("res://psx_snap.gd")
## $Crate.material_override = PsxSnap.make(preload("res://textures/crate.png"))
const CODE := """
shader_type spatial;
uniform sampler2D albedo_tex : source_color, filter_nearest;
uniform vec2 snap_resolution = vec2(320.0, 240.0); // the old console's screen
void vertex() {
vec4 clip = PROJECTION_MATRIX * MODELVIEW_MATRIX * vec4(VERTEX, 1.0);
vec2 half_res = snap_resolution * 0.5;
// to the screen (-1..1), onto the grid, and back
clip.xy = round(clip.xy / clip.w * half_res) / half_res * clip.w;
POSITION = clip;
}
void fragment() {
ALBEDO = texture(albedo_tex, UV).rgb;
}
"""
static func make(tex: Texture2D, resolution := Vector2(320, 240)) -> ShaderMaterial:
var sh := Shader.new()
sh.code = CODE
var m := ShaderMaterial.new()
m.shader = sh
m.set_shader_parameter("albedo_tex", tex)
m.set_shader_parameter("snap_resolution", resolution)
return m
What we measured
A 1 m white quad facing the camera, slid 0.6 m to the right in 120 steps of 5 mm, 3 m and 12 m from the camera, on a 960 by 540 screen. After each step we read where its left edge was on the screen and counted the size of every jump. Two runs gave the same numbers.
- No snapping: 71 moves of 1 px at 3 m, 17 moves of 1 px at 12 m.
- Rounded in view space to 1/30 m: at 3 m, 18 moves, 17 of them 4 px and one 3 px. At 12 m, 17 moves of 1 px, no visible snapping at all.
- The script, clip space, 320 by 240: 23 moves of 3 px at 3 m, 6 moves of 3 px at 12 m.
Why it happens
The farther away something is, the fewer pixels a metre covers on screen. A fixed step in view space is a fixed distance, so it turns into a big jump up close and a jump smaller than a pixel far away. After PROJECTION_MATRIX the vertex is in clip space, and dividing x and y by w gives its place on the screen from -1 to 1. Rounding there, to half the grid's width and height, puts every vertex on the same pixel grid whatever its distance, close to what the old hardware did. Multiplying back by w keeps the depth and perspective as they were.
What to change
- A stronger or weaker wobble: a smaller snap_resolution such as 160 by 120 makes bigger steps, a larger one smaller steps.
- The low-resolution look of the whole screen: render at a low resolution without uneven pixels. Animation at a low frame rate: stepped animation at 12 fps.
Ready-made PS1 effects: PSX Retro VFX Collection for Godot 4 has 291 PS1-style effects in one project, all with low-res pixel textures: explosions, magic, gunfire, horror, weather and rewards.
Tested in Godot 4.7 with the Compatibility renderer.
Ready-made: PSX Retro VFX Collection for Godot 4 has 291 PS1-style effects in one project, all with low-res pixel textures: explosions, magic, gunfire, horror, weather and rewards.
More how-tos for PSX Retro VFX Collection for Godot 4: Play animations in 12 steps a second, at the right speed on any screen
More how-tos: Shaders, materials and lights
- A 3D outline that stays the same width on screen
- Find and fix the seam in a repeating texture
- Snow that stays on the roofs
- Packed ORM maps on a StandardMaterial3D
- Neon signs that share a material but not a colour
- A MatCap that stays the right way up from every side
- Scroll or tile a 2D texture without stretched edge lines
- Keep floors, roads and roofs sharp when the camera looks along them
- Make WorldEnvironment color grading apply to a 2D game
- Get a hard cel-shaded light edge from StandardMaterial3D's Toon mode
- Make metallic materials stop looking black or flat
- Make a glowing sign or screen actually light the wall around it
- Use a LUT strip for color grading in Godot 4
- Tiling textures that keep their size on any mesh
- A sharp low-resolution PS1 look
- Only 8 lights show on a long wall in Compatibility
- Hit flash shader for 2D sprites
- Flash a 3D enemy white when it takes a hit
- Dissolve shader for 3D models
- 2D outline shader that is not cut off
- 3D outline shader without gaps at the corners
- A force field shield with a hit ripple
- Normal map inverted: DirectX vs OpenGL
- Full-screen post-process shader in 3D
- Scroll a shader texture for hours without the once-an-hour jump