Monday, October 12, 2015

unity - How can I create a height-based volumetric fog?


Recently, I have been looking for techniques to make volumetric fog on some Y position level of the game world. But all I have found are some fog made by using particle system or built-in engine fog that doesn't really fit what I'm looking for.


In my case, I need a fog that is both efficient and dense. It should be all over the gameworld, but obviously, for performance reasons, it can be rendered only as a part of a camera or shader and look like it's moving though it's just an illusion. I could set a particle system if it's the best choice, attach it to the camera and make it move.


So the main question still stays - how can I implement a volumetric fog that is both dense and performs efficiently?


As a particular engine I'm using, it's Unity.


As an example what I mean, here is the link to a game with the effect I'm looking for: Astromike


Example screenshot from a game using a dense height-based fog.



Answer



I'm the creator of Astromike. :)


Actually, I'm using a pretty simple trick to make it look like fog. I'm developing Astromike using Unity, so if you use Unity, you can do the same. But I assume you can also recreate the same shader for other engines.



What I do is, I set up a plane for the fog, and add a material with Particle / Alpha Blended with a Soft Particle Factor (0.32 in my case) shader on. That's it.


Fog plane: http://imgur.com/a/MAEFW


Settings: http://imgur.com/NJVAaIQ


It works for me due to the camera angle and might not work for other people.


The rest is just post-effect stack ( Bloom, Vignette, etc.. ) Hope this helps. Cheers.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...