r/ClaudeGameDev • • Oct 03 '26

Alpha 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.

190 Upvotes

36 comments sorted by

5

u/Inner_University_848 Oct 07 '26 edited Oct 07 '26

This is incredible... bravo. Jesus Christ. Seven weeks of evenings and weekends, no hand-written code, and you've ended up with path tracing, a living reef and an MCP server. I'm genuinely impressed. It's almost too good to be true!!!

A few questions, if you're okay/ happy to answer:

  1. Rust: How much of the performance and render quality do you credit to Rust and wgpu, versus the architecture and the approach you took with Claude Code? Did you ever have to steer Claude away from patterns that hurt performance?..
  2. Workflow: The "builder briefs plus blind critic" loop sounds like that is your secret. Mind blown... What did a typical iteration look like, and where did Claude struggle most? Shader debugging and visual tuning seem like they'd be hard to do without eyes on the output...
  3. Path tracer on Metal: wgpu doesn't expose hardware ray tracing everywhere yet. How are you handling the hybrid RT shadows and the full path tracer across Metal and Vulkan/DX12? Is it hardware RT on both, or a compute-based fallback? And which denoiser are you using?
  4. MCP: With 439 parameters exposed, have you tried letting Claude tune a scene from a reference photo or a text prompt alone? I'd love to hear how well that works in practice....
  5. Open source: I'm guessing the full engine isn't going to be open sourced or shared here or anywhere else, but would you consider releasing an earlier snapshot? My daughters have always wanted me to make them a mermaid game, (their mother as well lol,) where they could explore hte ocean, and an older version of this would be an amazing starting point. It would be strictly for personal use, and I'd be happy to follow any license terms you set. Even a source-available or non-commercial license would be fantastic... oh and my son loves "The Meg" movies and sharks generally... definitely would like to build something hyper realistic and ocean based, whether I build a game or a simulator, it would be their dream come true... and my job and other responsibilities don't give me much free time to work too much on projects these days, maybe if it's mindless vibe coding I can squeeze out a small project or two, but I can't make a commitment to something this ambitious at this moment. Oh and my father was a professional deep sea diver as well, believe it or not, still have every Jacques Cousteau book, and I've done many dives as a homage to him... So it would be my personal dream as well to build something like this...

Thanks for sharing this, and keep going. Can't wait to see the great white video dude!

2

u/ForgotTheSnare Oct 07 '26

Thank you for your reaction! So glad you like what you've seen. It's just the beginning, I have plenty I am planning to implement. As for your questions

  1. I made it a mission to aim for as high performance an engine as possible, everything is budgeted to aim for 60fps at 1080p at the very least, depending on the complexity on the scene and the hardware of course. A mac mini M6 24gb/512gb is used for testing metal and an RTX 3070 for most of the building/testing. Now I'm not an expert graphics programmer, not even vaguely, so a lot has been throwing Fable at the research. Every now and then I will look at optimisations, but again it's just a convo between me Fable/Opus 5.5 depending on the nature of what is being built. The key reason why I'm not entirely obsessing with this is because I know that *by definition* I will get better models released and then I can do further passes. So when Fable 5.5 is released, I might spend the whole weekly tokens on research/planning and get it to use Opus 5.5. or Sonnet 5.5 for implemented what was decide. I can get the whole codebase refactored if I need (I say this because it's important for question 5).
  2. This isn't really my idea, this is downstream of me playing with Matt Shumer's Gauntlet Loop idea. I think it worked well for this project, particularly when using underwater photograph references so as to get a certain look. Often I will get involved and test and feedback my own observations.
  3. So the technical breakdown is (disclaimer: compiled by Claude so I can be as precise as possible, you've got to understand a lot of the detail isn't something I have in my head)
    The engine renders through wgpu with WGSL shaders, so the same code runs on Metal (Apple Silicon, macOS 15+) and on Vulkan (RTX 3070). It has three modes. Performance is plain raster with shadow maps and runs on any GPU. Hybrid adds sun shadows via wgpu's experimental ray query to the raster frame, using a static acceleration structure for the reef and a small dynamic one for animals. Path traced renders the whole frame live at a few samples per pixel, using the same path as the offline tracer. Hybrid and Path traced both need hardware ray query, which is VK_KHR_ray_query on the 3070 and Metal ray query on the Mac. There is no compute fallback: a GPU without ray query simply stays in Performance. The live path tracer denoises with a custom WGSL filter, and a paused frame keeps accumulating samples. Offline plates and movies are denoised with Intel Open Image Denoise, loaded at runtime and never linked into the engine. It runs on CUDA or CPU on Windows and on the GPU through Metal on Apple Silicon.
  4. It is most certainly something I will experiment more with. This was entirely the idea, to get Claude to use a reference picture and change the scene at runtime. Or to try and recreate some specific environments, particularly for simulation. And to see where that leads.
  5. The Open Source question is a good question. For now I am at the hobbyist Tech Demo stage. Before I can even contemplate opening it there are a lot of things to go through and my attention then shifts to something entirely different: recreate the code base in a way that can actually be augmented by both human and agents, a discord server, documentation, comms etc. The problem I see is that it may make no sense to Open Source it from a code point of view, if at any point in time I throw a new model to refactor/rewrite/enhance whole chunks of the codebase. Having to support an engine means making sure you maintain multiple versions etc and I have to really decide where my attention needs to go: fast paced innovation or an actual product. And at this point I am undecided. A lot will depend on this project's reception and how buried it is among the daily AI flex going on everywhere.

