After several days of trying to figure out how to put Exponential Height Fog on the ceiling, I came across something called ‘Fog Volumes’ which seemed to be exactly what I needed. Unfortunately they didn’t seem to exist for UE4 and there wasn’t a whole lot of alternatives for what I needed. I managed to come up with this solution and would like to share it with the community and hope that some may find it useful or informative.
Here’s what we’re going to create.
Easy to make!
Lets you have fog basically anywhere in any shape (depending on your mesh).
Works great for fog in the distance, for ceilings, or low to the ground.
There are no sides to the fake volume. If standing inside, it looks kind of strange on the sides of the ‘volume’. There’s probably a way to fix this.
May be resource intensive, but I didn’t see any real impact when testing with 300+ sheets. Results may vary.
Dipping the camera down into the fog doesn’t look so great if there’s a bunch of space between the sheet.
So if this sounds like something you’re interested in, we’re going to have to create three pieces that work together to make this work.
To begin, grab a plane mesh.
I reused one I made for an impostor card piece.
It’s just a plane from Blender. Might have had a Solidify modifier added to it, but it should be fine as just a plane if the Material is two sided.
Second thing we’ll need is the Material which we’ll later make Material Instances out of.
The main thing here is the DepthFade node and the parameters attached to it.
Next you’ll want to create a Blueprint.
Inside you’ll add the InstancedStaticMesh component.
Shout out to Tech Art Aid for his awesome tutorials, which is where I learned about instancing.
Long story short, this works by throwing a bunch of planes on top each other using the ForLoop node under the Construction Script.
The Make Transform node and math attached to it offsets them one after another.
If your plane mesh is standing up like mine was, you can make the “Make Transform” node rotate it by 90 degrees here. User discretion.
Once you’ve got all that put together, throw the Blueprint down somewhere and if you created a Material Instance you can play with the parameters in there in addition to the ones with the Blueprint for varying effects.
If you use this, let me know or post a screenshot. I’d love to see how this gets used. If you have any questions, let me know and I’ll try to answer them as best I can. Also if there’s a better way of doing something like this, I’d love to your suggestions!