Creating atmosphere without fog volumes?

Hi.

I am trying to find viable ways of creating a nice atmosphere for my game.

I have been working on this specific since i got unreal engine 4 last year October sometime. Its the first thing i checked because it was or is the most important thing for me regarding rendering the game.
I still have not come up with a viable solution.

Epic staff suggested i use fog sheets… but this is not yielding satisfactory results as its effectively just creating an overlay effect.
I am strongly of the opinion only fog volumes or occlusion of atmospheric fog will give me what i want. But neither of those exist.

It would be very much appreciated if anyone can give me a solution or point me in the right direction.

Above Ground Desired Result

Cave areas desired result

Actual cave area results

I honestly don’t know what else to try.

Oh yes. It might be worth mentioning that i did try to create everything with just fog sheets. And disabling atmospheric fog. This looked good yes. But performance hit was significant. I mean it went from 45fps to 4fps by using these massive fog sheets in the level.

Have you already tried using the ExponentialHeightFog actor without success? Inside a cave it would probably look pretty close to your desired cave image, using a lower Density value and setting the Start Distance out far enough from the player. Also try out different color values, using a darker color should add to the effect. On top of that add in some PP and you should be able to get your desired result with much less of a performance hit.

You would want to turn it on using a trigger of some sort so it’s only visible inside the cave though, or at least modify the settings when the player leaves the cave. I use a similar setup for underwater and it works pretty well once you get the settings tweaked. :slight_smile:

Unfortunately i have tried exp height fog as well.
The problem is i need the fog to start at the players location. Which results in this.

I also searched trello. Doesnt look like fog volumes are on the cards.

Have you considered a post process material? To recreate the fog effect just blend based on scene depth and to mask out the caves (or even create a nice transition between the two) you could use the pixel’s world position.

Man what an experience. You know… when i run into stuff like this i get angry. But its this anger that drives me to keep reading and keep experimenting until i find something i like.

I eventually did go with fog sheets. And to demonstrate how well it changes color i added some blue near the cave entrance for demonstration purposes.
As for the performance hit. I soon realized the only reason i was having this, is because at fullscreen my game performs at a terrible rate.

Only when there is absolutely nothing to render does it render well. Which i know is related to my GFX cart…
Anycase.

Fog Sheets seem to be the way to go after all. Well, that and a healthy combination of adjusting Sky color to compensate in areas.

3076c16f7ed715f68b25faab9d1ece8eb5e6a580.jpeg

Hi.

Edit : ok its been long day i completely misread your post.
I need to go read and research on this masking out areas thing.

If you know the document that refers to this please point me there. Or if you would be so kind to give a brief explanation of what im researching.
I know what masking is, but how i would go about masking something… perhaps something similar to a world based location, like the example they used to make things transparent around the player… i can use that i guess… then just add sphere or other things where i want the masking to occur… hmmm.

Am i on the right track?
Thx man… sorry had too much coffee

This isn’t really helpful, but I just wanted to say that your game looks beautiful.

Maybe add the fog just to the player character blueprint, instead to the entire level?

Here’s an example:

PostProcessFog.jpg

And the post process material:

I hope that explains it a little better. Let me know if anything else is unclear.

Note that this is not really physically accurate because only the geometry location defines the fog color. It would be more correct to consider the colors along a ray from the camera to the geometry. However, that would complicate the shader and seemed unnecessary for your use case.

@Arnage
Thank you. Much appreciated.

@Unit23
I want more control so rather adding them manually.

Thank you cinebeast

The best thing would just be if Epic would allow to tweak the heightfog locally via post volumes! This way you could have 1 heightfog actor but many different settings for it based on post volumes for different areas (and it would be awesome to be able to apply a material to the fog to get some animation going on in there^^). I remember that we actually integrated something like this into Unreal 3 back in the days when we worked on Spec Ops, so this shouldnt be to crazy to reimplement into Unreal 4. But then…I am no graphics programmer^^

Cheers!

Hi Crocopede,

I am using basically the same trick as Arnage, the only differences are:

  • I am calculating the fog in my regular materials for my objects, not in a post process one
  • I am using Material Parameter Collection values to control everything globally- this would give you some desired control you where writting about here
  • and I am getting my distance for the fog in another way (as this is not a post process mat), you can get it from the object’s position on specific axis if your camera is fixed, you can calculate object’s distance from the camera, or you can calculate pixel’s distance from the camera, all tested and works beautifully

I am using this method for an unlit mobile environment and it runs around 55FPS on Adreno 305, that 5FPS noticed after adding the UMG HUD. And it looks like that:

So if you are looking for some performance improvements this method might be worth exploring.

Pretty clever man. I was wondering what the results would be like if applied to all materials and not fog volumes.
Is your performance still good running it on all materials?

Yes, this 55FPS on Adreno 305 is with the scene that you can see at the screenshot, and most of the stuff here is using this “fog” calculation.

Thats pretty awesome. Thanks for sharing. Want to test it on one of my mobile games… definitely sounds less heavy than actual fog volumes