Volumetric local fog

I have two questions:

  1. Is it possible to lower “Fog distance” on density volume below 1?
    It basically is how far you can see through the fog and when I set it to 1 (which seems like minimum), it is still too transparent for me. Why it cannot be lower than 1?

  2. Local fog (as seen on picture) looks weird. I tried checking High quality volumetrics in HDRP settings, but it doesnt help too much. Only thing that seems to fix it to some degree is “Blend distance”, but I would like the fog with sharp corner.

About second problem - additional fog quality settings are hidden, you can access them clicking gear icon at the top right corner of the Fog properties in global volume: Fog | High Definition RP | 10.0.0-preview.27 (“Depth Extent”, “Filter” and some other settings can fix/reduce that biased look of the fog).

Thank you, missed that one.

“Filter” helps a lot, but even with High Quality volumetrics settings in HDRP (which btw cuts my framerate from 100 to 20), the stripes/circles are clearly visible. It might not seem as a big problem, but the worst part is that when you move the camera, all those circles are moving too and they create hypnotizing patterns :slight_smile:

“Depth extent” is unusable since it makes the fog insivible even from close distance.

“Blend distance” can solve this, but makes the fog too transparent (which might be the real reason I dont see the banding).

I would really like thick fog.

1 Like

Hey,

This banding you see is due to the number of slices along the camera being too low. There are a few things you can do to mitigate this effect:

First, make sure the bottom of your fog slightly clips with the ground. Then, you should make it taller (increase the Y size), enable “Per Axis blend”, and fade out the top of the volume (again, +Y component). This should get rid of most of the banding.

Thick ground fog is fairly easy to do in HDRP without banding and no particular setup:

Then, in HDRP 9 and 10, instead of having the “High quality” volumetrics, you can now directly set the precision of the froxel fog yourself: “Volume Slice Count” will be the one controlling the radial banding.

You might be able to increase the density even further, edit the script for the density volume (DensityVolume.cs).

6197266--679861--upload_2020-8-12_21-11-46.png

And replace line 107 by meanFreePath = Mathf.Clamp(meanFreePath, 0.1f, float.MaxValue);, where 0.1 is the lowest value for the density in the UI, or whatever value you want to use.
(I wouldn’t try 0, this will most likely blow up, with nans ;))

3 Likes

I tried “Per Axis Blend” with big cube where only small part of top protrudes through floor - yes, it reduces banding, but that is because the fog on the edge is very thin.

But if future releases offer slider to play with number of slices, that would be very nice :slight_smile:

Please not that to properly edit the minimum value in the code like Pierre said, you’ll need to use the HDRP package as a local package (copy the HDRP folder from /Library/PackageCache to /Packages). If you don’t do this your changes in code will be overwritten at the next editor launch.
But also, by doing this, you will have to manually port your code change each time you want to upgrade the package version.

1 Like