r/rust_gamedev

▲ 88 r/rust_gamedev+1 crossposts

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

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.

u/ForgotTheSnare — 11 days ago
▲ 66 r/rust_gamedev+1 crossposts

Timberline Factory demo is live – a physics-based sawmill simulation, made by a guy who works in a real sawmill

Hey r/tycoon,

Two weeks ago I posted Timberline Factory here: a sawmill automation/simulation/tycoon game where logs are physics objects, not icons on a rail. Thanks for all the comments.

Someone asked whether I still have all ten fingers, since I work full-time (38.5 h/week) in a real sawmill. i do :D, and that question is part of why workplace safety is its own system in the game.

The free demo is live on Steam today.

Steam (free demo): https://store.steampowered.com/app/5037170/Timberline_Factory/

What's in it and what changed since my last post:

- Physics logistics: logs have weight and friction and they roll. Messy layouts and settings cause real jams.

- Economy: the timber market index uses mean reversion, so timing your sales matters. Bark goes into the biomass power plant and lowers your electricity costs.

- workers: there's a workplace safety research line. Neglect it and accident rates and sick days go up. Sick leave will also be reducible through a 3 stage research line with Early Access on Nov 6 (not in the demo).

- Maintenance: dirt and wear slow your machines down... new: the dirt is now visible, and your cleaner worker removes it.

- Balance pass on machine error/failure rates.

The clip shows the satisfying side: debarking, clean cuts at the saw blades, logs flowing. The chaotic side exists too, trust me :)

If you want to see more of the game in action, Wally1169 made a gameplay video: https://www.youtube.com/watch?v=v_z83YFkWzU – he played an older build, so balancing and a few things have changed since then.

Early Access is planned for Friday, November 6th. for the tycoon crowd: does the economy give you enough reasons to optimize or would you want more market pressure? I'll be around to answer.

AI Disclosure:
No AI was used in the making of this game!

u/El_Grande_Games — 11 days ago
▲ 67 r/rust_gamedev+1 crossposts

What would you expect from a realistic space flight simulator?

I’ve been working on my realistic space flight simulator, and this is what a full flight currently looks like: from the main menu, into the vehicle builder, launching from the pad, reaching space, and finally coming back down for reentry.

There are already a lot of features in the game, but I still keep finding things I want to add before I’m willing to call it ready.

So I’m curious: what would you personally expect from a realistic space flight simulator? What features would make you want to keep playing?

u/Inevitable-Cash8506 — 12 days ago
▲ 52 r/rust_gamedev+2 crossposts

Relativistic Black Hole

I wanted something physically grounded that still runs fast on a single quad billboard and looks cool.

How the effect works: Ray bending, the shader imitates the path of light rays bent by gravity (Schwarzschild metric) directly in the orbital plane of each ray. Then accretion disk. Instead of marching through dense 3D volumes, disk intersections are calculated as angular plane crossings.

"Relativistic" here means mostly Doppler beaming, when matter orbiting towards the observer appears significantly brighter and shifted towards blue, while receding matter looks dimmer and redder. Neil Tyson's nyoo-o-om, but for light. Usually it's not that visible, but I like it a bit exaggerated, and my implementation got this disco ball feel, but real black holes are way more achromatic, and yes, it turns out that famous orange photo shows a false color used by scientists to represent radio waves and heat. ..Come to think of it, that makes sense.

So, also, there's this shadow & photon ring, that's ISCO boundary(innermost stable circular orbit) and the thin photon ring formed by light that loops around the horizon before reaching the camera.

Background lensing here is actually handled with the sky shader rather than screen texture distortion, yes, meaning ships, planets and any foreground objects actually never get distortion, sliced, I tried to distort all stuff, but it feels like such visual doesn't really suit my game. However, I'm still thinking about black holes in the game and what can -or should- be done with them.

Anyway, thanks for reading. Built with Godot and Rust via gdext. Happy to answer any technical questions.

u/SiriusRU — 13 days ago
▲ 55 r/rust_gamedev+1 crossposts

I'm making a gladiator game in Bevy, here's a hundred a side

Hey all, I've been building Habet in Bevy for a while now. It's a gladiator school game: you train your men and send them to fight. This clip is a hundred a side; every man is doing his own thing, and nobody's controlling any of them.

Happy to answer anything about how it's built.

u/OkayEvan — 13 days ago

One Rust rules crate runs my tactics game in the browser (WASM), natively (wgpu) and on the server

Roll & Barrel is a small turn-based tactics game on the D&D 5e rules: cover, high ground, burning oil, exploding barrels.

All the rules live in one deterministic Rust crate. The same crate runs as WASM in the browser, in a native wgpu client, and on the server, which replays every fight to verify it.

Play it free in the browser: https://roll-and-barrel.com

u/martiLxMcFly — 12 days ago

A comprehensive tutorial on building a 3D physics engine from scratch

I just started a YouTube series on building a 3D game physics engine entirely from scratch in Rust! The series is meant to be comprehensive while still approachable for anyone without a background in calculus or mechanics.

I'm planning on a three-week release cycle for new episodes. Open to any feedback on this first installment!

youtube.com
u/TheHurtDev — 13 days ago