Need help with Luos lightning bolts! zap zap

Hi all! It’s me - the forum scrub.

I’m quite new to fx and UE4, but I’ve been racking my brains over something for a week, but I’m a bit stuck and needed some help, if you please :slight_smile: I’ve been following this amazing lightning tutorial for making a material by this Yoeri -Luos- Vleer guy (I think he’s around here somewhere)

I’ve got the material working great, but what I can’t seem to get working is having the material do a “zap zap!” in a lightning bolt fashion. I’ve searched through a bunch of tutorials, but my node graph just seems to end up as a mess of panners and lerp-a derps. Did anyone have any suggestions, or could point me in the right direction please? Thanks in advance!

Could you clarify what you’re trying to achieve?

You want your lightning bolt to flash in an out like it does in the real world?

Yes thats correct. Like a lightning bolt. And then I was going to add a shockwave and such later

Could you copy your graph and paste it into here so I can take a look?

Thanks for your help Kanoba - much appreciated

Gimme a minute to just put something together

Try this its a quick simple fix but ideally you dont want IF statements in your materials because of the way your GPU handles them it should be fine for what your doing. also theres probably a better way to do this, this is just the first way I remembered how to do it haha il try quickly throw together another one put it into a multiply where ive marked I think should work let me know how that goes.

Or something like this will give more of a random flash effect but has no fade to it like the first one, just make sure you set the periods on the sine’s to random values

Thanks Kanoba, these have me heading in the right direction! I guess the proper way to do this would be to have it flash on-click right?. I will keep trying :slight_smile:

You’ll need to do that in blueprints then.

here are some things you can play around with.
You could add/modify the flicker so it also affects the amount of emissiveness of the lightning.

if you want it on a button press either use blueprints, or set up the lightning in cascade the way you want it, and have a blueprint spawn the emitter once on keypress.

2 Likes

The “flashes” seen in lightning are for a few reasons depending on how the bolts are created, their charge, location, etc. For this situation (where a bolt is formed from the lower canopy of a cloud to a surface on / near the ground), these “flickers” are caused by Return Strokes.

Cloud-to-ground lightning strikes often contain repeated discharges down the same path in rapid succession following the first return stroke. These secondary return strokes often make a lightning strike seem to ‘pulse’ or ‘flicker’ on and off. - wiki

You can build return stoke functions into a shader, mesh behavior, etc.
Here is a quick example of a possible return stroke - I built these in Desmos if interested

When the value jumps to a high point, it is the genesis of a return stroke that then ramps off based on a static representation of energy.

In these equations ( x ) is your time value:

Isolated Breakdown:



2 Likes

Thank you both! @jbaldwin you look like a smart cookie :stuck_out_tongue:

Hey everyone! First let me thank you for the post! I have learned so much from the Video. It was really the first more complex Material I created. So after messing around a bit, I found two functions that you might add to the Material. I think they can create cool and useful effects, but I am rather new to vf so take my advice with caution.

The first one is just multipied with the opacity and can help with a smooth look, when the Texture is put on a mesh. (Helped me on a sphere Mesh)
The Component mask node (R or G) changes the direction and the Parameter drives the strength.

Outline_Material_demo

The second one is a bit more fancy. You can multiply the effect to create all kind of cool stuff. I used it to create a sphere only using the Texture.

Multiplyer_Material_demo

These blow my mind but like i said, I am quite new to all this. :wink:
I would love to hear your thoughts! Thank you all again this forum taught me so much already!

1 Like