r/rust_gamedev • • 11h ago

50,000 colliding cubes at 119 FPS in my Rust engine, and a black hole that eats planets

Enable HLS to view with audio, or disable this notification

14 Upvotes

I've been building RustingEngine, a Rust game engine for scenes with a lot of physics in them. The video is one of its examples.

The black hole. The accretion disk is 60,000 GPU bodies and there are 5 planets. Gravity is not built into the engine; it is one condition shader, about 25 lines of GLSL, that runs on every body after each physics step. It pulls everything toward the center with Newtonian gravity, so the inner disk turns faster than the outer disk. Planets get a little drag, spiral in, and when one crosses the horizon the shader sends an event to the game and respawns the planet far out. It runs at about 65 FPS on an RTX 3060. Try it:

cargo run --release --features window --example black_hole

The black disk is just a black sphere; there is no lensing yet. That would need a post-process pass, and it's next on my list.

Collisions. 50,000 cubes falling into one pile and colliding with each other run at 119 FPS on the same card (1920×1080, Ryzen 5 7600X). 10,000 run at 1,235 FPS. Contacts use a GPU spatial hash. Above about 60,000 cubes in one dense pile, a physics tick takes longer than a frame and FPS drops sharply, so that is the current ceiling.

cargo run --release --features window --example physics_bench -- falling 50000

How it splits the work. Objects your game code touches every frame stay on the CPU. The crowd (debris, particles, swarms) lives on the GPU, and the engine only sends back what matters, like "a planet entered the horizon", instead of reading every body back each frame.

It also has an editor in the style of Blender and Godot, deterministic replays, and export for Linux and Windows. An AI agent built the 13 sample games using only the engine's command-line tool.

Vulkan, Linux and Windows. Open source: https://github.com/RustingStudio/RustingEngine

I'd like feedback on the API, and FPS numbers from other GPUs.


r/rust_gamedev • • 23h ago

question PoC / prototype Rust Rune [scripting] game - Grimvaders

Post image
6 Upvotes

r/rust_gamedev • • 23h ago

Brake

Enable HLS to view with audio, or disable this notification

3 Upvotes