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

    Dan_G

    Joined:
    Dec 4, 2017
    Posts:
    24
    Are you using Built-in RP or URP? Which Unity version? I recently changed to the built-in RP and didn't have time to properly test it....
     
  2. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,685
    Latest beta fixes this issue. Could you please sign up on our support forum on kronnect.com to try it?
     
    Dan_G likes this.
  3. Diego_Graphics

    Diego_Graphics

    Joined:
    Nov 3, 2014
    Posts:
    147
    Looks pretty promising, is it somehow possible to make the whole thing compatible with the Curved World shader?
     
  4. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,685
    Hi, nope, the asset is designed for a planar world.
     
  5. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    144
    Hello, I currently have your fog asset and was wondering how well it is integrated with Enviro and is there any documentation on how to set it up?
    Does it work on both URP/Built-in?
    Thank you!
     
  6. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,685
    Volumetric Fog & Mist 2 comes with two packages, one for built-in and another for URP. Both assets provide a similar set of effects but their implementation is quite different, optimized for each pipeline.
    I can't advice about Enviro sorry - if you have any compatibility issue, feel free to send us a repro scene and we'll take a look.
     
    mick129 likes this.
  7. LogaNRV

    LogaNRV

    Joined:
    Jun 3, 2017
    Posts:
    29
    Hi, user of "Volumetric Fog & Mist 2" here..
    I have an issue with the latest patch 5.2, with the URP version (all was good with the previous version).
    I'm testing with Unity 2019.4.20.f1, with URP 7.5.3 and Windows 7.

    I started seeing this error when loading the scene, while starting or ending the game, and also while doing builds:

    fog error.png
    I replicated this in a small test URP project and the problem starts when I add a Fog Void object and run the game (notice that previous error is the first one here):

    fog error2.png

    The void is very simple and most parameters are the default ones:

    fog error3.png
     
  8. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,685
    Hi, we have replicated this issue. A fix is on the way...
     
    LogaNRV likes this.
  9. unleashed1911

    unleashed1911

    Joined:
    Dec 30, 2019
    Posts:
    10
    Hey there,

    Great Asset! Looks super dope.

    Ever since i imported it, i get these rather random Runtime Errors, resulting in Unity Crashing. Happens in the build also.

    Reproduce in 2019.4.21f1:

    Empty Scene with your fog in there.
    Run around like crazy with the FPS Controller of unity.
    Crash

    Is this maybe a known issue and i'm too dumb to find the solution?

    Greetings
     

    Attached Files:

  10. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,685
    There was an issue related to certain drivers of an AMD chipset that caused crashes in the URP version (not the built-in). This was fixed already sometime ago. Are you using the built-in or URP version? Does the player log include something that could be related?
     
  11. unleashed1911

    unleashed1911

    Joined:
    Dec 30, 2019
    Posts:
    10
    I am using the URP and the URP version and have an AMD chipset.

    Where can I find the player log?

    The console doesn't throw any error related.
     
  12. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,685
    Edit CommonsURP.hlsl and reduce the maximum number allowed of iterations (MAX_ITERATIONS). This is a maximum - the asset will use always lower iterations.
     
  13. unleashed1911

    unleashed1911

    Joined:
    Dec 30, 2019
    Posts:
    10
    There is no MAX_ITERATIONS in the CommonsURP.hlsl file.
     
  14. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,685
    Make sure you have the very latest version. You may need to clear the local Asset Store folder as the Package Manager had a bug which prevents getting the correct latest package.
     
  15. unleashed1911

    unleashed1911

    Joined:
    Dec 30, 2019
    Posts:
    10
    Allright, I found it.

    I keep you updated if there are anymore issues. Thank you!!
     
    Kronnect likes this.
  16. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    160
    Hi there,

    Is there any way to subtract something like a global noise when using the global fog ? So that there are only (random) cloud fields ?
    I´m working on a strategy game with random generated maps zoomed out far, so I cannot occlude certain points in the word manually or use volumes.
    Here is a quick photshop:

    upload_2021-3-22_13-9-41.png

    Maybe an idea for a future update ? :)
     
  17. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,685
    Hey,
    That seems a perfect use case for the fog of war option!
    This feature is available in both built-in and URP versions and let you control the fog opacity at any given position using scripting or a custom texture:

    Regards
     
  18. Elegarret

    Elegarret

    Joined:
    Feb 15, 2017
    Posts:
    17
    Hello there! I saw some people here asking about performance on Quest2, but didn't see any answers.. Can anybody confirm if this asset performs well on Quest2 or not?
     
  19. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,685
    Hi! We have not tested this asset with Quest 2 as this asset is designed for desktop-class GPUs and consoles (VR or not). It can be used in modern mobile devices such as the iPhone though as they have proven capable to run such kind of effects.
     
  20. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    160
    Thanks for the tip ! Haven´t thought of that and will try this for an overland map !

    But the downside for my project is, that the clouds are then covering fixed locations on the map, right ? This will work very good with static maps but my game has precedural generated landscapes. So the clouds will most likely cover points of interest a lot of the time.
    So, a request for further version / updates: Add a substracted, scaleable and scrollable noisemap. This way cloudgroups could move over the landscapes.
     
  21. AhmenX

    AhmenX

    Joined:
    Mar 22, 2016
    Posts:
    7
    Hello there! Since I added the asset to my project Unity crashes went attempting to build for WebGL. Have you encountered this before? Any advice on what I might be able to do?
     
  22. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,685
    Which Unity version? Builtin or URP? The asset works with WebGL on both pipelines. In builtin, make sure you disable any non used feature from the Shader Options menu.
     
  23. AhmenX

    AhmenX

    Joined:
    Mar 22, 2016
    Posts:
    7
    Built-in 2020.3 and 2019.4. Just disabled most shader options. It builds successfully! Keep in mind I wasn't able to build ANY scene in the project beforehand. Even if it didn't use any fog. The shaders being the problem makes a lot of sense! Thank you!
     
    Kronnect likes this.
  24. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    175
    Hi, I had thought to use Dynamic fog with Volumetric. I'd use the dynamic for background and volumetric for thicker areas such as clouds and mist banks. However, I can't get that to work. If Volumetric is installed it's impossible to add Dynamic fog. It adds Volumetric fog no matter which I choose to add.
    Are you not supposed to use both or is something wrong? I use the latest version with URP.
     
  25. Kronnect

    Kronnect

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

    They should work fine. Make sure you have the "Depth Texture" option enabled in the URP asset.
    I took the sample scene from Dynamic Fog & Mist 2 for URP and added a localized chunk of fog with Volumetric Fog & Mist 2 on a hill. Check it out:


    In the video above I used the Terrain Fit option to adapt the fog geometry to the terrain slope, set boundaries to sphere geometry with a wide falloff border and enabled 3D noise for better results. Low density as well so it looks more realistic.
     
  26. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    175
    @Kronnect No I think you misunderstand. When I add a dynamic fog volume from the gameobject menu it adds a volumetric manager and a volumetric fog volume. I have to manually delete the volumetric script from the fog volume and then add the dynamic fog script to it.
     
  27. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,685
    Yes, you're right - it was a menu integration conflict. The fix is now available. Please remove your previous Dynamic Fog & Mist version and import the update.
     
  28. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    175
    Thanks.
     
  29. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    175
    Hello again. I got a new issue with dynamic fog URP. I want the fog to be light around the camera and fully opaque at the max distance and the only settings that produce this effect require exponential density to be close to 1. However this creates a line in the center without any fog. I've spent many hours trying to get rid of the line but I can't do it without messing up the fogs density. What can I do?
    {4AFA6DE4-8E63-4395-9337-A2B45DF52BE8}.png {4BF926A5-D7F8-43EF-81A7-A38492F86781}.png
     
  30. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    260
    Hi @Kronnect ,

    Loving your asset so far! I was wondering if that's something you could add - and I think it's possible to easily implement this in the shader :

    I'd love to have a setting for a color by distance from camera, so that for example, I can make my fog closer to white for the far pixels, and darker if they're close.

    Thanks, have a nice day!
     
  31. Monil

    Monil

    Joined:
    Apr 24, 2012
    Posts:
    97
    I hope it will soon be compatible with built-in too..
     
  32. Philkrom

    Philkrom

    Joined:
    Dec 26, 2015
    Posts:
    69
    Hello

    I just bought your asset, tested all the demos and had a quick look at the doc.

    But I am a bit disappointed, because what I want to do seems pretty simple but I don’t understand how I can do it and none of the demo shows this feature.

    I am flying over a terrain + a skybox (cubemap) and I would like to generate a fog to hide the horizon’s borders of the terrain, “merging” the end of the terrain with the (cubemap) skybox, like in real life. I can do this with the native fog of unity, my concern is that you can determine only one fog color is the same, while the skybox colors are different at 360°. Is it possible, with your asset, to have a fog color depending on the skybox color ? I don’t see any reference about this feature ?

    It seems that Kino fog (that made exactly what I want) https://github.com/keijiro/KinoFog doesn’t work anymore.

    Best regards, Phil
     
  33. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,685
    Hi Phil,
    What you want is an effect that blends geometry with skybox color based on distance, right? That's a different kind of fog implementation (even they can be named similarly). We can add this as an option, as this seems interesting, into Dynamic Fog & Mist which is aimed to deliver far/distance/height fog effects. Please contact us by email or use our support forum on kronnect.com to get access to the beta and give it a try when it's ready.
    Regards
     
    Philkrom likes this.
  34. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    175
    Hi, I tried to create an effect of distant water/mist flowing vertical, but changing the Y speed does nothing. Well, it seems to only scroll detail noise, but that does not look good at all in motion and it doesn't work when the volume is thick so it's probably unintentional.
    Since you can't rotate volumes is there a way for me to do this?
    Also, is there a way to scale the noise texture based on axis?
     
  35. MonkeyPuzzle

    MonkeyPuzzle

    Joined:
    Jan 17, 2016
    Posts:
    97
    This is a really nice asset. I am trying to get it working with Aquas water, which has reflection, but the fog does not cover any of the water. Any ideas?
     
  36. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,685
    Hi. Since Volumetric Fog & Mist is a camera effect, it won't show up in other reflection cameras. However the URP version uses a real world object to render the fog effect so it should be picked up by the reflection cameras.
    btw, here's a setup for using the fog asset with Lux Water (which should also work for Aquas):
     
  37. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,685
    Hello,
    In URP, Volumetric Fog & Mist instances are scene-objects that render in the transparent queue. They should not affect any other object or material as the asset doesn't relate to that. Check the render queue of your objects and compare it to the render queue parameter in the fog inspector.
    Feel free to send us a simple repro/scene - we'll take a look.
     
  38. Smileys

    Smileys

    Joined:
    Feb 27, 2014
    Posts:
    55
    Kronnect likes this.
  39. RPowers

    RPowers

    Joined:
    May 14, 2015
    Posts:
    121
    Hi, this asset is awesome but I am having a strange issue. It seems like changing my game screen window size can cause my view to have noticeable lines (see image). By shrinking/expanding the width of my game view the lines get worse or go away depending on the game view dimensions. Also if I maximize my game view window the hmd view starts to have a subtle flicker effect which might be related. I'm using VR single pass instanced, Unity 2020.3.6f1, URP 10.4.0. I've tried every setting in the fog volume & manager, but nothing makes a difference. The only thing that makes a difference is the size of the game view window. Any idea how to fix this? Thanks.
     

    Attached Files:

    Last edited: May 31, 2021
  40. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,685
    Strange indeed. Could you please try reducing dithering and/or jittering settings?
     
  41. RPowers

    RPowers

    Joined:
    May 14, 2015
    Posts:
    121
    Ah ok, setting dithering to 0 hides the lines enough so it's not nearly as bad. Maybe part of the issue is that I'm on the original vive, so resolution isn't great, and those lines I'm seeing is the fog rendering differently on every other pixel. Also decreasing raymarch min step and increasing quality did help a little bit so it's looking pretty good now, so I'm all set. Sorry for the trouble, thanks!
     
    Last edited: May 31, 2021
    Kronnect likes this.
  42. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    931
    I have the built-in version and I would like to use the fog of war feature to delimit my levels so that they player knows where he can and can't go.

    I saw in the URP version there is a way to draw in the editor on a texture to determine where the fog will be. Is that available for the built in version?
     
  43. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,685
    Yes, the built-in version allows you to paint the fog in the Editor as well. The URP just adds the option to also paint with different colors.
     
  44. Smileys

    Smileys

    Joined:
    Feb 27, 2014
    Posts:
    55
    Hey - i have this weird visual bug when i use a plane with a water shader under the fog volume. It seems like when the camera crosses some line in the Scene, the shading "flips" like you can see in the attached images. In the first image everything looks as intended and in the second image, it almost looks like the water gets rendered on top of the fog. Any ideas how to fix this ?
     

    Attached Files:

    • 1.PNG
      1.PNG
      File size:
      53.9 KB
      Views:
      21
    • 2.PNG
      2.PNG
      File size:
      91.9 KB
      Views:
      20
  45. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,685
    If you're using the built-in pipeline, it's probably a depth issue. Check this video for how this can be solved:


    Another option (if the water is not transparent), is to place a solid quad just below the water plane or some geometry that writes to depth buffer but it's invisible (a shader with ZWrite On ColorMask 0 + a shadow caster pass should work as well).
     
  46. Smileys

    Smileys

    Joined:
    Feb 27, 2014
    Posts:
    55
    I am using URP - and there is no "Compute Depth" option in the VolumetricFog component. The Water shader is transparency based. However what is confusing me is that the "flipping" happens when i move the camera on the horizontal axis (in my case just the world Z value). Moving the camera vertical or in any other direction does not change anything.
     
  47. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,685
    In the case of URP, please check page 12 of the documentation (PDF) for some tips when working with transparent objects. If you still have issues (unsure what the flip issue is about), please send me a repro by email or pm.
     
    Smileys likes this.
  48. nitoh

    nitoh

    Joined:
    Mar 20, 2014
    Posts:
    30
    Hi.

    Can you please help me with void in fog: When looking from outside of the void, the objects that are in the void, are not efffected by the fog.

    Clipboard01.jpg
     

    Attached Files:

  49. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,685
    There’s an option inside the “Shader Options” section (button at top of Volumetric Fog inspector) called "Raymarched Void Area" which produces a better result when void areas are not viewed from top-down.
     
    nitoh likes this.
  50. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    84
    Hi @Kronnect , I'd like to place clouds around a globe/planet. I'd need the clouds to be a certain distance from the ground once you enter the atmosphere. Does this do that (i do see there's an option for subtracting volumes from each other, which could be an option)?
     
unityunity