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

As stated, profiles have been used configure style aspects (colors, densities, animations, etc.). All legacy presets like windy mist, frost ground, sand storm, etc. are now available as profiles. And you can create volumes which will lerp all settings smoothly as you enter/exit them.

Fog void settings may require additional treatment from code though. For instance, if you set a fog void to follow a certain character, it must be set from code at some point and then, depending on the character or situation you may need to change the void radius - so because these settings seem more dependant on game logic they have not been included in the profiles … for now. Some users have even tweaked the asset to add a second void…

Yes - get a reference to the camera or fog area Volumetric Fog script and set the properties accordingly. You can get the reference to the main script with the convenient VolumetricFog.instance static method, for instance:

VolumetricFog.instance.density = 0.5f;

Next beta will include them (available anytime next week on our support forum).

Hi there! I’m really enjoying using your asset and I think the results are quite nice.

I just have one issue: I’ve been able to get it working with another TOD plugin, AzureSky Dynamic Skybox. However, while the sun directional light is assigned in Volumetric Fog script, and it’s getting the sun’s colour changes, the fog’s colour is not updating/transitioning smoothly. For example, when the sun rises, it looks like Volumetric Fog is only updating the sun colour every .25ms (estimated) instead of every frame.

Where might I start with smoothing out this transition? Is this an issue you’ve encountered with Time of Day plugin users at all?

EDIT: So in an empty test scene the transition is much smoother… still not seamless but much better automatically. I will update if I solve this!

1 Like

When directional light rotates, Volumetric Fog & Mist needs to update an internal texture where some optimizations are baked - that can be expensive so there’s an angle threshold which may cause the jump.

Edit VolumetricFog.cs script and look for this line:

const float TIME_BETWEEN_TEXTURE_UPDATES = 0.2f;

replace it with

const float TIME_BETWEEN_TEXTURE_UPDATES = 0f;

And see how it goes.

It will be exposed in the inspector in next version.

1 Like

Thank you very much for your swift reply! I’ll try it today.

Hi Thrawn, thank you for your support yesterday, it solved my problem!

If you don’t mind, I have another question :slight_smile: I’m using Fog Areas to obscure certain rooms of a level until they are discovered (essentially volumetric fog of war). This works beautifully on square rooms, but I’m looking for a solution to non-square rooms.

I figure I can achieve this through the use of fog voids subtracting from an area to achieve an angled corner (Edit: Actually, not sure if I can do this?)

Is it possible to assign a different mesh, or a texure to create different shaped for areas? For example, a triangular fog volume? I know that Box and Sphere areas are supported out of the box. In my initial test, assigning a different shapes mesh to the fog area didn’t work. Just wondering if you can give me any more info.

1 Like

Box and spherical shapes are analytical and deeply integrated in the shader and same render pass (that’s why they’re so fast). To cast fog on irregular areas, you could indeed try the fog of war feature instead which basically reads from a mask texture to pick the transparency at any given x/z position. Check out the fog of war demo script for sample usage.

Thank you again for your quick reply! You’re very helpful. I will work on this new approach today.

Hi again,

I looked into your solution. I’m not sure this method can encompass my needs, but perhaps I am just offtrack:

I was able to use a texture mask to determine a fog cutting area in the demo scene, but since the Fog of War script is applied to the camera instead of being a fog area, it seems to fog an entire area and then cut only one part out of it. I would need to be able to cut fog of war on a per-room basis, rather than all on or all off. Is that possible?

Ideally it would be amazing to be able to use this texture mask approach on a Volumetric Fog Box Area area to determine parts of the Fog Box Area to be transparent. Is this possible/if not, could it conceivably be extended?

That’s interesting, thanks for the suggestion. I’ll check this and send you an update so you can try it :slight_smile:
You could also sign up on our support forum to get latest beta releases.

I didn’t realize there is a support forum, I will go check it out now! Is it better to just post there instead?

Since you are going out of your way to do a check, I’ll make sure to outline my use case and add an example photo:

I hope to scale a Volumetric fog box area to fit interior rooms. When a player enters the room, the Fog Area’s Density
value will tween to 1, revealing the room. For non-square rooms, I would love to use an alpha map to remove areas of the Fog Area which stretch beyond the room’s walls.

In this screenshot you can see my problem with needing to mask out the fog which reaches beyond walls.

Well, the support forum has a private board for registered customers where you can download latest beta versions. It’s here. For general / quick questions you can use Unity forum, no problem but lengthy discussions about a single topic are better handled on the support forum. It’s your choice :slight_smile:

Thanks for the screenshot!

Amazing!! I registered for the support forum and sent a PM with my invoice number to Kronnect. Depending on how our experiment progresses, I will make a thread there to share my experience with this approach to Fog of War :smile:

I just just added your ā€œVolumetric Fog and Mistā€ to the "VR Panorama 360 PRO Renderer", but the fog does not render. Could you please explain how I can get it to show up in the rendered VR video stills please?

Hi!
Ensure you have the ā€œEnable Multi-Cameraā€ in Volumetric Fog inspector option checked (VR Panorama spawns several cameras hence the need to enable this option).
Regards.

Just released a new beta on the support forum with the new mask feature. Looking forward to your impressions / tests.

Hi Thrawn, I’m using it now and it looks great!! Thank you for your hard work. I think it will fit my needs superbly :slight_smile: The only problem seems to be that the fog mask meshes are rendering on top of everything else (but I left this comment on the Kronnect forums as well, we can discuss there as you prefer)

Cool, thanks for trying out! I just read your message over there. I’ll take a look at your test package when you’ve it. This feature opens indeed lot of possibilities…

Sure thing! There’s a link to my test package over on the forum whenever you’ve got time. Again, really appreciate your work on this. Will definitely be recommending this asset to anyone who asks.

1 Like

Hi all,

The new update 9.3 is now available - this is the changelog:

  • Added mesh volume mask feature for Unity 2017.1+ (enable it in Shader Options)
  • Added downsampling, fog void and light scattering options to profile scriptable object
  • Added texture update interval parameter to inspector (reduce to make directional light influence update faster)
  • Added WebGL compatibility
  • [Fix] Fixed inspector UI refresh issue when using profiles
  • [Fix] Fixed issue with a render texture not being correctly released when transparency blend is enabled (only Unity 5.5-5.6 versions)

Also a new Discord server is now available! Sign in for quick answers and a nice chat on our assets :slight_smile: Discord

1 Like

Hi … I have this problem:

I would like to use the Volumetric Fog Area Box but the fog can also be seen through the walls:(
Is it not possible to avoid it? Otherwise the asset is useless for me :face_with_spiral_eyes: