I think I’ve found my happy place. GPU compute shaders.
I started by porting my Cratered planet generator from Unity/C# to Godot/GDScript. It “worked,” but chunk management and collision mesh generation were huge bottlenecks.

Then I stumbled on this video by Aria. BOOM! Mind blown: if the GPU can raymarch everything, why am I still trying to generate meshes on the CPU? Bye bye Chunks. The GPU can store a whole planet density texture easily!
The Density Field
Everything begins with a signed distance field (SDF): a 3D texture of density values. I fill it on the GPU. First a sphere, then I carve it with layered Simplex/FBM noise. That gives me a nice, editable planet in a single volume.
Rendering
Godot’s material shaders can’t (yet) sample my compute-generated 3D texture directly, so I use a custom RenderingDevice pipeline and a GLSL fullscreen shader to raymarch the SDF. Right now I do two passes into a SubViewport:
- Sky/atmosphere (Rayleigh/Mie-ish gradient + sun disk + stars)
- Terrain (SDF raymarcher with slope-aware color, AO, and shadows)
The result lands in a TextureRect scaled to fullscreen.

Post Process
On top of that, I run my old C64 color mapping post process to stylize the output (same shader as before). You can find it here:
Why this approach?
Because it’s ridiculously fast to operate on the SDF in compute. “IsGrounded” is no longer a boolean—it’s a continuous relationship to density. Planets can be jelly, vapor, mud, or something in between. The player can push against the field, displace it, or sculpt it, the way water shaders have been doing for years.
And because it’s all one volume, global effects are trivial: shockwaves that ripple the entire world, a death ray boring a tunnel through the core, pulsating suns, living terrain. All possible in real time without CPU meshes.
Next steps
- Better atmosphere: denser multi-scatter look without tanking performance. Reduce banding.
- Toon outlines: proper edge detection over our custom pipeline. I still want the Cratered toon shaded look.
- More brushes: Currently only add/subtract/flatten.
- “Soft physics”: player movement that reacts to density (gas, liquid, soft solids) instead of rigid collisions.
- Clouds. Real ones in another SDF.
- Oceans. Again adding another SDF but I still not sure how I can get it to interact with the terrain. Flood filling maybe?
I don’t love all of it. Debugging glsl-shaders is a huge pain (Godot just says they wont compile) The home-brew physics isn’t perfect and needs a lot of work (although for this game it doesn’t have to be perfect). There’s not a lot of game play yet and I use this more for learning than expecting a complete game to come out of it (at least for now). Time will tell if this turns into Cratered 2!

