How to do a realistic lightning effect?

Hello everyone,

I try to make with UE4 effect like this:

https://lh6.googleusercontent.com/-6Oren4nhSXg/U95htMPcyrI/AAAAAAAAARg/3E4MHxejUEE/w964-h542-no/Storm%2BHiccup%2B2.png

my actual result:

Does anyone have an idea how to reach this result? I’m actually using the beam data for my lightning, maybe i could use a lightning material and use a different particle data… But as for now I would like to reach my goal with the beam data cause I already programmed everything with the beam data already!

Thank you in advance!

Greetings pompeiic!

Hey pompeiic -

Have you tried messing around with the Taper effect in the Beam Module to allow your lightening to reduce in size as it goes toward your target? Adjusting the Taper via a Uniform Curve would allow you to get a variation in thickness as the lightening goes through its life. Also try to adjust your noise frequency to increase the sporadic nature of the lightening.

Hopefully that will get you started out

Eric Ketchum

Thank you for the quick response Eric Ketchum,

I’ve tried out the Taper effect and played a little bit around with it but I didn’t really get the result what I want actually. The noise frequency tool is also quite not that what I’m looking for. If I increase the number the lightning gets too ‘round’ and reducing it makes the lightning just like a beam… Is there no different way to do it? But anyway thanks so far!

-pompeiic

Hey pompeiic -

Here is my favorite way of generating lightening. This is based on a texture with 3 progressively smaller lightening bolt thicknesses saved to the Red,Green and Blue channels of the texture. I use a Dynamic Parameter to control the fade between the three over the time of life of the particle so the lightening bolt appears to blast out then slowly shrink in thickness. I also am panning a noise texture over the lightening to give the bolt more life to it.

I added an initial rotation of min -0.007, max 0.007 to just give a little offset to the lightening each cycle. My initial Size is around 10x100 and 10x50 for the second emitter module (which I then offset via initial location to give some fullness to the bolt). The lifetime is very short, a 0.2 to 0.4 range. Color over life is a constant blue/purple color and since I am using an additive material I am not using any opacity settings. The Dynamic Parameter is a Constant Curve of 0,0 to 1,1. I added a Light Module to allow the lightening to really illuminate the area but it is not necessary for the bolt itself.

One important note, I would probably spend some time making a plane in a modeling program which has a pivot point on the top mid edge of the plane so that I can then change the emitter to a mesh emitter and have the Y size grow from 0 to 1 over its lifetime to give it that stroke effect. The effect below is constant and instantaneous.

Good Luck

Eric Ketchum

Hey Eric,

thank you so much for sharing it! It looks definitely great and way better than mine. Does this effect still looks good with a greater size since my lightning has to have the size 800×z!

Hope I can get cloth to the result you have actually!

pompeiic

It should look fine at larger sizes. It is a texture based shader so it will look as nice as the texture itself does, so at a large size if you see that the effect is starting to pixelate you can go back and upsize your texture.

As a general note, I tend to work on Textures which are huge (4096 or 2048) and then size them down to a more reasonable size like 256 or 512 (or lower depending), but this way I don’t have to worry about pixelating a texture by needing to increase its size.

Good Luck -

Eric Ketchum

Hi Eric,

to be honest I’m actual struggling with this method! I’ve made everything as you explained (I think so at least it is not possible) and I got a pretty weird result:

That’s my texture:

And my particle editor:

Can you help me? What did I actually wrong? Thank you in advance :

-pompeiic

Hey -

I think I know what the first part of your problem is. In the Required Module go down to SubUV section and change the Sub Images Horizontal Number to 3 and the Vertical Number to 1. Make sure the Interpolation Method is set to Random.

After that go into the SubImage Index and change the Distribution to Constant Curve with two points the first one with an In Val of 0 and an Out Val of 0 and teh second with an In Val of 1 and an Out Val of 1.

This should divide your texture image by 3 and display one third section at a time. So for a 1024x1024 texture you would be displaying 341.333 x 1024. So in your texture if one of the images goes across the 341.333 pixel line it will be cut off of one Sub Image and added to the next one. This is why it is really import to watch your image setup in Photoshop (or GIMP or etc.) and also why I tend to stick with event numbered images like 4 across which would be 256x1024 each sub image.

This should get you close to back on track. Let me know where or if you have another stumbling block.

Good Luck -

Eric Ketchum

Thanks again :slight_smile:

Yeah your right. I changed now the settings as you intended and got a single random lightning now. But it still doesn’t look pretty nice. It still looks just 2D (don’t get that offset of the second one working) and my texture has a too bad resolution. Maybe I get a better result with a higher resolution of the texture …

Thank you so far-

pompeiic

Just add another emitter in your system with an initial offset set to some value that gives you the breadth of scope you want to your lightening. Post a video when you get it to a good point and I will look at it again.

Eric Ketchum

I’ve stopped for now since I didn’t get the result I’m looking after but anyway thank you so much for helping me I definitely learnt something!

pompeiic

Try this wiki on a good lightning effect. here be da page, yaall