r/rust_gamedev • u/FireflySaga • 14h ago
Getting our Bevy roguelite to 60 fps on the Steam Deck: shadow stand-ins, bindless materials, render scale
Firefly is a co-op action roguelite we're building in Rust with Bevy 0.20. Its one moving light is the firefly, and that light casts shadows off every tile of the map. On the Steam Deck our benchmark fight was nowhere near 60 fps, so this week went into fixing that.
What got the benchmark fight to hold 60 on the Deck:
- Shadow casters are simple stand-in shapes instead of the detailed tile meshes, in all three areas (marsh, crypt, citadel).
- Tile tops no longer cast the firefly's shadows.
- Our dark materials and effects moved to bindless rendering, which cuts a lot of the per-draw cost.
- The world can render at a lower resolution than the screen and get scaled up.
- A build script merges map tiles, drops the ones that are never visible, and simplifies the animated tile meshes.
- The moon's shadows only cover what's in view, so their detail goes where you're looking.
The part I'd recommend to anyone targeting the Deck is the test loop. The game has a benchmark mode that plays the same fight every time, times it and quits. A script builds the game, copies it to the Deck and runs it there, so every change is measured on the real hardware. The rollback netcode helps here, since the game already has to play the same way every time.
The options menu now has graphics presets, one of them made for the Deck. Happy to go into any of these. Steam page in the comments.