- Home /
Volumetric Fog?
Hi, I'm trying to have volumetric fog in my game, but every time I enable fog, it tends to stick only on the terrain, and I can't see any fog up from the terrain. I need a 360* fog and was wondering if there's a way to do that.
Thanks in advance
-Sahil
Answer by syclamoth · Sep 19, 2011 at 07:35 AM
The default fog in Unity fades to a block colour, not the skybox- the skybox itself is not subject to attenuation from the fog!
More importantly, this fog is hardly what one could call 'volumetric'. All it does is fade away as the camera gets further away. If you wanted your fog to affect the skybox as well, make your sky colour the same as the fog colour so that you can't see the difference. I would like to write a fog shader that fades to skybox, but I haven't yet so I can't really help with that exact problem.
As far as I can tell, the default settings for the fog conflict a bit with the default skybox colour. You need to set them to be the same, then you won't get weird horizon shapes when things are fully in fog.
Answer by Sahil-Ramani · Nov 15, 2011 at 07:00 AM
Turns out the Global Fog image-based shader (http://unity3d.com/support/documentation/Components/script-GlobalFog.html)
does some pretty good screen space volumetric fog. Drop it on the camera, and select the fog mode to Absolute or Relative Y and/or distance and watch the fake volumetric fog fill the screen.
There's plenty of options to choose from also.
Sahil
Answer by Sahil-Ramani · Sep 19, 2011 at 04:31 PM
Yea, I'm looking for a more volumetric solution, figured someone would've written a shader for that, oh well, I guess I'll have to write it myself.
-Sahil
When you write it yourself, please post the solution on the unify wiki! I for one would be very interested in it!
Hi Sahil, this is a comment and this comment is not a direct answer to your question. If you read this please take your comment out and make it under the answer "Add comment" to be clean. Thanks
@Alan$$anonymous$$attano - Speaking of keeping UA clean, you do know that you just brought this ancient question back to the front page by replying to a comment a user made over 5 years ago?
Answer by Kronnect · Dec 22, 2015 at 09:11 AM
Well, I created Volumetric Fog & Mist. Check out this video: http://youtu.be/8mNRcQ9_Gf4
Answer by AlanMattano · Nov 04, 2016 at 10:21 PM
[2016] In the Unity Adam Interior demo, on the asset store, (Unity 5.4.1) you can find a "VolumetricFog" script attach to the camera. The Asset script is in Features, Volumetric Fog Folder. It works in a small interior (illumination is less than 10 m) with no directional light.
There is this also this True Volumetric Lights (Now Open Source) here: https://forum.unity3d.com/threads/true-volumetric-lights-now-open-source.390818/
@tanoshimi I didn't know that, thanks. I'm using the VolumetricFog script that is included to new $$anonymous$$Interior asset. Searching for documentation about the script, this question was first in google results. I think questions must be general and eternal and answers must be improved with new ones.
Your answer
Follow this Question
Related Questions
Unwanted HDRP Volumetric lighting has grainy effect based on distance 1 Answer
Volumetrics (Fog, Clouds, etc.) 1 Answer
Simplest way to achieve this Fog effect 1 Answer
Foggy Water? 1 Answer
Volumetric fog / mist 2 Answers