Explosions for Games - UE4 Shader Tutorial

Hey,

Recently made this fairly in-depth tutorial for an explosion shader in UE4 - https://vimeo.com/338962167 - pretty straightforward stuff, although I did go into detail on setting up and explaining the motion-vectors blending. Also there’s some nifty UE4 material editor tricks in there too, such as how to convert bits into material functions to keep everything organized.

I hope this is useful, please let me know what you think! :slight_smile:

Also, check out my FX pack Explosions for Games: Vol. I - https://vimeo.com/338665938

explosions4games_ue4_shader_tutorial_gif

21 Likes

I watched the video now :slight_smile: It’s really interesting, thanks for taking the time making it! My feedback/questions:

  • I think it’s not to underestimate what a huge difference linear/srgb does to textures/shaders. In the video it sounds a bit like it doesn’t matter that much, but especially for motion vectors/normals it’s huge (as well for colors).
  • It’s super cool for learning to build a custom node, but is there a special reason why you didn’t use the flipbook_motionvectors node (I think it’s shipped with Unreal)?
  • I really like the lit particles (with your normal map) but I wonder: there’s a lot of shadow and light already baked into your diffuse texture. Did you notice problems with that? It looks very cool but I’m not sure if the normal does a lot for the final result and maybe could be ditched?

Have a great day!
Simon

Depends on how much color is being used in the lights for a scene, or if a light is going to be used in the explosion; the normal map will play a bigger part in either or both of those cases as long as the material is set to Volumetric Directional

Hey @simonschreibt!

Thanks for the feedback, you’re absolutely right that linear vs RGB is super important, I should have chosen my words a bit more wisely there - particularly for masks/normals, since the math has to be precise. The only reason, I was a bit more free-flowing with the colors was because of the intention to add lots of color controls in the shader.

About the motion-vectors, I mostly wanted to go deeper into explaining the maths behind them - there’s probably other methods to do them too, but the maths would all be the same if it’s using that kind of motion-vector map.

Lastly, the baked in shadows are dependent on the lighting of your scene as Travis says - if you don’t intend to rotate the sprites too much and doesn’t super look jarring in dark scenes, it’s usually fine. I always think of it like: the shadows you get from hours of rendering your volume in Houdini/Fume/etc. will end up looking more convincing than the ones you’d get in engine, just by merit of sheer computing power. Though that’s just my preference.

1 Like

Hey,

Quick update, here’s the After Effects setup for the explosions - https://vimeo.com/340078685

Hope it’s useful!

5 Likes

fantastic shader tutorial :slight_smile: Did you use Houdini to generate these explosions?

Thank you!

Yeah, Houdini all the way :slight_smile: