Hello, i am looking for some help with a task, i want to create a lightning strike with a dynamic beam, i already have the main beam (Main Lightning strike) but i would like some beam strikes to branch off from the main strike, could any one help me,
Hi, I have experimented with lightning strikes before and to be honest, I would suggets to use a simpler approach by either using textures or either something a bit more complex by using prebaked data in combination with Houdini.
I made a VFX in the past that would cast lightning strikes from a houdini point data file and even the smaller arcs would rotate independently in niagara based on the direction of the main branch, because I was storing a whole bunch of values in that file which allowed me to have full control. But I think that this is overkill even though sometimes your client or lead/director will want you to make a solution that is as dynamic as possible and then you have no choice but to come with some crazy solution. The project I worked was with Lumen and Nanite and the rendering AA limitations are not favorable for lightning strikes.
I would suggest not going too RnD heavy and rather sticking to something that works such as textures, although it also can carry disadvantages such as sprite scaling based on cloud height because say you have low or super high hanging clouds you can imagine the sprite size might affect the scale of your textures too much even though I honestly would just create another set of textures and call it resolved.
But if you want your lightning strikes to appear near to the player and want to give them volume, then I would maybe go with a ribbon or that in combination with a niagara point data approach.
As you can tell with the Niagara labs ROP you can technically store as many values as you want into a JSON file but it can affect your performance. I had occasional crashes from just working with these files so yeah it’s tricky to work with unless you really know what you’re doing.
You can also try to just build some logic from scrap with Niagara scripting but I found that the speed of light is so fast that the emitter tick can’t even match that speed tot that what the eye can capture visually, so that’s why I choce the prebaked point data approach and then mainly relying on the shader to transition the lightning strike because a material will update faster.
And to be really honest instead of using the JSON approach you could also just sweep your generated curve from Houdini and then export that as a mesh. Although then you have the problem with ribbons that don’t face the camera because you baked them as meshes but that can also be resolved with WPO logic by storing the rotation pivot into the vertex color and mapped to the object bounds. Here a proof that it can work https://www.youtube.com/watch?v=ATmIK8KkVog
In short:
-
if you’re seeking a quick and dirty solution I would advice you to grab some lightning strikes from the internet and build a bunch of textures from them or to just use after effects it has a great generator as well and then be done with it.
-
Or use niagara with some noise. And imo i would try to run everything on the gpu in 1 single emitter, use a burst instead of a spawn rate and you can calculate the sub branches as new ribbons with unique ribbon IDs with a custom “generate ID” module that processes the particle IDs into different groups and set their position based on the sampled noise for the main branch and read values to position sub branches although it will require a bunch of calculations which might get complex too soon if you’re not confident with Niagara scripting.
-
Go with a prebaked mesh or JSON approach if you seek precision.
There are many approaches so I also suggest to experiment by yourself, I hope that helps
Thx so much, yh my lead said the same, i went with mesh rought