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. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Well, you can place any number of fog areas floating around but they'll be aligned to the horizontal plane (even being elipsoids). If your planet is spherical, it's not going to look correct on the left/right sides of the planet for example.
     
    rubble1 likes this.
  2. ludum_mubul

    ludum_mubul

    Joined:
    Dec 9, 2016
    Posts:
    27
    Any ETAs, when hdrp version will be available?
     
  3. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    Had two questions:

    1. Is it possible to configure this asset to use built-in deferred depth buffer instead of using its own independent depth texture? My priority is to get nice intersections with scene geometry and I don't need to calculate depth for any nonstandard objects like tree billboards, so built-in depth buffer should theoretically fit the bill.

    2. Is it possible to insert this effect between stages of standard v2 postprocessing stack, allowing finer control over when exactly it is blended? Neither of the two out of the box options seem to work for my use case:

    - "Render Before Transparent" makes the fog draw early enough to be affected by fullscreen effects like color grading and blur. However, it renders behind particles which is far too early, so I can't use that mode without creating some visual issues (e.g. explosions on the ground will always render on top of fog/clouds floating above that ground).
    - Turning that option off makes the fog draw far too late, well after postprocessing effects - it's not picked up by blur, gets uncorrected color etc.
     
    Last edited: Jul 24, 2021
  4. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    In deferred, the depth texture used by the asset comes for free from the g-buffer rendering so yes, it's already using the g-buffer depth buffer. Only objects rendering in the opaque queue <= 2500 will be included in the depth buffer. That's why the asset allows you to optionally include transparent objects in a custom depth pass which is used (in addition to the opaque depth texture) to compute fog accumulation with distance.

    The version of Volumetric Fog & Mist for built-in is a full screen image effect which is limited to 2 injection points (before transparents or after rendering has completed). Since Post Processing Stack v2 renders before image effects there're two options to get the fog affected by PPSv2:
    1) Enable the option "Render Before Transparent". As you mention, this will make every transparent object render on top of fog which is usually undesirable.
    2) Add a children camera to your main camera and move the Post Processing Layer component to this second camera. Set this camera Clear Flags to "Don't Clear", Culling Mask to "Nothing" and Depth to 1+ depth of the parent camera (to ensure it renders after tha main camera).

    (btw, the URP version of Volumetric Fog & Mist works quite differently as it's not a screen image effect but a world-space object that renders in the transparent queue and allows you to specify a custom render queue so it gives a bit more flexibility.)
     
  5. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    Thank you for the quick response, this cleared things up for me!
     
    Kronnect likes this.
  6. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Hi community!

    Happy to announce Volumetric Fog & Mist 6 for URP is now available (included in the Volumetric Fog & Mist 2 bundle) with support for native URP spot and point light shadows (as well as directional of course):



    Check it out and show how it goes in your project! :)
     
  7. zhuxian1guo

    zhuxian1guo

    Joined:
    May 10, 2018
    Posts:
    13
    When I use URP cloud effect on Android phones and VR, I can't see the cloud. I can see it in the unit editor, but I can't see the cloud effect after packaging
     
  8. zhuxian1guo

    zhuxian1guo

    Joined:
    May 10, 2018
    Posts:
    13

    the Unity version is 2019.4.26f1C1
     
  9. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Make sure you have Depth Texture option enabled in all URP assets listed in Project Settings / Quality section (Low, Medium and High-Quality URP assets).
     
  10. zhuxian1guo

    zhuxian1guo

    Joined:
    May 10, 2018
    Posts:
    13
    yes
    Depth Texture option enabled in all URP assets listed in Project Settings / Quality section (Low, Medium and High-Quality URP assets).
    upload_2021-8-14_16-45-49.png
    upload_2021-8-14_16-52-27.png
    upload_2021-8-14_16-52-35.png
     
  11. zhuxian1guo

    zhuxian1guo

    Joined:
    May 10, 2018
    Posts:
    13
  12. zhuxian1guo

    zhuxian1guo

    Joined:
    May 10, 2018
    Posts:
    13
    I package a exe program and When i dont use VR open the program the cloud is there,
    But When I use vr and Open the exe program the Cloud effect in VR disable ,idont see anything
     
  13. zhuxian1guo

    zhuxian1guo

    Joined:
    May 10, 2018
    Posts:
    13
  14. zhuxian1guo

    zhuxian1guo

    Joined:
    May 10, 2018
    Posts:
    13
    upload_2021-8-14_18-1-35.png
    upload_2021-8-14_18-1-45.png
    the win Stereo Rendering Mode ,single pass will See the Cloud Effect
    But mutipass dont see the Cloud
    upload_2021-8-14_18-3-1.png
    upload_2021-8-14_18-3-9.png
    andorid setting all of the Settings , I dont See the Effect
     
  15. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
  16. zhuxian1guo

    zhuxian1guo

    Joined:
    May 10, 2018
    Posts:
    13
    Thank u very much!! the Q is over
     
  17. zhuxian1guo

    zhuxian1guo

    Joined:
    May 10, 2018
    Posts:
    13
    And one more Q is the GameObject in vr have bad effect like Ghost dispersion
     
  18. zhuxian1guo

    zhuxian1guo

    Joined:
    May 10, 2018
    Posts:
    13
    And one more Q is the GameObject with Cloud in vr have bad effect like Ghost dispersion
     
  19. zhuxian1guo

    zhuxian1guo

    Joined:
    May 10, 2018
    Posts:
    13
    when i move in vr the Gameobject with Cloud have black outline
     
  20. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Do you have any other post processing effect, like temporal antialias? Feel free to contact us by email for further help (please include a repro as it's always useful to better understand the issue).
     
  21. zhuxian1guo

    zhuxian1guo

    Joined:
    May 10, 2018
    Posts:
    13
    post processing effect i use default Post
    upload_2021-8-16_17-13-49.png
     
  22. zhuxian1guo

    zhuxian1guo

    Joined:
    May 10, 2018
    Posts:
    13
    post processing effect i use default Post
     
  23. theghostronaut

    theghostronaut

    Joined:
    Jul 27, 2018
    Posts:
    41
    Hi there, is it possible to turn off the effect in Scene view?
     
  24. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    The built-in version has an option in the inspector to toggle the effect visible in the SceneView.

    In the case of URP version, just tick the eye icon in the hierarchy to toggle the fog volume visibility in the Scene View:

     
  25. theghostronaut

    theghostronaut

    Joined:
    Jul 27, 2018
    Posts:
    41
    Ah, of course. Thank you!
     
    Kronnect likes this.
  26. Doomchecker

    Doomchecker

    Joined:
    Apr 5, 2021
    Posts:
    109
    Hi,
    I want to have distant fog so the camera won't see behind a certain distance (with fading in slowly to the camera).

    What would be the best approach, should I just attach a fog volume to the camera and move around with it?

    Or should I prefer Unitys fog solution in this case?

    Thanks.
     
  27. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    I guess you refer to the URP version right? You could create a big volume although for a far fog effect you would get faster results using Dynamic Fog & Mist which is included with your purchase (you can get it for free):
    https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/dynamic-fog-mist-2-48200
     
    Doomchecker likes this.
  28. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845

    I seen the first version I had for years is now, no longer being supported, due to this version being out now? which is fine, I used the first version for a long time, but I had held off, wondering about the HDRP version..

    I wish you had all of these versions as one, I hate buying one only to find there is another version, this Unity 3 rendering crap drives devs mad..... It should have one, I know that isn't your fault, but...when buying it makes some of us, hold off until we know what is going on, so we aren't wasting money on something we may not need.

    So I seen other ask, but I have yet to see a reply, are you making a version for HDRP??

    I have the beatify, 2 HDRP , so waiting to see if you are planning one for Fog or if I need to look else where for HDRP?

    Let us know.
     
  29. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Hi! The first version (or version for built-in pipeline) is still supported. Both this one and the URP version, are included in the Volumetric Fog & Mist 2 asset. We decided to deprecate the old asset sice it was a bit of redundancy to have the same asset in two places on the Asset Store and because the asset has been live and evolving for 5 years now so it was time to move on and keep a single asset that contains the two package (built-in and URP versions). There's a free upgrade configured for customers that purchased the asset after March 2020. Otherwise the upgrade for old purchases has a 50% discount.

    Some assets require minor modifications to work with these two pipelines but in the case of Volumetric Fog & Mist 2 they're completely different implementation yet producing almost identical effects. So they're different code-bases. Also there're some features that are available in the URP version that're not present in the built-in version like 3D noise or terrain fit.
    Ideally every rendering pipeline could be either bundled or as a separate package with some upgrade options. As we understand that URP is trying to get in parity with built-in for an eventual substitution (in a far future), we are just, for simplicity, including both built-in and URP versions in the same asset. So you can switch between the two in your different projects as you make this journey/transition of rendering pipelines without having to worry about the time to switch from built-in to URP and what to purchase and when.
    However, we see HDRP quite different so our HDRP assets are currently sold separatedly.

    We have an internal beta for HDRP but it's not ready and I have not an ETA yet for the release, sorry.
     
    Recon03 likes this.
  30. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845
    Ya I have no issues with you shutting down version 1, I used for about 4-5 years. I got my money worth. So no biggy for me. I own most of your assets over the years, but I did buy BEATIFY, 2, and ended up finding out, it was the wrong version, since HDRP was a different asset.

    So with the FOG one, I been holding off, as I was unsure, if you planned to release, on its own as well, or if it was going to be a part of the main version.

    I see many devs waiting it out since HDRP has been a mess, which is not your guys fault clearly, but I seen some devs, they will release built in, and URP, only to not release HDRP right now. so, I didn't want to buy the wrong version again.

    Right now, Beatify 2, is useless to me, and I been not able to use. since I bought the URP version/built in. Which is not a big deal, but still, I was like crap I have the wrong one when I went to use it lol.

    So I need to buy the other which is again is fine, but I don't use Unity much these days, since I retired and now I been buying less from the store, I let the kids mess around now with assets and such, so, I had to cut back on buying from Unity asset store,

    SO I want to be clear, on your plan. So I will wait then for the HDRP version for Fog.:) Thanks for that info.,

    PS: I own the Liquid Pro one, are you making an HDRP for that too?


    right now I cant use any of your assets since there is no HDRP and that is what the kids are playing with.. They been messing with mobile as well, so I did tell them, they can use URP or built in one for that. Unity has made a mess of things, this 3 rendering versions, is just the worst I ever seen in any game engine...UGH
     
  31. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845

    ya I had to make a few different shaders, this is kinda like mobile , console, PC games we had to make different effects in the old days, for each platform so that is what this reminds me of.
     
  32. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Eventually I think, yes. Can't say when because there're other works in the queue.
     
  33. Doomchecker

    Doomchecker

    Joined:
    Apr 5, 2021
    Posts:
    109
    Hi,

    is it possible to add volumetric fog and/or light into a prefab to instantiate it at runtime (can't get it to work)?
    Or is it possible to add preconfigured volumetric fog and/or light to a scene at runtime?

    I'm asking for a procedurally generated world.
    Thanks for helping out!
     
  34. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Hello!
    Are you referring to the URP versions? Yes, of course. You should be able to just make a prefab from any volumetric fog/light and reuse it.
     
    Doomchecker likes this.
  35. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    Is there somewhere where I can see the full update changelog for Volumetric fog and mist 2?
    The asset page only shows you the latest one.
     
  36. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Check the README file included with the asset.
     
  37. DragonFist22

    DragonFist22

    Joined:
    Mar 28, 2018
    Posts:
    14
    Can't seem to get fog or mist to render in play mode. Shows in scene view. But not in play mode.

    I'm in 2020(LTS) with built-in. I attached the script to the camera and choose a profile and loaded it.

    I tried installing Post Processing in case that was needed but not go.

    Tried running demo scenes to see if it worked in those, but couldn't get them running due to the reliance on the old standard asset TPC.
     
  38. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    The asset has been tested with latest LTS on both Windows and Mac. Please try the steps in the video below (in built-in pipeline):


    Regarding the demo scenes, the required package which is the old standard assets, is included in the demo scene. If you import it, and then the demos package, they should work perfectly in latest LTS (tested). But, since it's the old standard assets package, you may want to do this in a new empty project just to get used to the different options of this asset so it doesn't affect any other copy of your standard assets (if you use it). Anyways, you should see if there's any "collision" or version discrepancy with your own package when you double click the standard assets package iin the import window.
     
  39. DragonFist22

    DragonFist22

    Joined:
    Mar 28, 2018
    Posts:
    14
    I'll check the steps in the video once home.

    As for the standard assets, I installed them from the installing in the package and the demo installer, and Unity kept throwing errors regarding the input class not existing (Don't remember the exact name but something like CrossPlatformInputManager)
     
  40. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Right, the demos make use of the classic Input system. Those are just demos so if you can't use them in your project either import them in an empty project that uses the default/classic Input system for testing the asset purposes or just ignore the demos.
     
  41. DragonFist22

    DragonFist22

    Joined:
    Mar 28, 2018
    Posts:
    14
    Okay, I figured it out. It turned out to be that there was another camera in the scene that was buried in a prefab and was taking over rendering.

    My new issue is that my scene is full of point lights, using the point lights settings, I can get them to show in the fog but if the lights are not in the fog volume, they no longer work. The use case is creating floor fog.
     
  42. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    The lights will illuminate the fog as they enter the fog volume… outside, right - there’s no fog therefore the point light scattering effect is not visible.
    If you want a scattering effect around point lights regardless of the fog volume, you can use the Volumetric Lights asset.
     
  43. DragonFist22

    DragonFist22

    Joined:
    Mar 28, 2018
    Posts:
    14
    I don't want the scatter outside of the fog. I just don't want the lights to go out.
    Right now, if a point light is on the screen and there is fog on the screen but it is not in the fog, the point light produces no light.

    If the camera is moved so that there is no fog in view, the light turns on.

    I may be missing a setting or something for this.
     
  44. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    The asset doesn't toggle lights on/off, only adds the scattering effect through the fog. To help you further, please contact us by email and send a bit more info like which rendering pipeline are you using and a screenshot.
     
  45. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    @Kronnect Thanks for the assets, I'm having 2 issues right now
    1. Using a multiscene setup I can't get fog to display properly. I'm setting the "fogRenderer" programatically on other scene fogs that are on separate scenes. In the editor, those fogs correctly reference the main camera fog, but then nothing is displayed. Is there a manual refresh that can be done to ask the main Fog on the camera to take things into account ? Am I missing something ?

    In the editor I'm using a debug camera, this debug camera is the same prefab as the main camera. And it can display all the fogs correctly. On both the main and the debug camera fog instances are found, but only the debug camera shows the fog in the main view :
    upload_2021-11-9_10-57-52.png

    (1) Debug Camera and main active (2) Only main camera active. However the scene view displays the fog in (1) and (2)
    upload_2021-11-9_10-58-42.png upload_2021-11-9_10-58-59.png


    2. I then have a specific Fog that I want to use as fog of war, I'm using a similar technique to set the specific Fog of war to the fog of war updaters that are on the game units. This fog "fogRenderer" is also set to the main camera. Unfortunatelly without the first step I can't assess it's working. The fog is a fog area.

    I also tried to add "Fog of war hole" but it does not modify anyhting on the editor.

    upload_2021-11-9_10-54-52.png

    Thanks for your help
     
    Last edited: Nov 9, 2021
  46. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    Concerning the first issue. At runtime I only have one camera left with the fogs. But nothing is shown in the GameView although I can see the fogs in the Scene view

    [edit] ; At runtime, by Checking and then unchecking "Render Before Transparent" on the main camera fog, it gets updated. I'll look into the code to see what gets updated and try do it by hand.
     
  47. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Not 100% sure if this would fix that issue in your case (without a repro), but calling fog.UpdatePreset() should refresh any script-based change on the fog components.
     
    Whatever560 likes this.
  48. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    I'll try this.

    [Edit] : Unfortunatelly I don't have a result yet. Should I call fog.UpdatePreset() on the other fogs or only the one attached to the camera ?
     
    Last edited: Nov 9, 2021
  49. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    I can confirm that UpdatePreset() does not enable the fog (I made sure to create a debug button to call it when everything is loaded), The Render Before Transparent Check/Uncheck still works. That's pretty awkard as it seems that this flag has less operations done than the UpdatePreset().

    I'll try adding manually some of the operation made in the "Render Before Transparent" setter.

    [Edit] Adding fog.IsDirty = true did nothing to help.
     
  50. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    The following code works. That's kind of a mystery something to do with the function called in there ?.

    However I'm still investigating the 2nd issue. I can't get the Fog of War to work with my fog area, I saw that it was a supported feature.

    Code (CSharp):
    1.         [SerializeField]
    2.         private VolumetricFogAndMist.VolumetricFog fog;
    3.  
    4.         public VolumetricFogAndMist.VolumetricFog GetFog() => fog;
    5.    
    6.         public void OnEnable()
    7.         {
    8.             fog.renderBeforeTransparent = true;
    9.             fog.renderBeforeTransparent = false;
    10.         }
    [Edit] I can now use Fog of war holes in editor, I was just missing a Fog Of War texture. Tremendous asset, one of the best out there. I was able to resolve all my fog issues at once (Fog Of War, transparency and fog areas)
     
    Last edited: Nov 10, 2021