As a final note I am thrilled that this project resonates with you. I can't promise anything for now. But if at any stage something is ready to be "alpha tested" it's great to know some are very interested to get their hands on this.

Thank you for your feedback, I hope this helps!

1

u/MatlowAI Oct 12 '26

Consider opening it up even with support concerns. Think of all the tokens the world will save not reinventing interference patterns and scattering effects.

4

u/janaxhell Oct 03 '26

Very cool, the only thing I feel a bit off is the jerky speed of movements. Underwater everything is fluid. If you smooth that, it's perfect.

3

u/ForgotTheSnare Oct 03 '26

100%. The reason why I wanted to initially show the camera as just a scene navigation (wasd and mouse look) is because I wanted to show this was all obviously realtime.

But definitely will be implementing a gameplay camera.

3

u/3iverson Oct 03 '26

Wow, the underwater look and lighting is fantastic! Can’t wait to see where this goes-

5

u/ForgotTheSnare Oct 03 '26

The Great White Shark behavioural system is next on my list to showcase, in open water it is truly terrifying. But it’s not quite ready and I want it to be just right.

3

u/3iverson Oct 03 '26

That sounds awesome!
What are your long term plans for this?
Full game or interactive environment/ simulation, general engine for other developers, etc.? Open/ closed source?

3

u/ForgotTheSnare Oct 03 '26

Thank you for your interest! I'm undecided for a number of reasons, it's such an experimental phase that can drive the project in many directions. Right now I want to concentrate on the underwater and sea life simulation, I think if I can get this right I might find a game there that must be made, whether it being an ecosystem simulator or something else. I am particularly interested in shark behaviour and finding emergent gameplays around them.

But the engine foundation I think can be used for other types that I am also wanting to pursue. The initial prototype was a space megastructure builder sim. See video.

The question of the engine fate eg proprietary or open source is an interesting question actually because given the engine was written purely by Claude agents, I don't even know if it makes sense to have many human contributors to it in the traditional open source way.

But I think it raises an interesting question around distributed open source done by agents only because let's face it I will be limited by my max 20 subscription so there is only so much throughput that can go through me alone.

3

u/MeanCreme201 Oct 04 '26

The open/closed source question isn't just about contributing, it's also about how willing you are to let other developers read it, learn from it, fork it, monetize it, etc. There are licenses that can cater to any of these.

2

u/ForgotTheSnare Oct 04 '26

Yes very true. Right now I'm assessing how much interest this project generates. It's so early stage but I always want to remain open minded about the direction of travel. That's why I am wanting feedback in terms of how it looks and what potential others may see that I don't.

2

u/BangEnergyFTW Oct 05 '26

At this point, if LLMs keep advancing, there is no reason not to just have everything open source. Otherwise, people can and will just have their 20x account set on reverse engineer. Open it up and let's cook.

2

u/ForgotTheSnare Oct 04 '26

There are tons of parameters and you can change the water profile see example

2

u/Briskfall Oct 03 '26

> 0 asset file

> all procedural

Woah, you got my attention...! 😳

Jesus, and cross-platform?! 🤯

(I have many, many questions but... this one's the one I'm the most curious about at the moment...)

How does it run on less powerful machines, if you don't mind me asking?

(Definitely gonna follow this thread... 👀)

3

u/ForgotTheSnare Oct 04 '26

Thank you for your interest!

In terms of procedural, I want to clarify what I mean. Basically all the systems are code oriented, so it's not like a traditional pipeline where say an artist (or myself) creates a model/animation in Blender and imports into the engine, or even how Claude can use Blender MCP. Same with audio, the audio is generated by code (but that in a way is like creating a VST instrument and scripting it)

