Search Unity

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

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

  1. jason07

    jason07

    Joined:
    May 10, 2011
    Posts:
    33
    Hi,

    I recently upgraded the package to version 10.4 from version 9.6.2 and it seems the fog is ignoring the sun even though I assigned it in the inspector. I tried deleting and reimporting the package but that didn't help. I also tried using a different light and unassigning the sun and then assigning it again, but still no luck. Any help you can give is much appreciated! Thanks!
     

    Attached Files:

  2. Thrawn75

    Thrawn75

    Joined:
    Nov 16, 2014
    Posts:
    2,210
    Hi @jason07, could you please send me a screenshot of the full inspector settings? Thank you.
     
  3. jason07

    jason07

    Joined:
    May 10, 2011
    Posts:
    33
    Sure, I have attached the settings. Thanks.
     

    Attached Files:

  4. Thrawn75

    Thrawn75

    Joined:
    Nov 16, 2014
    Posts:
    2,210
    Since you have "Light Scattering" section fully disabled in Shader Options, fog diffusion is not applied so that can't be the problem. Also you have "Copy Sun Color" disabled so the fog keeps its own color.
    I wonder if it's just a camera order issue between Enviro and Volumetric Fog scripts?
    I just discovered that using downsampling Fog Diffusion is not computed - this has been fixed and it now applies with all downsampling levels. I'll send you an update so you can try the Light Diffusion option under Light Scattering section as well.
     
    Last edited: Jun 30, 2019
  5. friuns3

    friuns3

    Joined:
    Oct 30, 2009
    Posts:
    272
    Hi! is there way to set fog mode to exponential like in unity? i would like to use it with Fog Void Falloff

    upload_2019-8-4_16-3-34.png
     

    Attached Files:

  6. Thrawn75

    Thrawn75

    Joined:
    Nov 16, 2014
    Posts:
    2,210
    To make void falloff follow a curve instead of a linear gradient?
     
  7. friuns3

    friuns3

    Joined:
    Oct 30, 2009
    Posts:
    272
  8. Thrawn75

    Thrawn75

    Joined:
    Nov 16, 2014
    Posts:
    2,210
    Try this: edit VolumetricFog.cginc and insert this line just after the voidDistance calculation:
    Code (CSharp):
    1.             voidDistance *= voidDistance;
    so it reads like this:

    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;
    5.             voidDistance *= voidDistance;
    6.             voidAlpha *= saturate(lerp(1.0, voidDistance, _FogVoidData.w));
    7. ...
     
  9. friuns3

    friuns3

    Joined:
    Oct 30, 2009
    Posts:
    272
    Thanks it worked! Another question

    i have issue with billboards, fog gets drawn always on top (BETA: V10.1 B1)



    if i turn render before transparency it fixed the first problem but gets another one
     
    Last edited: Aug 4, 2019
  10. Thrawn75

    Thrawn75

    Joined:
    Nov 16, 2014
    Posts:
    2,210
    Enable the Compute Depth option and select "Tree Billboards":

     
    NeatWolf likes this.
  11. friuns3

    friuns3

    Joined:
    Oct 30, 2009
    Posts:
    272
    Cool thanks a lot!
     
  12. unity_c1ndWE1Nn46iPg

    unity_c1ndWE1Nn46iPg

    Joined:
    Jan 13, 2019
    Posts:
    148
    Hey. I added two volumetric fog scripts in one camera. One for the sun. The other for the moon. It’s fine for now. I don’t see any error warnings. Might there be a chance that it cause any trouble in the future?
     
  13. unity_c1ndWE1Nn46iPg

    unity_c1ndWE1Nn46iPg

    Joined:
    Jan 13, 2019
    Posts:
    148
    Does this system support Xbox one and PS4? Cause I will publish on both platforms
     
  14. Thrawn75

    Thrawn75

    Joined:
    Nov 16, 2014
    Posts:
    2,210
    It's not a common setup. Usually the camera only takes one script - and that script takes care of all fog areas. Some features may expect that only script is attached to the camera when looking for the main script. But if it currently works for you, then you're fine. It just may break or behave incorrectly for certain features.

    Some users use it on console, yes. However we don't own a console devkit so if you experiment any issue, please send me a pm or contact us and we'll take a look.
     
  15. unity_c1ndWE1Nn46iPg

    unity_c1ndWE1Nn46iPg

    Joined:
    Jan 13, 2019
    Posts:
    148
    Volumetric Fog eat 10 fps of my framerate when I use it with real time day and night UniStorm Weather System. I only use Dynamic Fog now :(
     
  16. unity_c1ndWE1Nn46iPg

    unity_c1ndWE1Nn46iPg

    Joined:
    Jan 13, 2019
    Posts:
    148
    Also the fogs seem to tremble between sky and any object.. it shouldn't happen because Unity default fog is fine. But now performance is a bigger problem
     
  17. Thrawn75

    Thrawn75

    Joined:
    Nov 16, 2014
    Posts:
    2,210
    Check out the manual for performance recommendations. In general, Volumetric Fog is quite performant but it depends on how you use it. Also having two scripts attached to the main camera is not optimal. You may need to remove one of them and see how it impacts performance.
     
  18. unity_c1ndWE1Nn46iPg

    unity_c1ndWE1Nn46iPg

    Joined:
    Jan 13, 2019
    Posts:
    148
    Only one script. Performance's still the same.. I will check it
     
  19. unity_c1ndWE1Nn46iPg

    unity_c1ndWE1Nn46iPg

    Joined:
    Jan 13, 2019
    Posts:
    148
    Hey, still don't know why the fog trembles?
     
  20. Thrawn75

    Thrawn75

    Joined:
    Nov 16, 2014
    Posts:
    2,210
    If your world is very large, it can suffer from floating-point precision issues (this is a common problem with any large world). In this case you may try enabling the "Big World AntiFlicker" option in the "Optimization & Quality Settings" section.
     
  21. unity_c1ndWE1Nn46iPg

    unity_c1ndWE1Nn46iPg

    Joined:
    Jan 13, 2019
    Posts:
    148
  22. Thrawn75

    Thrawn75

    Joined:
    Nov 16, 2014
    Posts:
    2,210
    That's quite normal terrain/world size. You should not have any issue. If you can send me a pm with a repro, I'll definitely check it out!
     
  23. unity_c1ndWE1Nn46iPg

    unity_c1ndWE1Nn46iPg

    Joined:
    Jan 13, 2019
    Posts:
    148
    Speaking of floating point issue, from what terrain size it's going to occur?
     
  24. unity_c1ndWE1Nn46iPg

    unity_c1ndWE1Nn46iPg

    Joined:
    Jan 13, 2019
    Posts:
    148
    My biggest map will be 18000x18000. 1500x1500 that's my fist map
     
  25. Thrawn75

    Thrawn75

    Joined:
    Nov 16, 2014
    Posts:
    2,210
    It depends. Flickering is a general issue due to depth buffer limited precision. The near clip plane greatly determine the amount of flickering you can get from, for example, shadows. A near clip plane below 0.3 will cause shadow flickering beyond just 5km.
    The "Big World AntiFlicker" was introduced to reduce flickering in a scene of 50km due to matrices multiplications in the vertex shader. Just try the option and see if that helps - if not, then the flickering is not related to that.
     
  26. unity_c1ndWE1Nn46iPg

    unity_c1ndWE1Nn46iPg

    Joined:
    Jan 13, 2019
    Posts:
    148
    So only 18km will not cause much of a problem? I mean other issue other than yours. There's two town in my 18km world. I wonder if there's other issue I might run into. You, as a professional, can you give me some tips?

    -Thank you
     
  27. Thrawn75

    Thrawn75

    Joined:
    Nov 16, 2014
    Posts:
    2,210
    You can search around these forums for tips on managing big terrains/worlds. You could slice your terrain/world in chunks and load/shift them dynamically. Try to keep the action near zero position if possible. As a rule of thumb, don't load what's not needed. Apply distance fog (and disable what's out of view), use LOD and billboards, leverage gpu instancing. Those are usual tricks. Probably you could find better tips in forums from world-building tools.
     
    unity_c1ndWE1Nn46iPg likes this.
  28. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    412
    unity_c1ndWE1Nn46iPg likes this.
  29. unity_c1ndWE1Nn46iPg

    unity_c1ndWE1Nn46iPg

    Joined:
    Jan 13, 2019
    Posts:
    148
    Thank you, both of you! Haha just bought the asset
     
    Thrawn75 and atomicjoe like this.
  30. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    170
    atomicjoe and Thrawn75 like this.
  31. Thrawn75

    Thrawn75

    Joined:
    Nov 16, 2014
    Posts:
    2,210