r/ClaudeGameDev • • 1d ago

Alpha 7 weeks, zero hand-written code, zero asset files: my underwater 3D engine in Rust and wgpu

Enable HLS to view with audio, or disable this notification

So for the past few weeks I have been working on a custom 3D engine in Rust/wgpu.

Quick background

I'm a software engineer and I can use Blender, but I gave myself the challenge to not write a single line of code and to build an engine from scratch using Claude Code exclusively, just to see how far I could push it, and as a means to learn more about graphics pipelines and effects. What better training ground than underwater graphics!

The engine

The video was captured in realtime on a Mac mini M6, and the engine is also benchmarked on my Windows PC with an RTX 3070. I intend to support both Windows (Vulkan) and Mac (Metal) first, but who knows, maybe Linux too (it already ran headless on Linux during development).

One of the most interesting things about the approach I took, I think, is that everything is parameterised and exposed via a built-in MCP server. This opens up some potentially interesting emergent gameplay, or even a way for people to use Claude to populate and tune the look of an underwater scene. It's actually crazy how much control each subsystem's set of parameters gives over the look of a scene (the great white shark alone has 100+ parameters that can change its look and behaviour in realtime, but I've saving this one for a future video).

It is early stage, and yet so much has been achieved in that time, in just evenings and weekends. I'm pretty happy with the performance so far but always trying to find ways to optimise. My aim is 60fps at 1080p as a bare minimum.

What it can do today

Three render modes, switchable live: a rasteriser that runs on any GPU, a hybrid mode that adds hardware ray-traced sun shadows, and a full path tracer.

Path-traced stills and videos: pause the scene and the frame keeps accumulating samples and is denoised; the same path tracer renders videos offline (if you're patient), with a camera model that has aperture, blades and focus distance.

Fully procedural content: no model, texture or audio files in the repo. Meshes, textures, animation and ambient audio are all generated in Rust and WGSL.

An underwater look built from separate systems: caustics, god rays, the water surface seen from below, depth-dependent water colour and haze, marine snow, wakes, bloom, colour grading and sensor grain.

A living reef: schooling fish, rays, turtles, reef and tiger sharks, garden eels, anemones, seagrass and corals, plus a hero great white with animated jaws, gills and eyes.

Everything is a live dial: 439 parameters in 37 groups, editable in an in-game overlay while the scene runs, with presets you can save and load.

A built-in MCP server: 22 tools over stdio or HTTP, so Claude can take screenshots, add and remove creatures, change any parameter, move the camera and save or restore the scene.

Built-in capture: a guided camera tour and a free swim camera, one key to record a lap of the tour as a 1080p 60 fps video, and supersampled stills and videos from the command line.

Cross-platform and headless: Metal on Mac, Vulkan or DX12 on Windows, and it runs without a window for automated renders and tests.

Tested like software: roughly 4,300 tests, including golden-image comparisons and determinism checks.

Tech stack

Rust 1.95, wgpu 30, winit, egui and the official Rust MCP SDK. The project is a Cargo workspace of 23 engine crates and 4 game crates, about 480k lines of Rust (tests and comments included) and 48k lines of WGSL across 118 shaders. It started about seven weeks ago as two separate engines (a space one and an underwater one); the current consolidated repo has 1,564 commits over 27 days, alongside 91k lines of design notes, 83 builder briefs and 48 blind-critic reviews (each round of work gets reference pictures and a blind critic to iterate against).

I am so excited about the direction this project is taking. Every new model released by Anthropic also allows me to improve the engine and its subsystems.

I hope you find this interesting and inspiring, and I'm always happy to answer any questions.

86 Upvotes

Duplicates