Electrical Explosion in UE4

Hey everyone, wanted to share my latest piece in hope of getting some critique, help, and feedback. I’m looking for Associate VFX Artist positions on the west coast and trying to improve my skill set and optimization tactics. The video link below has a brief breakdown included, and the image below is further explanation of the fire/smoke breakdown.
PS: first time posting here, and don’t know how to imbed a video (or if I can). I’m only allowed to post one image/2 links as a new user, so please visit my Artstation below for the other breakdown image involving the wire snap and blueprint. The video is a bit long for a gif. Please select 1080P60 for the quality level :slight_smile:

Electrical Explosion on Artstation by Lindsey Gunsallus

Asking for technical help on: Cost of the smoke in the fire’s smokestack

-The smoke within the electrical explosion itself is the same as the smoke stack but doesn’t cost nearly as much due to particle density of overlapping transparency-- that smoke stack is the most expensive emitter in the project by leaps and bounds.

  • The smoke material is just the flipbook/alpha multiplied by particle color for base color and opacity on a translucent material with a depth fade. The flipbook itself is a 2k res 64-sprite atlas, which means each frame is already pretty small in each dimension so the resolution cannot go much smaller, can it?

-I’ve reduced the particle spawn and size for the smoke stack to as few as possible while still looking to retain some sense of volume and smoke thickness…and the lifetime needs to exist as it does for the height of the smoke to be reasonable with upward velocity… so I’m stumped on how to reduce the cost further without downsizing the texture flipbook’s resolution or frame count. I do have particle lights reacting to transparency, but their radius doesn’t reach the smoke when the smoke flipbook is at it’s most expensive. The project sequence on my computer runs in real time between 60-52 FPS until the smoke stack ignites it’s secondary, heavy smoke plume emitter (while shutting off the small smoke) which lowers frame rate to ~40FPS.

Any ideas on how to approach?

6 Likes

Hi and great work so far! So correct me if I misunderstood but you’re wondering how to increase frame performance and you’re wondering how to do so without impacting texture size.

In general there are two areas VFX artists need to keep in mind for performance… memory and render-time (typically impacting the CPU). Reducing the memory footprint of the smoke will likely have little impact on the CPU render time issues you are seeing. The bigger win here will be trying to find optimizations in your material to reduce instruction counts. Removing redundancies. Trying out smaller particle sizes, fewer particles, shorter lifetimes, etc.

Basically, you are having a classic overdraw issue.

1 Like

What kind of material are you using for your smoke? Are you using Volumetric Directional for your Lighting Mode in your material or any motion vector stuff? You may just need to play around with your spawn rate; it looks like your texture space in your flipbook is pretty efficient.

1 Like

Hello, thank you! Yes, you understand-- Since the material for the smoke is as simplified as possible by being almost solely the flipbook by particle color, I’m estimating by your advice that the size of the scene and the smoke size within must be the main cause for the overdraw-- The scene is pretty large.

I’m going to try to reduce the spawn count and adjust size/spread of particles to accommodate the points you mentioned. Thank you for the explanation and advice! I will repost the adjusted version tomorrow after I incorporate this and the other critique I have received :slight_smile:

Hello Travis, I’m not using any motion vectors in my material, it has been pared down to basics. I think you and Justin have it right with spawn rate and size being the major reasons for the overdraw, so I’ll address that emitter and try to keep a close appearance with better performance. Should I be using a different lighting mode on the material? Thank you!

Yeah it would be worth testing an unlit shader too. Maybe mix them and just have the unlit for the larger areas.

Ooh, mixing them is a good idea, I hadn’t considered that-- I’m adding it to my list of things to try!

I like your video breakdown, very detailed!

No, that’s fine and probably as cheap as you’ll get with a lit material. Your best bet is probably what JWoodard suggested and play with you spawn rate, life, and particle size to address your overdraw issue.

If you are using a uniform range for things like spawn rate, particle life, velocity, acceleration, etc. try changing those to constants first, and adjusting the value for each until you’ve reduced the overlap. Once you have it more spread out and looking good, then start slowly increasing the gap between your Min and Max range values. Do a small pass on each, and then slowly grow the range gap while keeping an eye on your overdraw.

I remember when I was working on the flame jet for a flamethrower, I ended up setting a fixed spawn rate and lifetime, and adjusting both until each sprite was only just barely overlapping with one another. Sometimes you just can’t afford to have a range on certain things in your particle emitters.

Thank you kindly! :slight_smile:

Hello again, everyone! I appreciate the feedback I received here and from other professionals I’ve asked about it-- Here’s an updated link to the project on 10/31/18

