Using Compute Shaders for MASSIVE City Simulation

Опубликовано: 31 Март 2026
на канале: Biped Potato
11,964
604

#gamedev #shaders #wgsl

It is often difficult for developers to optimally go about simulating large numbers of entities within a crowd setting because of the computational limitations of the CPU. In this video, I decided to go a bit crazy with what Compute Shaders can be made to do and create a huge city simulation that resides completely on the GPU using Compute Shaders. For this project, I decided on using the Bevy Game Engine with the Rust Programming Language just because I probably wouldn't be making full games with pure OpenGL and C++, so I wanted to test the application of Compute Shaders in more of a real development setting for ME personally. This video explains the entire process I took to create a Hardware-Accelerated GPU City Simulation from first creating a Animated Mesh2D Instancing Render Pipeline with Bevy's Low Level Render Pipeline, to implementing Spatial Partitioning using the Bitonic-Merge-Sort algorithm on the GPU with Compute Shaders, to using a single quad to render the entire city as a glorified custom Tile-Map Renderer written inside of a fragment shader, to finally writing Citizen Pathfinding Logic inside of a large road Tile-Map. The video also goes over optimizations such as slow fixed timesteps with physics interpolation to create the illusion of high framerate when the physics timestep of the simulation is very discretely slow. It's important to keep in mind however that this video does skim over many important details of algorithms or implementations which are able to be seen more clearly either through the source code of the project or through explanations in the original video on creating a battle simulation with the GPU and Compute Shaders. Both of these resources are linked below in the Links section of the description and I welcome all viewers to take a look at them.

Using Compute Shaders for MASSIVE City Simulation

Join my Discord!
  / discord  

Links
Source Code: https://github.com/Biped-Potato/bevy_...
First Compute Shader Video:    • Using Compute Shaders to Simulate HUGE Armies  

Timestamps
0:00 - Intro
1:01 - Animated Mesh2D Instancing Render Pipeline
3:20 - Physics & Grid-Based Spatial Partitioning
5:24 - Procedural City Generation
6:25 - City Rendering Optimizations
7:49 - Citizen Behavior & Compute Shader Logic
9:59 - Final Polish
10:23 - Outro

Music Used
Marshmellow - Lukrembo
Link :    • lukrembo - marshmallow  
Biscuit - Lukrembo
Link :    • lukrembo - biscuit  
Onion - Lukrembo
Link:    • lukrembo - onion  
Better Days - LAKEY INSPIRED
Link :    • LAKEY INSPIRED - Better Days  
Licensed under Creative Commons: By Attribution 3.0 License
http://creativecommons.org/licenses/b...
The Legend of Zelda: Wind Waker - Outset Island