If you write WebGL or Three.js for fun, you live inside a remarkably polite abstraction. You call new THREE.TorusKnotGeometry(), hand it a MeshPhysicalMaterial, drop three PointLights into a Scene, and call renderer.render(scene, camera). Beneath that line sits an entire civilization of software: a JIT-compiled JavaScript engine, a browser compositor, ANGLE, OpenGL or Metal or Vulkan, and a multi-hundred-megabyte GPU driver quietly managing memory, compiling GLSL, and hiding hardware weirdness.
Now take all of that away.
No Chrome. No Electron. No WebGL, no OpenGL, no Vulkan, no Metal, no wgpu, and no JavaScript JIT. Just a 2006 PlayStation 3—a 3.2 GHz big-endian PowerPC Cell with 256 MiB of main memory, paired with NVIDIA’s RSX “Reality Synthesizer” and its own 256 MiB of GDDR3—running vanilla three@0.187.0 (import * as THREE from "three") at native 1920 × 1080, with a PocketJS (SolidJS + Tailwind) HUD composited on top at 3× density.
TorusKnotGeometry, three orbiting coloured PointLights, studio reflections, 260 additive embers, a hardware-stenciled real-time mirror floor, and a translucent SolidJS HUD—all driven by real three@0.187.0.This post is the engineering story behind that screenshot: what makes the PS3’s graphics architecture genuinely strange if you come from WebGL, how we bridged unmodified Three.js r187 onto raw RSX command buffers and hand-written NV40 assembly shaders, five wild bugs we caught by disassembling the console toolchain, and what this means for ThreeRT—the native runtime for Three.js.
What makes the PS3 GPU weird (through WebGL eyes)
If you know WebGLRenderingContext, you already have the right mental model for rasterization: vertex buffers, index buffers, depth testing, fragment shaders and blending all exist on the PS3. What changes is everything around them.
Split memory, zero driver hand-holding
In WebGL, gl.bufferData() and gl.texImage2D() hand bytes to a driver that decides where they live, migrates them on demand, and cleans up after you. On a PlayStation 3, memory is physically split in two:
- 256 MiB of XDR for the Cell, where QuickJS, Three.js and PocketJS live
- 256 MiB of GDDR3 for the RSX (500 MHz core, 24 pixel pipelines, 8 vertex units)
You allocate VRAM yourself with rsxMemalign(64, bytes), translate raw pointers into the offsets the RSX understands (rsxAddressToOffset), order your writes with a PowerPC barrier (eieio), and explicitly invalidate the vertex and texture caches whenever you upload new data. Two 1920 × 1080 A8R8G8B8 colour buffers cost about 16.6 MB; a full 1080p Z24S8 depth-and-stencil buffer costs another 8.3 MB. That still leaves more than 200 MiB of VRAM for meshes, textures and glyph atlases.
No OpenGL—you speak the raw command FIFO
There is no gl.drawElements() driver layer in PS3 homebrew (PSL1GHT, the open-source take on libgcm). Instead, the CPU and GPU talk through a DMA ring buffer—the command FIFO—in shared memory. Every “graphics call” simply writes 32-bit method headers and payload words at ctx->current, then rings the doorbell (rsxFlushBuffer) so the RSX’s get pointer chases your put pointer.
That has two huge consequences for a WebGL developer:
- You own synchronization. Overwrite a vertex buffer, or rewind the ring, while the RSX’s
getis still behind yourput, and it reads garbage and hard-locks the console. You fence withrsxFinish(ctx, ++ref)and pace display flips withgcmSetFlipandgcmSetWaitFlip. - You own the ring’s end. Push too many commands in one frame without jumping back to the start with
rsxSetJumpCommand, and you run straight off the end of the segment. (HowTHREE.InstancedMeshtaught us this the hard way is bug 5.)
Pre-unified shaders—and the wildest uniform mechanism you’ve ever seen
The RSX descends from NVIDIA’s G70, the GeForce 7800 GTX generation, and PSL1GHT drives it with NV40-class registers and assembly. That is the last generation before unified shader cores: vertex programs (!!VP2.0) and fragment programs (!!FP2.0) run on completely different processors with completely different rules.
| WebGL (GLSL) | RSX vertex !!VP2.0 | RSX fragment !!FP2.0 | |
|---|---|---|---|
| Uniform storage | uniforms, UBOs | a bank of vec4 registers, c[…] | none! |
| Setting one | gl.uniform4f(…) | a block load through the FIFO | patched into the program’s microcode, in VRAM |
| Constants per instruction | as many as you like | at most one c[k] | at most one c[k] |
| Interpolators | varyings | o[COL0..1], o[TEX0..7] | f[COL0..1], f[TEX0..7] |
Read that second row again. The RSX fragment processor has no uniform registers.
When you declare a fragment uniform like uCamPos or uDirCol, the assembler (cgcomp) leaves a 16-byte hole right inside the fragment program’s machine code and records its byte offset in a constant table. Setting a fragment uniform literally means issuing a GPU-ordered DMA write (rsxInlineTransfer) that self-modifies the fragment program in VRAM—with every 32-bit float halfword-swapped, (bits >> 16) | (bits << 16), because that is the order the fragment unit fetches words in—and then pointing the RSX at the program again so it doesn’t run a stale copy.
- Swap halves
1.0 = 0x3f800000 → 0x00003f800.85 = 0x3f59999a → 0x999a3f59 - Write it into the slot
rsxInlineTransfer(ctx, fp_offset + 0x10, …) - Point the RSX at the program again
rsxLoadFragmentProgramLocation(…)
gl.uniform4f(loc, 1, 0.85, 0.4, 1).The big-endian silver lining
The Cell is big-endian PowerPC. In WebGL on x86 or ARM you almost never think about byte order. On the PS3, QuickJS stores Float32Array, Uint16Array and Uint32Array in the CPU’s native order—which is also the order the RSX reads vertices and indices in.
So when Three.js builds a BufferGeometry or updates InstancedMesh.instanceMatrix.array, our C bridge grabs the array’s memory with JS_GetTypedArrayBuffer and copies it straight into VRAM, with no per-element boxing and no byte swapping.
Two completely different worlds
Before looking at code, here is the gap between drawing in a browser and drawing on PS3 bare metal:
In a browserWebGL · managed and unified
WebGLRendererOn a PlayStation 3RSX · explicit and pre-unified
RSXRendererwalks the scene, packs typed arraysthe same on bothwhat we wrotethe driver’s job in a browser, ours on a PS3
Notice how many layers disappear on the right—and how much responsibility moves straight into your own C code.
Side by side: drawing one triangle in WebGL vs. the RSX
Every graphics programmer learns by drawing a single coloured triangle. Walking through the five stages of that one triangle side by side makes the PS3 click—and explains every optimization we had to build for Three.js later.
Ours has a red, a green and a blue corner, so you can follow it. At each stage it is something different—84 bytes, three vertices, two uniforms, 259,200 pixels, a frame on the TV—and the GPU math on the way is the same on both machines. What differs is who carries it from one stage to the next.
bufferData; the driver picks the memoryrequestAnimationFrame the driver’s job in a browser, ours on a PS3
Stage 1 · Uploading vertex data
In WebGL you hand a Float32Array to the driver and forget where it lives. On the RSX you carve aligned bytes out of GDDR3 yourself, enforce a PowerPC memory barrier, convert the CPU pointer into an RSX offset, and flush the GPU’s vertex cache:
Float32Arrayin the JS heap; little-endian on x86 and ARM, so 0.5 is 00 00 00 3fgl.bufferDatahands the bytes to the driverFloat32Arrayin XDR; big-endian, so 0.5 is 3f 00 00 00memcpy, eieiointo rsxMemalign(64, 84)vb_offan offset the RSX reads, not a pointer// The driver allocates, aligns,
// migrates and caches it for you.
const vbo = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
gl.bufferData(gl.ARRAY_BUFFER, verts,
gl.STATIC_DRAW);// Explicit VRAM, a barrier, an offset, a cache flush.
TriVert *vb = rsxMemalign(64, 3 * sizeof(TriVert));
memcpy(vb, triangle, 3 * sizeof(TriVert));
__asm__ volatile("eieio" ::: "memory"); // reach GDDR3
u32 vb_off;
rsxAddressToOffset(vb, &vb_off); // offsets, never pointers
rsxInvalidateVertexCache(ctx); // old vertices are staleStage 2 · Writing and loading shaders
In WebGL, GLSL strings compile on the user’s machine at run time. On the RSX, shaders are assembled offline into separate !!VP2.0 and !!FP2.0 microcode (cgcomp -a). Vertex microcode goes inline over the FIFO, but fragment microcode has to be copied into 64-byte-aligned VRAM, because the RSX fetches pixel instructions straight from GDDR3:
!!VP2.0cgcomp, offline!!FP2.0cgcomp, offlinefp_off// GLSL, compiled at run time. gl_Position = uMVP * vec4(aPos, 1.0); vColor = aColor; // … gl_FragColor = vColor * uTint;
# !!VP2.0: c[0..3] are the rows of uMVP DP4 R0.x, v[0], c[0]; DP4 R0.y, v[0], c[1]; DP4 R0.z, v[0], c[2]; DP4 R0.w, v[0], c[3]; MOV o[HPOS], R0; MOV o[COL0], v[3]; # !!FP2.0: uTint is a 16-byte hole in the ucode MOV R1, c[0]; MULR o[COLR], f[COL0], R1; // C: the fragment program goes into VRAM void *fp_vram = rsxMemalign(64, fp_size); memcpy(fp_vram, fp_src, fp_size); rsxAddressToOffset(fp_vram, &fp_off);
Stage 3 · Updating uniforms (the biggest mental shift)
In WebGL, vertex and fragment uniforms look identical. On the RSX they are two completely different hardware mechanisms:
1, .85, .4
uniformMatrix4fv, uniform4fthe same kind of call for either stage// Symmetric across stages. gl.useProgram(program); gl.uniformMatrix4fv(locMVP, false, mvp); gl.uniform4f(locTint, 1.0, 0.85, 0.4, 1.0);
// 1. Vertex: a FIFO block load into c[0..3]
// (Three.js is column-major; DP4 wants rows)
rsxLoadVertexProgramParameterBlock(ctx, 0, 4, mvp_rows);
// 2. Fragment: self-modify the program in VRAM,
// each float's 16-bit halves swapped
for (u32 i = 0; i < tab->num; i++)
rsxInlineTransfer(ctx, fp_off + tab->offset[i],
swapped, 4, GCM_LOCATION_RSX);
// Point the RSX at the program again
rsxLoadFragmentProgramLocation(ctx, fp, fp_off,
GCM_LOCATION_RSX);Stage 4 · Binding attributes, viewport and the draw
In WebGL, OpenGL’s convention (+Y up, depth from −1 to 1) is automatic. On the RSX you bind the colour + Z24S8 surface yourself, set a negative-Y viewport scale so Three.js’s +Y-up clip space lands right side up on the PS3’s top-down scanout, bind attributes by VRAM offset, and emit the draw packet into the FIFO:
x = 960 · xndc + 960
y = −540 · yndc + 540
Upright. Clip space’s +Y is up and the TV’s row 0 is its top, so the scale is negative.
- pixel
- (980, 620) on the TV: column 980, row 620 from the top
- raster
- weights 0.351 · 0.303 · 0.346 → vColor (0.351, 0.303, 0.346)
- fragment
- × uTint = (0.351, 0.258, 0.138) → 8 bits: 59 42 23
- WebGL
- row 459 from the bottom ·
readPixels(980, 459, …)→ 59 42 23 ff R G B A - PS3 RSX
- row 620 from the top · fb + 620 × 7680 + 980 × 4 = fb + 4,765,520 → ff 59 42 23 A R G B, one big-endian word
GCM_SHADE_MODEL_SMOOTH; a varying in GLSL), the fragment program multiplies by uTint, and the result is 32 bits—which WebGL keeps behind readPixels, and the RSX keeps at an address you can compute: 7680 bytes is a row of the surface. Flip the viewport’s sign to see why the negative scale is there.gl.viewport(0, 0, 1920, 1080);
gl.clear(gl.COLOR_BUFFER_BIT |
gl.DEPTH_BUFFER_BIT);
// xyz, then rgba 12 bytes in
gl.vertexAttribPointer(0, 3, gl.FLOAT,
false, 28, 0);
gl.vertexAttribPointer(1, 4, gl.FLOAT,
false, 28, 12);
gl.drawArrays(gl.TRIANGLES, 0, 3);rsxSetSurface(ctx, &surface); // A8R8G8B8 + Z24S8
rsxClearSurface(ctx, GCM_CLEAR_R | GCM_CLEAR_G |
GCM_CLEAR_B | GCM_CLEAR_A | GCM_CLEAR_Z | GCM_CLEAR_S);
// NDC (+Y up, z in [-1, 1]) -> top-down, z in [0, 1]
f32 scale[4] = { 960, -540, 0.5f, 0 };
f32 offset[4] = { 960, 540, 0.5f, 0 };
rsxSetViewport(ctx, 0, 0, 1920, 1080, 0, 1, scale, offset);
rsxBindVertexArrayAttrib(ctx, GCM_VERTEX_ATTRIB_POS, 0,
vb_off, sizeof(TriVert), 3, GCM_VERTEX_DATA_TYPE_F32,
GCM_LOCATION_RSX);
// The colour, 12 bytes in: v[3] in the vertex program
rsxBindVertexArrayAttrib(ctx, GCM_VERTEX_ATTRIB_COLOR0, 0,
vb_off + 12, sizeof(TriVert), 4, GCM_VERTEX_DATA_TYPE_F32,
GCM_LOCATION_RSX);
rsxDrawVertexArray(ctx, GCM_TYPE_TRIANGLES, 0, 3);Stage 5 · Presenting the frame (sync, rewind, flip)
In WebGL, presentation is invisible—you just return from requestAnimationFrame. On the RSX, nothing reaches your TV until you flush the FIFO, fence the GPU, rewind the ring so it never overflows, wait for the previous flip, and queue the next scanout buffer:
gcmSetDisplayBuffer). The RSX never draws into the buffer HDMI is reading: the flip swaps the two at vsync, and fb ^= 1 sends the next frame to the other one. A browser keeps a front buffer too; it is just never yours.// The browser flushes, waits for
// vsync and composites for you.
function loop() {
drawTriangle();
requestAnimationFrame(loop);
}rsxFlushBuffer(ctx); rsxFinish(ctx, ++ref); // the RSX is done rsxSetJumpCommand(ctx, begin_off); // rewind the ring ctx->current = ctx->begin; while (gcmGetFlipStatus() != 0) usleep(200); gcmResetFlipStatus(); while (gcmSetFlip(ctx, fb) != 0) usleep(200); rsxFlushBuffer(ctx); gcmSetWaitFlip(ctx); fb ^= 1; // swap front and back
Once you’ve seen those five stages side by side, nothing about PS3 graphics feels mysterious anymore—and every design decision in our Three.js adapter follows straight from them.
Bridging vanilla Three.js r187 to the RSX + PocketJS
Here’s the secret that makes real three@0.187.0 possible on a 2006 console: Three.js’s scene graph, math library, geometry generators, materials, lights and cameras are plain ES-module JavaScript with no DOM dependencies. Only the renderer touches a <canvas>.
So we didn’t fork Three.js, and we didn’t write a toy “Three-like” clone. The showcase app literally starts with:
import * as THREE from "three";
…and our own RSXRenderer (platforms/ps3/three-rsx-renderer.ts) walks the real THREE.Scene and drives a native C engine (platforms/ps3/rsx3d.c) through one thin typed-array bridge, globalThis.__rsx3d:
Vanilla means the package is untouched—what we replace is the renderer. What carries over, and what doesn’t yet:
- keeps
- the scene:
Mesh,InstancedMesh,Points,Line; standard, physical, Phong, Lambert, basic and normal materials; ambient, hemisphere, directional and point lights; fog - replaces
WebGLRenderer, withRSXRendererand native code- not yet
- what lives inside Three.js’s own renderer: shadows,
ShaderMaterialand TSL, its post-processing
Design trick #1: a zero-stall uniform split
Patching fragment microcode stalls the fragment pipeline if you do it per mesh, so we split uniforms strictly along the NV40’s hardware grain:
- Scene-wide values—camera position and exposure, the directional key light, three coloured point lights, hemisphere sky and ground, exponential fog—are patched into
pbr3d.fponce per pass. - Per-draw and per-instance values—MVP, model matrix, the inverse-transpose normal matrix, base colour, emissive, roughness / metalness / environment intensity, UV repeat and offset—go into vertex constants and reach the fragment program through the interpolators
o[COL0]ando[TEX0..4].
Result: no fragment program reloads per mesh, even across hundreds of draws.
Design trick #2: one native call per InstancedMesh
QuickJS is an interpreter—no V8, no JSC JIT. Calling into C 200 times a frame with loose floats would burn precious cycles on an in-order PowerPC core. So for a THREE.InstancedMesh, RSXRenderer hands Three.js’s own instanceMatrix.array and instanceColor.array to C in one native call:
native.drawInstanced(geoId, texId, mats, cols, im.count, this.instBuf, flags);
Inside rsx3d.c, C uploads the shared material constants once, then loops on the 3.2 GHz PPU computing MVP = VP × M and the normal matrix for each instance, uploading its constants and issuing rsxDrawIndexArray back to back—no vertex buffer or texture rebinds.
The honest cost: the RSX has no hardware instancing, so every instance is still its own draw. With 196 instances, writing those commands takes 28.9 ms of PPU time a frame, and that demo is our slowest at 16 fps. The Cell’s SPUs are the obvious next home for that loop.
Design trick #3: 3D and the PocketJS UI in one backbuffer
Rather than rendering the 3D scene into an offscreen target and blitting it, rsx_driver.c calls the scene right after binding the 1920 × 1080 A8R8G8B8 + Z24S8 surface:
- Pass 1 (3D): clear colour, depth and stencil, set the negative-Y viewport so Three.js’s right-handed clip space (+Y up, z from −1 to 1) works unmodified, and draw the scene.
- Pass 2 (PocketJS UI): skip the colour clear, reset depth, stencil, culling and polygon mode, switch to
ui.vp/ui.fpwithSRC_ALPHA, ONE_MINUS_SRC_ALPHA, and paint the SolidJS + Tailwind HUD straight over the 3D pixels at crisp 3× density.
No extra full-screen pass, no extra render targets—and existing 2D-only PocketJS apps don’t change at all when no 3D scene is submitted.
Pushing NV40 shaders: PBR, trig-free IBL and stenciled reflections
On a 2006 console, the trick to making 3D look genuinely modern isn’t brute-forcing polygon counts—it’s material response: specular sheen, Fresnel rims, a studio to reflect, and reflections that ground objects on the floor.
Per-pixel PBR + ACES filmic tone mapping in !!FP2.0
pbr3d.fp shades every one of the 1920 × 1080 pixels with metalness and roughness:
- Schlick Fresnel without
POW:x = 1 − N·V,x² = x·x,F = lerp(F0, 1, x²·x²·x), whereF0 = lerp(0.04, albedo, metalness). - Four lights per pixel: a directional key light with a roughness-driven Blinn-Phong lobe normalized by
(specExp + 8) · 0.0398, plus three coloured point lights with smooth inverse-square falloff. - ACES filmic tone mapping,
c(2.51c + 0.03) / (c(2.43c + 0.59) + 0.14), so bright highlights roll off into soft cinema whites instead of clipping to harsh primaries—thenx · rsq(x), a square root, as a cheap gamma.
Trig-free 360° studio IBL
Shiny gold and chrome look dead without something to reflect, and NV40 fragment programs hate atan2 and asin. So we generate a 256 × 128 procedural studio panorama (a warm overhead softbox, a cool cyan rim strip, a zenith ring light, a glow along the horizon) and sample it along R = 2(N·V)N − V with a trig-free, continuous 360° projection:
t = R.x / (|R.x| + |R.z| + 0.0001) u = (R.z < 0) ? (0.75 - 0.25 * t) : (0.25 + 0.25 * t) v = 0.5 - 0.48 * R.y
At +X (t = +1) both branches meet at u = 0.5; at −X (t = −1) they meet at 0 and 1 under GCM_TEXTURE_REPEAT. Zero trig instructions, zero seams—and the reflection fades with roughness, so mirror chrome reads as liquid metal while matte ceramic stays soft.
Real-time planar mirrors with the 8-bit stencil
That crisp upside-down golden torus knot in the marble floor isn’t screen-space trickery—it’s a classic hardware stencil pass using our Z24S8 buffer:
- Mask: draw the floor with colour and depth writes off, stamping
stencil = 1. - Reflect: where
stencil == 1, mirror the scene acrossy = planeY(scale(1, −1, 1)), mirror the lights’ Y, flip the front-face winding (GCM_FRONTFACE_CW), and draw every reflectable opaque mesh upside down below the floor. - Composite: clear only depth (
GCM_CLEAR_Z), turn the stencil off, and draw the glossy floor over it with alpha1 − reflectivity, then the upright scene.
Five wild hardware and toolchain bugs
Getting pixels onto a 20-year-old console from an Apple-silicon Mac (PSL1GHT in the hldtux/ps3dev Docker image, plus Rust nightly for powerpc64-sony-ps3) was half graphics programming and half detective work. Every one of these happened on real hardware—and if you ever hack on the RSX, this list may save you days.
1 · The GCC 13 strict-aliasing ghost in librsx.a
On the very first Three.js boot, the PocketJS HUD rendered razor-sharp—and the 3D background was pure #000000. We disassembled PSL1GHT’s prebuilt rsxSetFragmentProgramParameter inside librsx.a with ppu-objdump -dr and stared in disbelief:
18: std r11, 112(r1) # zero-init 16 bytes on the stack 20: std r10, 120(r1) 48: mr r28, r6 # r28 = the value (never read!) d0: mr r28, r3 # overwritten before it is copied 104: addi r5, r1, 112 # passes the zeroed buffer 110: bl rsxInlineTransfer
Every fragment uniform we set was uploading (0, 0, 0, 0) into VRAM—exposure, sky colours, every light intensity. Our best reading: ppu-gcc 13.2.0 optimized the copy away under strict aliasing. Replacing it with our own 12-line memcpy-based set_fp_vec4() over rsxInlineTransfer fixed it immediately.
2 · cgcomp -a -v ignores write masks on o[HPOS]
With fragment uniforms fixed, the sky lit up—and zero 3D triangles appeared. Dumping the compiled vertex microcode of pbr3d.vp found the culprit in two seconds:
DP4 o[HPOS].x, v[0], c[0]; -> 6041ff80 (mask = XYZW!) DP4 o[HPOS].y, v[0], c[1]; -> 6041ff80 (mask = XYZW!) DP4 o[HPOS].z, v[0], c[2]; -> 6041ff80 (mask = XYZW!) DP4 o[HPOS].w, v[0], c[3]; -> 6041ff80 (mask = XYZW!)
The vertex assembler ignores component write masks on output registers! All four DP4s wrote the full .xyzw, so every vertex in the universe collapsed to (w, w, w, w). Computing into R0.x … R0.w first and finishing with MOV o[HPOS], R0 produced distinct write masks—and the golden torus knot exploded onto the 1080p screen on the next deploy.
3 · cgcomp -a -f drops SUB, ABS and inline literals
We wrote raw !!FP2.0 for cgcomp -a -f (NVIDIA’s Cg compiler doesn’t run on ARM64 Linux), and inspecting the compiled .fpo binaries turned up four undocumented traps:
SUB R0, R1, R2;assembles to a 16-byte all-zero no-op—writeADD R0, R1, -R2;ABS R0, R1;is silently dropped—use the modifier,MOV R0, |R1|;- Inline literals like
{14.0}.xare read asR0—put every number in a named constant (uK0…uK4) - A blank line inside
!!FP2.0segfaults the assembler
4 · The classic custom-renderer trap: camera.matrixWorldInverse
In Three.js, camera.updateMatrixWorld() updates camera.matrixWorld, not camera.matrixWorldInverse. WebGLRenderer.render() is the one that calls:
camera.matrixWorldInverse.copy(camera.matrixWorld).invert();
Forget that one line in a custom renderer and your camera stays stuck at the origin looking down −Z, no matter where you orbit it.
5 · The FIFO wall, and tuning for the NV40
Switching to the instanced demo—then 400 instances in one InstancedMesh—froze the RSX on frame one. Why? Each instance emits about 58 FIFO words (a constant-block load of 12 vec4s plus a draw), so 400 × 58 = 23,200 words, about 92 KB, blew straight past the end of PSL1GHT’s command segment mid-frame. We fixed it on both ends:
- Safety:
rsx_driver.crewinds the FIFO to its start after every frame, and anensure_fifo_space()guard inrsx3d.crewinds mid-frame, so an arbitrarily large batch can never hang the GPU. - Speed: the point lights’
POW(LG2 + MUL + EX2) became repeated squaring (s² → s⁴ → s⁸ → s¹⁶),pbr3d.fpwent from 16 to 13 registers so the NV40 keeps more fragments in flight, the demo writesinstanceMatrix.arraydirectly instead of callingObject3D.updateMatrix()per instance, and the wave became a 14 × 14 grid of 196 pillars. - Point sprites: adding
MOV o[TEX0], v[0];tounlit3d.vpputTEX0in the vertex output mask, so the hardware’sGCM_POINT_SPRITE_TEX0coordinates finally reachedunlit3d.fp—and all 2,400 galaxy stars and 260 showroom embers lit up.
Live 1080p results on real PS3 hardware
Every frame below was captured natively at 1920 × 1080 from the RSX front buffer over our closed-loop DevShell on TCP :8623—which also hot-reloads app bundles in place without ever exiting to the XMB, and injects DualShock 3 input from the terminal.




With a DualShock 3 in hand: L1 / R1 switch scenes, the sticks orbit and zoom, △ toggles hardware wireframe, ○ toggles the mirror, □ pauses the orbit, and SELECT hides the HUD for a clean full-screen 1080p view.
None of these hits 60 fps yet. In three of the four, writing the 3D commands takes about 0.1 ms, so most of each frame goes somewhere we haven’t measured yet: QuickJS walking the scene on the PPU, the RSX shading two million PBR pixels (twice where there’s a mirror), or waiting on vsync. Profiling that is next.
And the work hasn’t stopped at these captures: the Cell’s six SPUs now run marching cubes and particles, and a second app flies through ThreeRT’s own Bistro and Zero-Day—baked offline into a PS3 scene format, rendered at 720p and scaled to 1080p—at 29–30 fps. That code is in pocket-nexus/pocketjs#786.
Why this matters for ThreeRT: RT means runtime
At first glance, running Three.js r187 on a 2006 PlayStation 3 sounds like a fun weekend stunt. In the context of ThreeRT, it is the boundary proof of a much bigger idea.
ThreeRT started as a hardware path tracer and has grown into a native runtime for Three.js—no browser between your scene and the GPU:
path: real-time path tracing at 60 fps on GPUs with ray-tracing hardware, nothing baked.webgpu: Three.js r187 and its ownWebGPURenderer, unchanged, running natively on macOS and Linux—a desktop app at 9.9 MB installed, 4.5 MB to download—and surfaces a browser simply can’t be, like a live 3D Wayland wallpaper on Omarchy (#300).
The PS3 completes the spectrum:
| Tier | How it runs | Hardware & API | What it proves |
|---|---|---|---|
| Flagship RT | path | Apple silicon, RTX, RDNA2+ (wgpu ray queries) | real-time path tracing with zero baking |
| Modern native | webgpu | Metal on macOS, Vulkan on Linux (wgpu + JavaScriptCore + PocketJS) | sub-10 MB native apps and OS surfaces, with the same pixels as Chrome |
| Console / legacy GPU | the PS3 port PocketJS, experimental | 2006 PlayStation 3: NV40-class RSX, raw FIFO, NV40 assembly, QuickJS | no browser, no Electron, no WebGPU, no Vulkan, no JIT—still vanilla Three.js r187 |
If vanilla three@0.187.0 can drive real-time PBR, studio IBL and hardware-stenciled mirror reflections on a 20-year-old PlayStation 3 at 1080p, there is no reason Three.js has to stay trapped inside a browser tab ever again.
The PS3 port is experimental, needs a console with custom firmware, and is built in PocketJS (platforms/ps3). How the three ways of running differ: RENDERING-METHODS.md.