PS1-inspired 3D graphics for web games. Vertex snapping (polygon wobble), affine texture warping, low internal resolution upscaled with nearest filtering, low-poly models with small nearest-filtered textures, distance fog with a short draw distance, 15-bit color with ordered dithering, cutout transparency, vertex lighting, and how to set it up in three.js (onBeforeCompile material patch + a low...
Download skill (.zip) Files on GitHubPS1 retro graphics
Drop-in: assets/ps1.js (tested on a real GPU: the three.js material patch and 120p renderer render a fogged, dithered,
snapped scene; the raw WebGL2 shaders compile and link). Builds on threejs-game-development and low-poly-graphics.
import * as THREE from "three";
import { ps1Material, ps1Renderer } from "./core/ps1.js";
const tex = await new THREE.TextureLoader().loadAsync("assets/img/crate-64.png");
const mat = ps1Material(THREE, new THREE.MeshLambertMaterial({ map: tex }), { snap: 120, colorDepth: 32 }); // also sets nearest filtering
scene.fog = new THREE.Fog("#1a1a22", 4, 18); // short draw distance
const ps1 = ps1Renderer(THREE, renderer, { height: 240 }); // 240p internal resolution
addEventListener("resize", () => { renderer.setSize(innerWidth, innerHeight, false); ps1.resize(); });
// loop: ps1.render(scene, camera);
Raw WebGL2: PS1_VERT / PS1_FRAG include affine UVs (multiply UV by w in the vertex shader, divide in the fragment shader,
so textures warp like on the PS1), snapping, fog and dither.
The look, piece by piece
| Ingredient | Setting |
|---|---|
| Resolution | 240p (height: 240) or 320×240; integer upscale if you can |
| Vertex snap | snap 80–160: lower = more wobble |
| Textures | 32–128 px, nearest filtering, no mipmaps, limited palettes |
| Models | 100–600 triangles per character, flat or vertex colors (low-poly-graphics) |
| Lighting | Lambert (per-vertex feel) or baked into vertex colors; no PBR |
| Fog | Short and colored; hides the near draw distance |
| Color | colorDepth 24–32 levels per channel with Bayer dithering |
| Transparency | Cutout (alpha test), not smooth blending |
| Camera | Wider FOV (70–90), slightly jerky follow; tank controls optional |
Tips
- Pair with a CRT or slight chroma post effect (shader-development) for “on a TV” feel. Keep it optional.
- Horror: dark fog, a flashlight spot (game-lighting), low ambient.
- Performance is great on phones (tiny render target), so it’s also a good choice for weak devices.
- Verify in the viewer’s preview (never the sandbox browser) at phone and desktop sizes.