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

    unity_dMztkup1zHAh6w

    Joined:
    Aug 1, 2020
    Posts:
    3
  2. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Unsure what could be, I noticed you're using a beta. Can you try creating a new project using latest public version of Unity (2020.1 and URP 8.2)?
    We tested it when 2020.1 was released and it should work correctly out of the box (if URP is configured with depth texture on):
    https://i.imgur.com/dhbvRNv.png

     
  3. nsxdavid

    nsxdavid

    Joined:
    Apr 6, 2009
    Posts:
    476
    @Thrawn75 Sorry, can't find forum thread for your Volumetric Lights, so posting here:

    I'm getting this error screaming when the volume in in view:

    RenderTexture.Create: Depth|ShadowMap RenderTexture requested without a depth buffer. Changing to a 16 bit depth buffer.

    It has no other info or stack.

    upload_2020-8-18_13-17-20.png

    Unity 2020.1
     
  4. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    URP or built-in?
     
  5. Kronnect

    Kronnect

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

    Excited to announce Dynamic Fog & Mist 2 as a free update coming to the Asset Store in a few days (yes, if you If you own a license of Dynamic Fog & Mist or Volumetric Fog & Mist you will be able to download this update for free).

    This update brings native URP support to Dynamic Fog & Mist, the lightweight/animated fog effect.
    Screenshot from demo scene 1 included in the asset:


     
  6. nsxdavid

    nsxdavid

    Joined:
    Apr 6, 2009
    Posts:
    476
    Built in.... it's related to the occlusion cam.
     
  7. PROTOFACTOR_Inc

    PROTOFACTOR_Inc

    Joined:
    Nov 15, 2009
    Posts:
    4,054
    hello @Thrawn75 ,

    Interested in purchasing this asset. My only question before pressing the instant buy button: any compatibility issue with Enviro that you may know of???

    Thanks for your time.
     
  8. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    They worked fine, at least some time ago -- this asset contains a few packages, Dynamic Fog & Mist and Volumetric Fog & Mist for built-in and URP as well, so there're many variants -- if you find any issue, don't hesitate to contact me. Thank you.
     
  9. PROTOFACTOR_Inc

    PROTOFACTOR_Inc

    Joined:
    Nov 15, 2009
    Posts:
    4,054
    Thanks for the quick reply ! gonna press buy!
    :D
     
    Kronnect likes this.
  10. PROTOFACTOR_Inc

    PROTOFACTOR_Inc

    Joined:
    Nov 15, 2009
    Posts:
    4,054
    pressed! :)
    Pretty happy with the results so far.
    However without diving into the documentation very deep, i'm not sure how to achieve an effect with some more noise in the fog. Something that could be achieve maybe with noise texture?? or maybe it's more of a particle fog effect?? basically I would want o have the fog not so linear looking but more in clumps or clouds. You had a video similar to that i think.
     
  11. PROTOFACTOR_Inc

    PROTOFACTOR_Inc

    Joined:
    Nov 15, 2009
    Posts:
    4,054
    something like this... not sure i was pretty lear i nthe description... lol upload_2020-8-24_11-16-1.png
     
  12. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    You could try using two or three layers of Volumetric Fog with different noise scales (or fog areas). The URP version also supports 3D textures which adds more variety as well.
     
  13. PROTOFACTOR_Inc

    PROTOFACTOR_Inc

    Joined:
    Nov 15, 2009
    Posts:
    4,054
    ha, stuck in built-in for that project... no 3d textrues in built in?
    Thanks for the tips
     
  14. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    No, we could add some support now that the URP version is out which supports it - why not signing on our beta forum on Kronnect.com, maybe we can work out something cool.
     
    PROTOFACTOR_Inc likes this.
  15. PROTOFACTOR_Inc

    PROTOFACTOR_Inc

    Joined:
    Nov 15, 2009
    Posts:
    4,054
    will do right now then
     
  16. PROTOFACTOR_Inc

    PROTOFACTOR_Inc

    Joined:
    Nov 15, 2009
    Posts:
    4,054
    tried your mountain climb demo scene. how did you achieve that cloudy feel?
    it feels pretty similar to the looks I'm going for?
     
  17. nsxdavid

    nsxdavid

    Joined:
    Apr 6, 2009
    Posts:
    476
    One should not confused a volumetric mist/fog with volumetric clouds (even low hanging ones). Two different sets of tech.
     
  18. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    @rosor A quick example of what you can get using built-in version and combining Dynamic Fog & Mist (for distance fog) and Volumetric Fog & Mist areas for the front "cloudy" formations.

     
    PROTOFACTOR_Inc likes this.
  19. PROTOFACTOR_Inc

    PROTOFACTOR_Inc

    Joined:
    Nov 15, 2009
    Posts:
    4,054
    this is pretty nice looking! :)
     
    Kronnect likes this.
  20. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    333
    Doesn't the new package support Orthographic cameras? I mean the fog is visible and everything but lightshafts aren't correct.
     
  21. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Do you refer to Volumetric Fog & Mist 2, built-in package right?
     
  22. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    333
    Oh sorry, yes!
     
    Kronnect likes this.
  23. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Can't send you a pm with the update. Would you mind contact me by email? Thanks.
     
  24. Disastorm

    Disastorm

    Joined:
    Jun 16, 2013
    Posts:
    132
    Hello. I noticed in the description of this asset it mentioned "create floating clouds which can be crossed.". Is this just kind of like use fog as a cloud or can this create volumetric clouds in the sky, and can it do this procedurally, or is this asset mostly just for fog use?
     
  25. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    You can create a floating fog volume at any position, yes - using scripting or from editor.
     
  26. Disastorm

    Disastorm

    Joined:
    Jun 16, 2013
    Posts:
    132
    Oh I see, does floating fog look the same as clouds in the sky like you'd see in real life if you looked outside? I guess you are saying to get cloud patterns and whatnot a script would need to be made to manipulate the fog from the asset?
    Also does this support single pass instanced in vr urp?
     
  27. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Yes, it just depends on how you deploy the cloud areas. Can't confirm Single Pass Instanced in VR / URP since this bug is still active: https://issuetracker.unity3d.com/issues/urp-depth-reconstruction-issue-with-matrix-i-v-p-in-vr
     
  28. Disastorm

    Disastorm

    Joined:
    Jun 16, 2013
    Posts:
    132
    oh I see thanks.
     
  29. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    Hello.

    I'm using Volumetric Fog and Mist (first one for the built-in renderer pipeline). I have an "isometric" camera as you can see here:

    I placed the fog small volumes on the edges of the screen as you can see on this gif. What I want to do is basically to make fog appear on the edges of the screen constantly. The ship will be moving by the tunnels "uncovering" the fog. I want the fog to be only on the edges of the screen though like you can see here:

    The problem is, with your global Fog I'm having the fog cover everywhere, and putting small fog volumes everywhere means I need to put too many fog volumes. Is there some solution to this.

    Here is the concept illustrating the same thing. The fog is at the edges of the tunnels and when you're sailing you uncover it.
     

    Attached Files:

  30. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    There're two alternatives to achieve that:

    1) Quick and easy: instead of creating fog areas, you could just use the Fog Void feature of the camera fog script. Assign your ship to the "Character To Follow" field and configure the size of the void area (this basically clears the fog around the ship):




    2) Want to have more control over which areas are discovered? Use the Fog of War feature. This feature let you control the transparency of the fog at any given position of the world. Call VolumetricFog.instance.SetFogOfWarAlpha() methods to clear the fog around any world position. You can check the demo scene Fog of War which uses a script attached to the character controller which clears the fog as the player moves around.
     
  31. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    Thank you, Fog Void seems to work for me, but if I use sphere to cut the fog then it cuts it disproportionally at the bottom of the screen(because with my isometric camera the bottom of the screen is just closer than the sides). Can I somehow make the topology a capsule rather than a sphere? Box doesn't really seem to work good too.
     
  32. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    You will need to tweak the distance calculation. This can be found in VolumetricFog.cginc. Look for this piece of code:

    Code (CSharp):
    1.      #if !defined(FOG_VOID_HEAVY_LOOP)
    2.          #if FOG_VOID_SPHERE
    3.             float3 wpos = fogCeilingCut + adir.xyz * (fogLength/adir.w);
    4.             float voidDistance = distance(_FogVoidPosition, wpos) * _FogVoidData.x;
     
  33. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    I decided to try Fog Void box topology again. How do I change rotation of that box? It seems to be rotated incorrectly
     
  34. Unityaware

    Unityaware

    Joined:
    Feb 14, 2014
    Posts:
    101
    I installed the plugin but it doesn’t appear as a plugin option under the camera. I uninstalled and installed it again, but it is nowhere to be found, no option to add it to the camera. I used it quite regular before und it worked before. Any other way of adding it to the camera?
     
  35. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    @Stickeyd Fog Void and Fog Areas use axis-alignted bounding boxes, so currently they can't be rotated although the shader could be modified to take into account a rotation when computing the distance to that box.

    @Unityaware the built-in version works as always, just add the script to the camera. However, the URP version works very differently, it's no longer a camera effect (although visuals are same). If you're using Universal Rendering Pipeline, please check the documentation (PDF) for step by step setup instructions. If you're not using URP, make sure you don't have errors in the console that could be preventing compiling the plugin.
     
  36. betaFlux

    betaFlux

    Joined:
    Jan 7, 2013
    Posts:
    112
    Hi, a not yet-owner here! I'm currently working on an open world game and would like to pimp the scenes with fog.
    My question is, is there something like a fog volume streaming functionality built in to VF&M? Something similar to Unity's terrain neighbour distance based auto toggle?
    I trust in the reviews and have seen the great results but I'm afraid in a pc game of the size of Fallout 4 it could become hard to maintain stable FPS with a few areas with dense fog without some tricks.
     
  37. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    That could be a nice to have feature indeed although currently there’s no automation. You can enable/disable fog areas as you would enable/disable a gameobject.
     
  38. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    Can you provide this as a demo scene? I am just not seeing results like this in URP.

    I have 2 fog volumes in the forest ahead, yet you can't see any clouds or fog in the forest at all.

    (https://i.imgur.com/LalgRLQ.png)
     
    Last edited: Oct 2, 2020
  39. 1Piotrek1

    1Piotrek1

    Joined:
    Mar 14, 2014
    Posts:
    130
    Does anyone have experience with running Aura 2 and this asset in the same scene? Does it work at all, are there any visual glitches, is choosing the volumetric lightning asset by the same author a better option?
     
  40. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    236
    Hi, I'm using built in renderer and I have a few questions.

    I'm looking for a fog effect that has no issues with transparent pixels from transparent materials, or particle systems or any other type of vfx for that matter. I have now a screen space fog shader and if there is a transparent pixel that does not have an opaque pixel behind it, it will be rendered behind the fog and become invisible. I assume this is no problem with volumetric fog?

    I have tried other volumetric fog assets and they have issues in scene view. Like if you disable scene light or post effects you can get a solid bright background color or annoying light strobing while the view is inside the fog. I hope this asset doesn't have this.

    How much control do you have over thickness of the fog over distance? Can you make fog that's completely opaque by the far end while still have some fog effect around the camera even in smaller fog areas?

    How well does this and your volumetric light asset work without lights? My scene is mostly lit by materials and ambient light.

    Can any post effect cause problems with the fog?

    That's it. Thanks.
     
  41. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    In terms of lighting you have plenty of control over it and you can me the fog shine even without scene lights.
    Regarding transparency support, there’re many options that can help from deciding the rendering order (before/after) to add a custom depth pre pass which works fine for objects like rivers or lakes, billboards, sprites, ..
    The only thing is if you want for before and after a transparent pixel - that would be tricky and maybe you need to use two fog instances, one that render before and other after although not sure how the final effect could result in this case.
    Also you can combine dynamic fog & mist with volumetric fog & mist so you have a thick far fog with more detailed/localised fog in the front.
     
  42. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    236
    In regards of this, this is something you do with the fog itself? I'm using a bunch of shaders for different effects, both for materials and for post effects and also many other things. Many of these are 3rd party and made through scripts or graphs or their own custom compiler so making changes to them would be tricky.
     
  43. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Yes, but not only fog but also any effect that relies on depth calculations as transparent shaders do not write to _CameraDepthBuffer. Also, even if they did, it's always tricky because you would need to render the effect before the transparent pixel, blend the transparent pixel and then add the fog again on top but considering only the segment from camera to the pixel. This is expensive so usually you just end rendering the fog before them.

    Here's an example:


    In the video I'm using two Volumetric Fog scripts attached to the camera.
    The first one has "Render Before Transparen" option enabled.
    The second one has it disabled (so the fog renders after transparent objects) but also performs a depth prepass on transparent objects (so it doesn't clip the transparent quad).
    The result is that you can see the fog behind and in front of the transparent quad while keeping some transparent colors in the middle.
    You can notice that when rendering just the one before the transparent quad, the resulting effect is not bad in this case.
     
    knas01 likes this.
  44. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    236
    @Thrawn75 Hey, thanks for taking time to show me this. :) One more thing though, does this effect look the same when the camera is inside the fog? Sorry for bothering you.
     
  45. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Yes.
     
  46. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    236
    Thank you.
     
    Kronnect likes this.
  47. einaros

    einaros

    Joined:
    Aug 29, 2018
    Posts:
    2
    I'm using Volumetric Fog & Mist v2 in a VR experiment, with Unity URP in 2019.4.14f1 (and have also tested 2020 with same results). I can't for the life of me get both eyes to look the same, especially so with long hanging fog, but the same goes for bigger fog.

    The VR setup is an Oculus Rift S, and I'm going with Single Pass Instanced. Multi Pass looks even weirder.

    I've speculated that it happens due to some weirdness with Ray Depth calculations in the shader, possibly related to UNITY_MATRIX_I_VP, but that's close to random guesses.

    The same thing happens in the demo scene, if you add a plane close to the top of the fog volume, and move the camera back some distance.

     
  48. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Yes, URP 7.4 or older has issues with UNITY_MATRIX_I_VP in VR. I got confirmation that URP 10.x solves this but have not tested yet.
    A workaround you may try is to uncomment the USE_OLD_RECONSTRUCT_API macro in CommonsURP.hlsl (check page 17 of the documentation for details).
     
  49. einaros

    einaros

    Joined:
    Aug 29, 2018
    Posts:
    2
    Cheers for the quick reply!

    I did try USE_OLD_RECONSTRUCT_API, but had no luck with it. Have you heard whether URP 10 will be retrofitted to 2019, or will that be for future Unity releases only?
     
  50. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    I think they’re not porting it back to 2019 but you may want to check in the URP forum (UNITY_MATRIX_I_VP support in VR).