Falling Sand simulation written from scratch in a compute shader with HLSL. All of the simulation logic and character animation occurs on the GPU. A C# script handles user input and passes that data to the compute shader. When not running a screen recorder and with an uncapped framerate, this simulation achieves 200+ fps on a 1024x1024 pixel canvas while running 8 simulation steps per frame. The canvas is not split into chunks and no "dirty rectangles" are used--the entire canvas is evaluated at each simulation step.
Currently implemented features:
-Sand (falls down, forms 45° piles)
-Gravel (falls down, forms steeper piles)
-Water (falls down, flows to fill a container, low viscosity)
-Lava (falls down, flows to fill a container, high viscosity)
-Character (movement, gravity, animation, pixel-level collision at feet, rail gun for destroying terrain)
-Permanent material "staining" seen in the character rail gun demo
TODO:
-More physical materials (gasses that "fall" up, tunnel-able solids that aren't just static like the gray stone in the demo)
-More material interactions
-Sound effects
-Better character collision (not just checking collision at feet)
-Everything else
Character sprite downloaded from https://pixramen.itch.io/2d-action-pl...