Code snippet to make the point for how part of the shark is built in code:

fin(sagittal(&fins.first_dorsal, 0.35), spec.major_span, part::
FIRST_DORSAL
);
fin(sagittal(&fins.caudal, 0.3), spec.caudal_span, part::
CAUDAL
);
for side in [1.0_f32, -1.0] {
    fin(
        paired(&fins.pectoral, fins.pectoral_root, fins.pectoral_anhedral, side, 0.08),
        spec.major_span,
        part::
PECTORAL
,
    );
}
fin(sagittal(&fins.second_dorsal, 0.35), spec.minor_span, part::
SECOND_DORSAL
);

This was an intentional design decision, because I wanted to see how far LLMs can help in that department. I took the view that with the rapid improvement of LLMs, the engine would self improve every cycle, and the modelling too. Now it may be that at some point it needs some finer human in the loop modelling/topology clean up, but I think it would go against the approach. Partly because any number can be parameterised and exposed via MCP and I think that could be an interesting emergent way of modelling (think of it as akin to a Shark Blender plugin you load in Blender where you have lots of sliders and it builds the mesh for you accordingly, it's kind of the same principle but directly in engine).

This is why the movement of sharks can look so natural, I don't have to manually animate them!

I asked Claude to summarise in a couple sentences:

"The sharks have no keyframes or armature: each one follows a path that is a formula of time, and a shader bends the straight, code-generated mesh every frame with a travelling wave down the spine, like a Curve modifier driven by a sine. The great white adds a rig of fixed hinges and driven shape keys (jaws, eyes, gills, fins, neck), posed by a small behaviour state machine instead of an action library, so you tune dials rather than pose."

As for your question on performance on older machines, ultimately the ceiling is going to be CPU and GPU. With all the various systems in place, throwing too many fish schools, corals and sharks at a scene will have an impact. And the only way to know is to test on said machines. But if a game comes out of it and it's not just dying as a tech demo, I would expect it to have a minimum system requirement, like any other 3D game.

I always wanted it to be a highly optimised performant engine. That's one of the fundamental design principles. Whether it is "World of Warcraft runs on any older PC" level that I can't really say yet. But every feature put in it has to account for the FPS budget. Therefore every millisecond for each frame counts!

I hope that helped answer some of your questions.

2

u/blitzkr1eg Oct 04 '26

Very nice looking engine, and very cool approach.

you said
> challenge to not write a single line of code
also
> I wanted to be able to read the code and understand any part of the systems if I needed to

My questions, if you want to answer:

  1. How do you steer/review the agent's output, meaning how code is organised, if at all. Do you make the agent output diagrams?
  2. How do you decide on a technical solution ? So a lot of code is procedural, did you prompt the agent with specific data structures/algos/strategies to use or, or was it a brainstorm/collaboration, or did you let the agent fully decide on the implementation?
  3. Whats the role of the MCP? Why use it if agents can browse the code and understand it already in full? (i dont have experience with game engines)

Thanks!

3

u/ForgotTheSnare Oct 04 '26

Great questions! I tend to be long-winded, so forgive my long answers but your questions deserved them.

  1. So it starts with general principles in the initial scaffolding phase where md files are created to lock key decisions: dry principle, all code needs testing, plugin architecture for the sub systems so that specific game logic and low level systems are decoupled, use of crates for sub systems. So I spent a bit of time on that as an investigation phase and all with Claude btw. Strangely I’ve not over-obsessed about it after that. I say strangely because I have very bad OCD when it comes to code structure and code elegance. I look at the high level structure and have a peak at some code files every now and then but it’s so moot because at any point in time I can get an agent to do a refactoring pass. This is partly why I’m reluctant to release on GitHub. Like does it make sense to look at some code where the structure can be rewritten at any point in time depending on what the project priorities are? And I think that’s probably what is at the core of what is changing with agentic engineering. Also I’m not really a Rust programmer. And while I think the language and toolset is really interesting I want to concentrate on the high level direction and vision, not all the minor detail. The FPS is too low? Ok we dive in with an agent and we fix the code/approach and we optimise accordingly. When a phase is finished and I’ve done some manual testing I just approve the PR and merge. I do some adversarial agent reviews from time to time. But I’m so focused on the features that I am a lot more relaxed about code than I normally would be. Is it vibe coding or still engineering but shifting the attention layer? Who’s to say.
  2. a lot is done via research agents first. If there is a specific technical subsystem to create or improve I just throw Fable at it (less so now with Opus 5.5) and have a convo until we settle on a solution or approach. Now this is the bit that is interesting because the last thing I want is to be accused of code plagiarism and that’s obviously something with LLMs that is a general legitimate concern anyway. So I instruct and it’s in md files that all research and code we want to create needs to be oked from a prior art point of view. I can’t do anything about a trained LLM, but at least I can try and induce that philosophy within the agent workflow I put in place. I wanted to be very specific on that front. It’s not like I am setting agents free on the unreal engine 5 codebase and tell them to convert some techniques into the engine stack. I would 100% not do that. I have very specific instructions to agents that none of that happens.
  3. So the MCP comes into play for various use cases: I can have a blind agent that does not know about the source code and yet can try and use the tools to modify a scene against a runtime instance, instead of at compile/build time. This could help with token costs (does not have to read the whole code or parts of the code) when experimenting with level design. Or this could for instance be for a tester agent that plays the game and can feedback the experience and help judge gaps and issues from a gameplay point of view before I even get humans to playtest it. I did that with the space multi structure build sim to try and it was actually quite interesting what came out of a Claude session playing the game and responding where it got engaged and when it got bored on the curve. I mean I know this is quite a controversial approach but I had to try. The other use case is that depending on the game if I ever released anything, users could plug their own harness against their game instance and maybe have it do interesting things and create emergent gameplays. But of course there is a legitimate security risk here. People might not want to ok the use of an MCP server they can’t see the code from a random stranger and quite frankly they shouldn’t. So I’m still unsure about that use case.

Thanks for your interest!

3

u/blitzkr1eg Oct 04 '26

Thanks for the responses! Good luck!

2

u/anon999387 Oct 10 '26

Commenting so I remember to keep an eye on this cool project

8

u/vladoportos Oct 03 '26

Not gonna lie, looks quite good.

7

u/Playful_Eye_661 Oct 03 '26

Very nice. Impressive 

9

u/GoldshireDancer Oct 04 '26

Now let's see Paul Allen's underwater 3d engine

5

u/Tycoon33 Oct 03 '26

Looks like subnautica

10

u/3iverson Oct 03 '26 edited Oct 03 '26

The water/ lighting effects are noticeably better I think.

5

u/ElSupaToto Oct 03 '26

I was thinking last night... We need an Echo the Dolphin follow-up

1

u/DicmanCocktoasten 6d ago

Is it open source ?

1

u/ForgotTheSnare 5d ago

No I am not intending to open source it. It’s agentically written so I can refactor at any point in time. I don’t think there is value with another open source engine that needs to be maintained and supported, given the engine ecosystem. And I want to target the engine to specifically the games I want to create. For now.

1

u/Savings_Cloud5486 Oct 04 '26

cool, can we have demo of above the sea level ?

1

u/ForgotTheSnare Oct 04 '26

There is no above sea level at this stage, and purposely, because I am concentrating on the performance to all be underwater. However I am also working on an external outdoor scene for a completely unrelated look. I will post more when I have something to show!

3

u/Psychological_Can_25 Oct 04 '26

Can't wait for it to go live so I can check it out myself!

2

u/Emotional_Opening364 Oct 09 '26

This is seriously impressive. An underwater engine in Rust+wgpu is already a lot, and doing it with zero asset files makes it even better. Everything being procedural is the part that gets me. Great work!

2

u/BecomingCoder Oct 10 '26

This looks great

2

u/Livid_Shallot5701 Oct 12 '26

i love it. eberything made with claude these days is just looking ridiculously good. 27 will be a heaven for gamers and scary for game devs. i predict the panic of big companies will skyrocket and the layoffs just lead to MORE indie devs. great to be alive and gaming

0

u/Excellent-Basket-825 Oct 03 '26

😍,  Explain to me like the idiot i am why rust. Everybody keeps yapping about it.

1

u/ForgotTheSnare Oct 04 '26

If I were to simplify the argument for Rust, it is that you get both the speed of C++ (within an acceptable margin, and there are use cases where the Rust compiler can do further optimisations compared to C++ but that is an occasional win as I understand) and memory safety (the compiler forces you to solve some problems that are often very difficult to code/troubleshoot traditionally particularly in multithreaded/multicore applications).

This was important to me (I am not a day to day Rust programmer, I am more a Kotlin programmer by trade) because I wanted to be able to read the code and understand any part of the systems if I needed to, without having to be a complete C++ expert.

The Rust tooling has a nice approach to modularity via Crates. I always wanted the engine to be highly modularised. I'm a Software Engineer and so I just did not want the resulting code structure to be a big bag of mess.

But Rust is only part of the equation. A non negligible portion of the code is actually shader code that is executed on the GPU (about 10% of the code).

Hope this helps, thank you for your interest!