https://youtu.be/8AAuPa3ttUI

I did not delete the old video from my YouTube channel so that others here can temporarily reference it to compare, but here’s a quick Shader Complexity before and after video:

On the final sequence, I adjusted the flare size to have a larger sense of impact on the initial blast, gave it a more definite color, and made the starting smoke on the bush less thick to better suit the fledgling flame’s intensity as well.

With JWoodard and Travis’s advice (thanks!!), I addressed my smoke stack’s overdraw issue by adjusting spawn rate, lifetime, init velocity (they were moving too fast, too), and size by life / init size. I previously misunderstood how those factors combined were affecting my overdraw, so thank you both! In the shader complexity portion of the video, there’s a pretty sizable difference in that smoke stack’s results, and I think I kept a decent bit of it’s previous appearance intact.

However, the fire’s smokestack doesn’t rise as high during it’s peak, due to lifetime/velocity change. I’m not sure whether that needs more attention, what do you all think?

5 Likes

I got some feedback that the starting smoke on my fire was ‘popcorning’ and I fixed it, so I’ll render another update tomorrow :slight_smile:

Further optimisation: If the smoke doesn’t intersect with anything then you do not need the “Depth Fade” (try it without and see if you notice any visual difference).

Try adding some flickering to the fire light that grows too (fire doesn’t give off a consistent light - check some reference)

Thanks Doggett, that’s a good point; I agree the light could use a flicker to better match the references I’m looking up now. It shall be done! :slight_smile:
About the smokestack not needing the depth fade: I didn’t fully consider that before-- they do expand mostly above the bushes/fire. I’ll make a separate material without DF for just those smoke stacks and implement it with today’s update!

Alrighty, here’s today’s update based on feedback:

-Fixed smoke plume breakup on initial explosion above transformer to not be such a round creme puff in its dissipation.

-Even larger init size and repeated emitter loop three times for the Flash on initial explosion to combat how short the lifetime is, and to be closer in likeness to some of the references I’ve seen about the duration/size of the flash on an electrical explosion. I’ve learned that sometimes the ‘flash’ appears to hold consistent for a sustained electrical flare, and other times it’s a rapid succession of flares with it’s sputtering energy discharges… but I feared drowning out the other effects with too much coverage over time, so I tried to balance.

-On Doggett’s advice, I got a bit of flicker on the fire’s light with some inferred heat intensity as well with the spread, based on a few references I watched. I had already animated brightness/life of Light on the fire to be irregular but didn’t like how it looked without shadows, so I added a dynamic point light paired to the fire emitter, so the bushes would cast shadows in the fire’s light too, and animated its intensity to flicker across the sequence as well.
On that note, I feel like I’m ‘cheating’ on the flicker effect-- is standard practice to use High-Quality Lights and Cast Shadows on my fire particle for this circumstance? Does it matter, since the HQ Lights/Cast Shadows options on the light node would make it function as a dynamic point light anyway? I’m not familiar with what is correct practice on that particular topic, so thanks in advance to anyone who can ‘shed some light’ on it for me.

-Also on Doggett’s advice, I removed the depth fade from the smoke stack’s material for further optimization since those particular sprites don’t really interact with mesh surfaces.

I feel like this project is improving with all the feedback, thanks all!

2 Likes

That’s looking good, and with a lot less overdraw. Nice work!

To answer your flicker question, in practice that high quality light is going to be expensive if used in more than one spot in a game, but it would depend on the needs of the game

Thank you, Travis! So I suppose HQ lights it might be ok in situational use for a small effect with a short life, but not for large areas and extended use, which would obviously do better with an animated spot/point light. Good to know. :slight_smile:

If it’s persistent stuff, like things an environment artist would place then they would most likely place a standard light themselves, or it would be all together in a blueprint and the would place the blueprint with the light in as a component.

For a demo reel, don’t worry about the cost of the light, since the goal is for it to look good. Definitely keep optimizing overdraw and particle spawn count as a constant in your workflow though, as that is always a best practice. Every project you work on will always need to be as efficient as you can with each element, but stuff like lights will be project and platform specific.

Keep up the awesome work! The breakdown is fantastic and a big plus when applying.

Ahh, I understand now, ok! I suppose I was too caught up worrying about it then, wasn’t I? Haha. Thank you for the kind words and compliment, it’s a big confidence boost. I definitely have a ton more to learn, but I’m stoked to be on the right track and improving. Today a new project starts! :slight_smile:

You’re on the right track and your work is impressive already, keep at it and keep posting! The sparks starting the small fire on the bush, and the fire spreading is a really good layer of extra detail and thought. It’s that kind of stuff that really stands out