How I build Willcaster's effects on the GPU (no asset packs)
I'm coding Willcaster on my own renderer, on top of an engine called Bevy. (If the only game engines you have heard of are Unreal and Unity, that is completely normal. Bevy is a young open source one and the reason I picked it is that I can get all the way down into the graphics and write it myself.) Somewhere along the way I got a little obsessed with one question: how do you actually make an effect in a game? Fire is the easiest one to show, so I will start there, but the same trick is what every spell in the game is built on.
Way one: draw it in the pixels
The brazier flame you see in Willcaster right now is a little "raymarch" I code. For every pixel the fire covers, the shader climbs an imaginary column of flame and samples some noise to decide how thick the fire is at that spot. It is my own code, it has its own tricks, and I am fond of how it looks.
But the catch is hiding in that phrase, "every pixel". Walk the camera closer, the fire fills more of the screen, and it costs more to draw, even though nothing about the fire changed. You pay for it by the pixel.
Way two: grow it as real geometry
The other way which is highly technical, the one I kept chasing, is to build the fire out of real mesh, live, while you play. The graphics card grows the actual bent shape of every flame, every frame. It is a real object standing in the world, not something drawn onto the screen. You have already seen this if you have dropped a wall of flame in a fight, those flames are geometry. Here is the same brazier both ways

The brazier, both ways. Left, the raymarch flame that ships, drawn in the pixels. Right, the same fire grown as real mesh on the GPU.
I will not pretend the geometry one is prettier. Both are my own code, both have their own tricks and aesthetics, and the raymarch on the left holds up fine, and unless something changes, you will see that in the game. They are just two different machines under the hood. What the geometry version buys me is real shape, proper shading like any solid object, and a cost that does not climb when the camera pushes in.
The engine behind the spells
The real reason I care is that none of this is really about fire. Once you can grow one thing as live geometry, you can grow anything, and that is exactly how the spells work. a spell that gathers and thrusts across the board and pierces a line of enemies, the chain lightning that forks and jumps between them, the void that collapses in on itself: each one is a combination of these geometry pieces with a bit of shading on top. The GPU geometry is the main character. The spells are what I build out of it.

And because it is all just geometry and shading, I sometimes get a whole new spell almost for free. Take the wall of flame, shade it as a solid material instead of fire, and it turns into a wall of glowing obsidian blades. Same geometry underneath, a few different lines of code on top. That one is a future spell I have not finished yet.
The same flame wall geometry, lit as solid material instead of fire. A different spell hiding inside the same code.
This is a look under the hood, not a finished gallery. The spells keep changing and I keep adding new ones, so do not treat any single frame here as final.
For the curious (skip this if code/math is not your thing)
No hard feelings if shaders and math make your eyes glaze over, jump to the end. If you do like that stuff, I have been writing about this kind of low-level rendering for a while now, so there is more to dig into.
- The fire, written up in detail: https://altunenes.github.io/posts/flame/ (the compute shaders, the geometry, and the parts I got wrong the first few times)
- The grass math, as a toy you can poke at live in your browser:
https://www.shadertoy.com/view/7fSSRc (that one draws every blade the slow per pixel way so you can see the shape being built, my take on the Ghost of Tsushima grass technique. The real version in the game (already online in the Willcaster) runs the fast way and is orders of magnitude cheaper. But I also tried to explain how the system works here using the code.)
More soon. Thanks for reading.
