Search Unity

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

Discussion in 'Assets and Asset Store' started by Kronnect, Dec 1, 2015.

  1. Kojote

    Kojote

    Joined:
    May 6, 2017
    Posts:
    200
    The fade now works beautifully! :)

    One more question, Enable Fade, Distance and Fade Out were not saved at runtime. I can also be wrong, but weren't the set values always saved at runtime?
     
  2. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Properties of the profile are saved at runtime as they're a scriptable object and scriptable objects have that design in Unity Editor. However, other settings that are bound to the fog volume instance (like all those settings below the profile, such as Fade or Fog of War etc) are not.
     
    Kojote likes this.
  3. Kojote

    Kojote

    Joined:
    May 6, 2017
    Posts:
    200
    OK and thanks again for the quick fix! :)
     
    Kronnect likes this.
  4. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,162
    is it not compatible with URP/WebGL? I get an error;

    Shader VolumetricFog2/VolumetricFog2DURP
    -------- GLSL link error:

    Note: Creation of internal variant of shader 'VolumetricFog2/VolumetricFog2DURP' failed.

    Before adding that asset my project was working on WebGL build.
     
  5. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Hi!

    Check the documentation (PDF) for setting up the shader for WebGL/URP. Thanks!
     
  6. Janoooba

    Janoooba

    Joined:
    Feb 9, 2016
    Posts:
    43
    Hey, does this package include a way to manually calculate and apply fog to transparent objects with a custom shader like some other fog packages do? (See Aura 2, Atmospheric Height Fog, SC Post Effects URP version) Unfortunately I can't use those for various reasons, so I've been eyeing this one.
     
  7. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Yes, the built-in version let you do that to certain extents (some features are not available when embedding the fog shader code but most of them are). The URP version doesn't have this option yet.
     
    Janoooba likes this.
  8. Kojote

    Kojote

    Joined:
    May 6, 2017
    Posts:
    200
    Hi!

    I have another question about Volumetric Fog.

    In my scene I need a white fog. My albedo is white, I don't use other colourings. The brightness is set to 0.45. If I increase the brightness above 0.45, my fog becomes white but also starts to glow, which I don't want.

    Is it possible to create a pure white fog without it glowing?
     
  9. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Try lowering the Specular intensity value.
     
  10. mattikal

    mattikal

    Joined:
    Feb 13, 2022
    Posts:
    9
    Hello,
    Regarding the Volumetric Fog. I'm not too familiar with shaders. Is there a way to clamp the intensity of the light when using native lights? I would like to use long reaching point lights to light up the fog, but I don't want it to burn the middle part to pure white. Thanks!
     
  11. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Yes, it's possible but currently only modifying the shader code. We could add a setting though.

    In Raymarch2D.cginc, change this:

    Code (CSharp):
    1. fgCol.rgb += light.color * (light.distanceAttenuation * light.shadowAttenuation);
    with

    Code (CSharp):
    1. fgCol.rgb += light.color * min(MAX_VALUE, light.distanceAttenuation * light.shadowAttenuation));
    where MAX_VALUE is anything you want, like 0.2, 0.5, etc.
     
  12. mattikal

    mattikal

    Joined:
    Feb 13, 2022
    Posts:
    9
    Awesome! Thanks for the help, now it looks what I wanted!
     
    Kronnect likes this.
  13. AFriendlyUnityDeveloper

    AFriendlyUnityDeveloper

    Joined:
    Dec 26, 2018
    Posts:
    33
    Hello, I think your asset looks great and I am considering purchasing it, I want to make sure that it works well for my use case first though. I want to:

    - Have a large (probably a couple hundred) gameobjects that I control the shape and size of in my scene.
    - Attach your fog shader
    - Have these blur together nicely in cases where they overlap and show no fog in cases where they do not
    - On the builtin pipeline

    Bonus:
    - Have this also work on objects emitted from a particle system

    Is this doable with your asset?

    Is the documentation for this asset available online somewhere? I feel like I could easily determine if this would do what I needed before purchasing if I could look at the docs.

    BTW I have bought some of your other assets in the past and been impressed, keep up the good work!
     
  14. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Hi,

    It won't work with particle systems as it's a full screen image effect (in built-in) or a world space volume on its own (in URP). You can create multiple volumes in your scene - performance will depend mostly on the number of volumes visible at the same time as well as screen occupancy (as it's a raymarched effect).
    If the instances of fog volumes share an altitude range, you could use the fog of war feature which let you control the opacity of the fog at any world position. This would be more efficient than having many independent fog instances.

    Regards
     
  15. Kojote

    Kojote

    Joined:
    May 6, 2017
    Posts:
    200
    Hi!

    I would like to be able to activate and deactivate the fog in the settings. Is there already an interface for this?

    Alternatively, I can also deactivate the GameObjects. But are there problems with the manager?
     
  16. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Just toggle either the gameobject or the renderer.
     
    Kojote likes this.
  17. Luke-kaser

    Luke-kaser

    Joined:
    Apr 2, 2018
    Posts:
    19
    Hi !
    I want to rotate the fog volume object by using Y axes to align with map but it seens can't be rotate.
    does any way to rotate fog volume with use Transfrom rotation Y axes(with object space) ?

    I thought it could using Matrix4x4.TRS to calculate rotation Matrix and put this Matrix resullt into shader to calculate rotation.
    Does this idea is a good way to rotate Fog Volume ? any advice
     
    Last edited: Jul 8, 2022
  18. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Fog volumes are axis aligned. They can be repositioned and scaled but not rotated (to keep the best performance possible; rotating it would add additional complex transformations in the fragment shader).

    Fog Voids on the other hand can be rotated (only in the URP version).
     
    Luke-kaser likes this.
  19. Luke-kaser

    Luke-kaser

    Joined:
    Apr 2, 2018
    Posts:
    19
    Thanks your quick reply and advice.
    Void could be rotation is a good idea but it afraid not suitable for us

    In our ARPG project we want to use fog volume to make unknow area and unexplored rooms.
    We want to make something like the room will from dark to bright when character open the door.
     
  20. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    You can use the fog of war feature for that. It allows you to customize the fog transparency at world positions (and in URP, also the fog color).
     
    Luke-kaser likes this.
  21. Luke-kaser

    Luke-kaser

    Joined:
    Apr 2, 2018
    Posts:
    19
    Oh. it sounds like a perfect solution for me.
    Awesome! Thanks for the help:)
     
  22. Luke-kaser

    Luke-kaser

    Joined:
    Apr 2, 2018
    Posts:
    19
    Hi, I tried your suggestion.
    But in the end we still need rotate fog volume to make more natural look.
    Could you tell me where should I make change when rotate fog volume.
     
  23. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Hi,

    Latest beta now supports rotation of fog volumes. You can get it from our support board.

    Kind regards.
     
    Luke-kaser and ratking like this.
  24. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
  25. Luke-kaser

    Luke-kaser

    Joined:
    Apr 2, 2018
    Posts:
    19
    Awesome!!! ★★★★★
     
  26. FuriousEX

    FuriousEX

    Joined:
    Mar 13, 2014
    Posts:
    51
    I'm having a strange problem with the Fog of War feature of this asset. The fog masking is not working for my game in the build, but it is in editor. The strange part is when I build your demo scene in this project, the fog of war masking works fine there.

    FogOfWarBuildBug.png

    This is the coverage texture:
    Circle G 1.png

    This is URP 12.1.7
    I double checked the set up steps - Depth texture is on for all quality levels. The coverage texture is present and set in the build.

    Any ideas about how to go about debugging this? Is it possible some feature or shader in my game is conflicting with the fog masking?

    Thanks!
     
  27. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Try disabling shader stripping and restarting Unity before making a new build.
     
  28. FuriousEX

    FuriousEX

    Joined:
    Mar 13, 2014
    Posts:
    51
    Thanks for the quick response. I tried unchecking all the Strip shader options in the URP global settings asset:

    image_2022-07-29_164927453.png

    Restarted Unity, cleared and rebuilt addressables and the game - no luck.

    Any other ideas?
     
  29. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    I’ll send you a sample project so you can try and compare settings.
     
  30. FuriousEX

    FuriousEX

    Joined:
    Mar 13, 2014
    Posts:
    51
    Thanks, please do. Also if you have any ideas on what I could try to narrow it down I’d appreciate it.
     
  31. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Yes. Put the Volumetric Fog plug-in in the main app. Shaders need to be part of it.
     
  32. FuriousEX

    FuriousEX

    Joined:
    Mar 13, 2014
    Posts:
    51
    Alright I added the VolumetricFog2DURP shader to the Project Settings -> Graphics -> Always Included Shaders list.

    It took quite a while to build those shaders, but it is working now.

    image_2022-07-30_220259212.png

    Is this the preferred solution? This bypasses all the shader stripping right?
     
  33. eduroam

    eduroam

    Joined:
    Jul 2, 2015
    Posts:
    48
    Hi. This fog system is compatible with URP - Using Deferred rendering in Unity 2021?.

    Regards
    Eduardo
     
  34. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Yes.
     
  35. Francoimora

    Francoimora

    Joined:
    Aug 1, 2013
    Posts:
    68
    Hi @Kronnect , when setting the noise to follow world position in manager and adding the fog volume as a child of my player game object (or the following camera), the fog "shakes" when its position is updated. Is it a bug or am I missing something in the configuration ?
     
  36. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Could be related to floating point accuracy. Is it too far from origin?
     
  37. Francoimora

    Francoimora

    Joined:
    Aug 1, 2013
    Posts:
    68
    Not especially, only few hundreds in x/z. I tried to round position so it only updates when units change and it helps, but it still randomly flickers to another position during one frame sometimes.
     
  38. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Ok, I’ll check and get back to you.
     
  39. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Hi there,

    We've been working on the next big iteration for Volumetric Lights 2 and it's here! Featuring Unity 2022 support (also 2020/2021), builtin + URP, translucent shadow maps and direct light casting, it's reimagining volumetric lighting.

    Here's an in-Editor glimpse of the new features:


    And the new promo video:







    Users of Volumetric Fog & Mist 2 can enjoy a discount purchasing this new asset. Existing users of Volumetric Lights 2 can upgrade for free if the purchase was recent (6 months grace period) or just pay a discounted upgrade price.

    Both assets, Volumetric Fog & Mist 2 plus Volumetric Lights 2 can be purchased together with the Fog & Lighting Bundle which is new as well.

    We're eager to see what you can create with this new update!

    Kronnect
     
    Last edited: Oct 4, 2022
    TerraUnity and wetcircuit like this.
  40. DrVive

    DrVive

    Joined:
    Jan 17, 2017
    Posts:
    3
    Does Volumetric Fog & Mist 2 work for URP when using SteamVR with the Deferred Rendering Path?
    Are there any issues with the asset when using Virtual Reality?
     
  41. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    It should work but since there're so many situations with VR SDKs and URP, you will need to check what configuration works better for you. If you have any issue, please contact us at our support forum.
     
  42. DylanF

    DylanF

    Joined:
    Jun 25, 2013
    Posts:
    55
    Looks good to me in openxr so far. Make sure and set Depth Texture Mode to "Force Prepass".
     
    Kronnect likes this.
  43. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,206
    @Kronnect Hey, does Volumetric Fog & Mist 2 support Desktop VR? If so, hows the performance? Also, are there similar features in this asset that's in Volumetric Lights 2?

    I'm looking for a desktop VR solution that has god rays for my terrain/trees along with fog and lighting volumetrics for dungeons, etc.

    Thanks!
     
  44. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Hi,

    It should work fine in Multi-Pass and Single Pass Instanced. And you can achieve the God Rays effect, yes. The builtin and URP version provide similar look although some differences especially in the workflow aspect. Performance-wise there’re tons of settings to tweak, on desktop VR should run at proper perf with the correct setttings.

    Regards
     
  45. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,206
    Thanks for the reply. Am I able to achieve similar effects like volume light coming from windows, light sreaming from the ceiling onto a treasure chest like in Volumetric Lights 2 with Volumetric Fog & Mist 2? I'm not sure if those 2 assets work together or I just need the one.
     
  46. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Yes, you can achieve similar effect with any of the two assets. Using Volumetric Lights you would add a Volumetric Rect Area light covering the room or building and that will do the trick (there's a demo scene included as shown in the presentation video).
     
  47. PiresFM

    PiresFM

    Joined:
    Oct 24, 2020
    Posts:
    2
    Any updates on ETA for HDRP version?
     
  48. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    No ETA yet for HDRP versions, sorry.
     
  49. Foxaphantsum

    Foxaphantsum

    Joined:
    Jul 5, 2013
    Posts:
    139
    Hello, just wanted to say this asset is amazing.

    I did run into a small issue. Sub Volumes don't seem to work for me no matter what I do. They just don't do anything. Is this a bug in 2021.3.15f1 and the latest version? Or am I missing a step not provided in the docs.

    upload_2022-12-14_22-11-23.png

    upload_2022-12-14_22-11-53.png
    When trying to change the City Fog Ground Profile I keep getting an error

    upload_2022-12-14_22-13-16.png
     
  50. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Hi! Since you posted in our Discord, we’ll continue this topic there.
    Regards
     
    Foxaphantsum likes this.