r/ps1graphics • u/Empty_Acanthisitta71 • 23h ago
Godot I made a PS1-style starter kit for Godot 4: vertex snapping, affine UVs and dither in the Compatibility renderer (how it works inside)
I've been building PS1-style horror stuff in Godot 4 and packaged my setup into a kit. Some of the techniques that might be useful even if you roll your own:
**Vertex snapping (the wobble):** in vertex(), go to clip space, divide by w, snap xy to a grid (e.g. 160 px), then multiply back:
vec4 clip = PROJECTION_MATRIX * MODELVIEW_MATRIX * vec4(VERTEX, 1.0);
clip.xy = floor(clip.xy / clip.w * res) / res * clip.w;
POSITION = clip;
Writing POSITION directly works on Compatibility, so it runs in web exports.
**Affine textures:** pass (UV * w, w) as a varying and divide in fragment(). Blend with normal UVs using a strength value, so you can tone it down on big floors.
**Global shader uniforms:** psx_snap_resolution and psx_affine_strength live in Project Settings > Shader Globals. One slider changes every material, even at runtime.
**Dither:** a canvas_item shader on a CanvasLayer that reads hint_screen_texture, quantises to 32 levels per channel (15-bit like the PS1) and adds a 4x4 Bayer matrix. The HUD sits on a higher layer so text stays crisp.
**Converting imported models:** a small node walks every MeshInstance3D under its parent at runtime and swaps each StandardMaterial3D for the PSX shader. It keeps the texture, tint, alpha scissor and emission, and can add box colliders.
The kit also has an FPS player (head bob, flashlight, interaction ray), readable notes and flickering lights, plus a demo room. Tested on Godot 4.7, Compatibility and Forward+.
Happy to answer questions about any of it.