GLSL Compute Thunder

Hey everyone,

I’ve been working on a lightning simulation system using GLSL compute shaders in TouchDesigner. It’s a setup i did in vex some times ago and wanted to try it within touchdesigner. it runs quite below 1ms with here 64 lightning with 64 branches each with 256pts per branch max after vertex shader. I’ll share a .toe soon enough when i’ll figured more stuff out to make it more flexible ( like easy sourcing and targeting and better control over shaping ). I’m using 3D texture to store branches in this first example.


TouchDesigner_mt8husg2Eo

But i also did another version that computes only the heads direction and uses 3D texture to trail the results, allowing for dynamic lightning evolving (later on surface and stuff), and allow also for much more lightnings, but i find it harder to to make it fill like actual electricity

TouchDesigner_NINMV08ZzM

4 Likes

You may want to check out the experimental build with GLSL POPs for something like this. Could be a much nicer and faster workflow.

1 Like

I’ve been looking forward for pops since waiting the 2024 version, but i had to start this for a commercial project so couldn’t wait for a surprise release of the experimental 2025 build.

Indeed pops will help as i can generate geometry and attributes in one pass instead of needing multiple buffer and a geometry vertex shader.
I’ll will make the try, the one thing i’m wondering performance wise is in my case i’m instancing a on each branch and wonders how POPS will handle that many polygons once sweeped.

Any info on when the official build is expected to launch ? If it’s in a month i’ll jump into POPs for sure but otherwise i’ll prefer to stay in a more stable build.

It will be longer than that until 2025.30000 goes Official, so yes you’ll want to stay with your current workflow for now then