Volumetric Fog & Mist - AAA realistic and animated fog, dust, low clouds and mist

To contain the fog inside certain rooms you can enable the Fog Mask feature. It’s the last section in the inspector. It allows you to define certain objects that act as containers for the fog and it will clip outside them.
The objects will be invisible at runtime - their only purpose is to provide a mesh that limits the fog area.

Also make sure your walls shader writes to depth camera buffer. If you’re unsure, please send me the shader and I’ll check or modify it properly.

Using Layers is not really the best solution for me. All the walls are on the “Delfault” Layer and I can not manage my layers based on fog.
If I use the “Default” layer as a mask (in the Volumetric Fog script on my camera), the walls are no longer visible.
If I use the “Default” layer as a mask (in the Volumetric Fog script on my Volumetric Fog Area Box), the fog are no longer visible.:frowning:
My shaders are simple “Standard Shaders”.

The way Fog Mask works is intended to be used differently. Do not use your walls but place a custom cube on your room (covering the area) and assign that cube to a different layer - then use that layer that only contains the cube for the fog mask. When you run the scene, that cube will become invisible.
If that does not work for you, can you send me a scene so I can advise alternative options?

Hello buddy, i have a little issue with Blend Mode and Depth Blur.
Random black spots appear in screen when this two modes are enabled

No more errors without blend:

how can i fix this problem without disable blur/blend mode (blend mode gives a better visual quality to the project)

Hi @Rafael_CS !

Thanks for the screenshots - the black spots could be due to NaN values in the framebuffer. Will add some protection to the pixel shader and send you an update to test.

Fixed adding this line before return of fragBlur in shader Blur

pixel0 = clamp(pixel0, 0.0.xxxx, 1.05.xxxx);
return pixel0;

thanks for the quick repply @Kronnect

1 Like

Hi,

what happen to transparency objects, like car glass at distance or windows?
There is no depth information and the objects stay at its color.

Eg to my Water Towers support.

What happen to your fog in this case?

Volumetric Fog & Mist provides the following options to handle transparency:
a) Render before or after transparent queue
b) Do a custom depth pass with transparent objects thus completing the depth buffer
c) Render fog over opaque geometry and then blend transparent objects on top of fog but with user-defined transparency level.

Regards.

Hi all!

Happy to announce Scutter, a VR arcade-style platformer, has been released on Steam.
Scutter uses Volumetric Fog & Mist. Check it out here:

I see that Dynamic Fog and Mist has been updated to 6.5, but the version included with this asset is still 6.0. Will it be updated to 6.5, with the support for SRP and post processing profiles?

Sure! Latest version of Dynamic Fog & Mist (6.5 currently) will be included in next update of Volumetric Fog & Mist. In the meanwhile, you can send me a pm with your invoice number and I’ll send you a download link.

fyi, all registered users on our support forum have access to latest releases.

Hello,

Amazing asset, however I’ve run into an issue, especially important in VR, which is I can’t seem to eliminate aliasing around edges of objects in front of the fog:

(This image is taken beneath terrain, but the same is evident for any object that stands in front of the fog.)

The fog has a distance of 1000, but I also tested with a distance of 350. There’s no downsampling. It’s very close to one of the default profiles, just heightened and scaled up.

I tried with lots of settings, as well as searching this thread, but the only thing I can think to make this at least workable is to us temporal anti-aliasing, of which the current solutions available are lacking.

Do you have any solutions to this problem? Is there a configuration that works for VR (no aliasing/edge artifacts?)

Thanks.

Hi,

The issue is related to how MSAA works in forward rendering path and _CameraDepthBuffer storing the resolved depth for each pixel. As a result, the fog image effect can only use one single depth value per pixel even if the multiple samples taken by MSAA have different depths.

Averaging depth inside the GetDepth() method of VolumetricFog.cginc file can reduce the problem in some cases but this is not a good solution either since the average is still one single depth value considered for all sub-samples.

You can try to enable downsampling x2 (in Volumetric Fog inspector) which in practice forces pixels to average colors and depth reducing the issue.

If you prefer not using downsampling, you can make a change in code so Volumetric Fog still applies the final edge filter pass at the end:

In VolumetricFog.cs script, around line 2847 change:

if (_downsampling > 1f) {
...

To:

if (_downsampling > 0f) {
...

Similarly, in VolumetricFogInspector.cs change line 966:

if (_downsampling.intValue > 1) {

To:

if (_downsampling.intValue > 0) {

Now you can leave downsampling to 1 (which will preserve resolution) while allowing the end pass with edge filter.

Some testing pictures for the above changes:

No changes:

With the above change and “Edge Improve” option disabled:

With above change and “Edge Improve” enabled:

1 Like

Thanks for the in-depth and quick reply!

The downsampling 1 improve edges mode does alleviate things slightly. With downsampling 2 and up, there’s a larger ‘outline’ (see the blue lines along the top edges - though this is with downsampling 1 with improve edges on.)

Unfortunately even with this, there is still heavy aliasing, as seen in this image with the top edges (close to camera) as well as aliasing, although with no ‘clear outline’ as is the case when the only thing past the fog is the skybox.

The ‘outline’ can be alleviated pretty solidly by matching the fog’s color to that of the skybox/clear color. But, the alaising of distant objects standing in front of the fog is still present.

Is it fair to say that it’s not possible to eliminate this aliasing further without a third-party final AA effect? I’ve tried a variety of tricks for disguising the aliasing that’s left, just experimenting with the different combinations of settings in the inspector, but I haven’t found anything as of yet.

Since the aliasing is only extreme with distant objects that stand before the fog, it could be fixed by making the distance cutoff for the fog very close, however, the view distance would be very low of course. My use case is to disguise view distance cutoff immersively for VR, and at the moment the far clipping distance is 1000.

Yes, try adding FXAA at the end of the stack.

On the other hand, Fog materials do not present this issue since the material shader embeds the fog effect and in that case MSAA will do the correct thing: blend pixels with different fog accumulations. Fog materials are included with Dynamic Fog & Mist (also present in the Volumetric Fog Package) - the downside is that you need to replace your materials to use this solution and also the integrated fog effect is more limited although for a depth based fog effect should be more than enough (and it will be faster).

https://www.youtube.com/watch?v=m3xC01XEqe8

1 Like

Hello, i have an issue with fog & Vegetation Studio & VR, (oculus cv1, U:2018.1.0f2, any pass mode) .At begining all ok, but after move head - fog become like another layer(moved a bit) and moving like billboard. I have suspicious what it is due to dynamic trees rendering of VS, when rotate head some trees dissapear, some appear in visible area and this produce this issue, is any idea how to solve it?

It looks like a discrepancy in the depth buffer. I’ll contact Lennart on this issue and see if he can shed some light.

Hi. What tree shader are you using?

Lennart

Hi, VS shaders from mountine trees package, so VS_tree_bark_… & VS_tree_leaves… .Also i check with those prefabs without VS, just put many prefabs of trees manually and in this case all ok

1 Like

trying to replicate it with the mountain trees now