Recently made this fairly in-depth tutorial for an explosion shader in UE4 - Explosions for Games - UE4 Video Tutorial on Vimeo - 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!
I watched the video now 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?
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
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.
Here is another follow up UE4 tutorial, this time focusing on particles and timings - Explosions for Games - UE4 Particle Video Tutorial on Vimeo - hope you enjoy it and let me know if you’ve got any questions. Still working in Cascade but maybe in the future will convert it to Niagara