GemShock is a binary-choice strategy game with full 3D crystal visualizations rendered in Three.js. Players bet on Red Crystal vs Blue Crystal each round. The risk-reward distribution drifts between rounds, so optimal play requires reading the meta — not just running a fixed strategy.
The technical hook is that the crystal scene runs at 60fps even on mobile Safari, which is hard because Three.js's default shadow pipeline kills mobile GPUs. The renderer uses baked ambient occlusion and a single dynamic directional light to fake depth, with a custom shader that drives the crystal facets' refraction.
Multiplayer mode runs through Socket.IO, with a deterministic server-side round resolver so clients can't desync the outcome. Single-player mode runs the same resolver client-side for offline play.
It's a small game but a clean technical artifact — a single-page React app with no global state library, just useState + useReducer for the round loop.
- 01Three.js crystal scene at 60fps on mobile Safari
- 02Custom refraction shader with baked AO for performance
- 03Multiplayer via Socket.IO with deterministic server-side resolver
- 04Drifting risk-reward distribution rewards meta-reading
- 05No global state library — useState + useReducer only
More work
Seven other projects across crypto, AI, and games.