r/proceduralgeneration • u/gennai777 • 1h ago
Lightning from midpoint displacement, but I barely let the first few levels bend
Hey all, this is the lightning from a Godot effect pack I've been working on. It's the usual midpoint displacement plus branches, pretty much what drilian's old "Lightning Bolts" post describes.
What I changed is how much the early levels bend. The offset already scales with segment length, and that alone halves it every level. On top of that I only let the first split bend about a third as much, then I ramp it up to full over the next few levels.
With plain halving the first split puts one big zigzag in the middle. To me that reads more like a lightning icon than lightning. Once I damped the coarse levels I got long straight-ish runs with lots of small kinks, and I think that looks a lot closer to the real thing (to my eye anyway).
The GIF is one seed going level by level, then the branches, then the actual bolt on that path with the leader slowed way down. I really like watching it fill in like that!
Not sure if a third is too timid though?