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

    Alexey1B

    Joined:
    May 15, 2017
    Posts:
    26
    Yes, new clean project, scene 3, U2018.2.2f1, with single pass no effect, just as usual camera, with multi & sp instanced effect is ok
     
  2. tntfoz

    tntfoz

    Joined:
    Sep 29, 2016
    Posts:
    129
    Hey Thrawn75, thanks for getting back so quickly.

    Yeah the light beams (and other semi-transparent objects) are wiped when Render Before Transparency is disabled.

    I've sent you an email with a couple of screenshots are requested.

    Thanks!
     
    Kronnect likes this.
  3. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I'm pruning keywords (using your excellent Shader Control tool!), but can you give me some guidance on what I can prune in Volumetric Fog and Dynamic Fog? We're using both (VF for main fog, DF for distant/LOD fog).

    Volumetric Fog: We are NOT using Point Lights, Fog of War, Fog Void, or Fog Area.

    Dynamic Fog: Desktop Fog+Sky Haze shader

    I think I've pruned the VF shader correctly, but there are a lot of DF shaders in the list in Shader Control, so any tips would be much appreciated.

    thanks!
    Dave
     
  4. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    From Volumetric Fog & Mist you can prune: FOG_AREA_SPHERE, FOG_AREA_BOX, FOG_VOID_SPHERE, FOG_VOID_BOX, FOG_OF_WAR_ON, FOG_POINT_LIGHT0 FOG_POINT_LIGHT1 FOG_POINT_LIGHT2 FOG_POINT_LIGHT3 FOG_POINT_LIGHT4 FOG_POINT_LIGHT5

    From Dynamic Fog & Mist: FOG_OF_WAR_ON. DITHER_ON: same if you don't use the dithering option

    In addition to this, inside Dynamic Fog & Mist Resources/Shaders folder:
    - any shader starting with DFM* are material shaders which you can remove.
    - also anything starting with DFO* are versions for orthographic camera (can be also removed completely).
    - DFG* shaders: relate to one of the different fog variants keep DFGDesktop.shader and remove the others.

    Do not remove any .cginc file

    Regards.
     
  5. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    Hey am curious if it's possible to change how fog voids are rendered? I want to use the fog voids for objects where there will be no fog that are not the player, where fog will still be rendered when not within the fog void. Currently it renders as shown if set to something other than the player. Essentially there is no fog rendered at all in front of the fog void, even when outside of it. Curious if this would be a simple fix somewhere

    NoFogOnTopOfVoid.PNG
     
  6. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    The void is computed outside the main loop for optimization purposes as it works fine for the original use case a top-down third person view). The alternative is to move it within the main shader loop (and compare the ray-marching position in world space with the void center).
     
  7. led_bet

    led_bet

    Joined:
    May 5, 2015
    Posts:
    83
    Hi! Love the asset. Having a strange issue in the editor. I'm working in a fairly large scene (using Horiz[ON] to simulate massive amounts of land), in an ultra-wide resolution. I notice that after a few seconds of camera animation, the volumetric effect begins to jitter slightly, almost as if it's not sure where exactly it should be.

    Any insight on how to remedy would be great! Thanks.
     
    Kronnect likes this.
  8. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Hi! Could you please send us an email with a screenshot of your camera settings? Thanks!
     
    led_bet likes this.
  9. PDTokay

    PDTokay

    Joined:
    Jan 11, 2018
    Posts:
    5
    Am I blind or is the compatible sprite materials missing from SpriteFog?
     
  10. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    They should be present in VolumetricFog/Resources/Extra/Sprites folder.
     
  11. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Hi, when rendering into a RenderTexture in VR set Single Pass Stereo to OFF:

     
  12. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    is it still necessary to delete Volumetric Fog before updating to the latest version? We've added some assembly def files and moved VF to a different location in the project, and it'd be easier if I didn't have to delete it first...
     
  13. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    That's the "safe" method. It depends on the version you are upgrading. If it's not to old a simple import/replace should work.
     
  14. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Ok, thanks....that seems to have worked.

    Is the PPSv2 option for Dynamic Fog faster than the camera effect? And if so, do you plan to add a PPSv2 option to Volumetric Fog?
     
  15. tntfoz

    tntfoz

    Joined:
    Sep 29, 2016
    Posts:
    129
    Hi, would it be possible to up the maximum number of point lights supported in the Track Point Lights part of VFM from 6 to 12 (or even more)?

    Also would it be possible to implement a function call so I can force the point lights to update before the timer clocks?

    I have some lights in my scene that flash on/off at certain intervals and sometimes the VFM point light effect lags behind the light changing if I have the update interval set high for performance reasons. If I could force the VFM point lights to update when any of my lights change state, then that would be great! :)

    Thanks!
     
    Last edited: Aug 29, 2018
  16. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    I don't have a performance comparison at this moment (PPSv2 support is given for convenience and SRP support for those who're interested but not for performance reasons). PPSv2 support for Volumetric Fog & Mist is intended as well.

    Yes, that's definitely possible. Will be added in a future release (soon!).
     
    tntfoz likes this.
  17. tntfoz

    tntfoz

    Joined:
    Sep 29, 2016
    Posts:
    129
    That's great news - thanks! I also updated my query above with another part! :

     
    Kronnect likes this.
  18. Kronnect

    Kronnect

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

    Latest beta comes with two great new features or changes:

    1) Removal of the 6 point light limit. Now you can use 12 or even more point lights (configurable as a value in Shader Options).

    2) Ability to embed Volumetric Fog & Mist effect into another surface shaders. This allows fog on transparent objects without additional render passes.

    If you're interested in trying out the latest beta please sign up on our support forum on kronnect.com.

    Regards
     
    tntfoz likes this.
  19. tntfoz

    tntfoz

    Joined:
    Sep 29, 2016
    Posts:
    129
    That's awesome - just signed up on your forum :)
     
    Kronnect likes this.
  20. tntfoz

    tntfoz

    Joined:
    Sep 29, 2016
    Posts:
    129
    Hey @Thrawn75 I've just tried your latest beta version however even though I've set the shader to support 16 lights as a test, and then I set Max Point Lights to 16 as well, the Light Settings array never grows beyond 6. Even though there are more than 6 point lights in the scene, only 6 seem to be managed.

    Is there another setting I need to change to get this working for more than 6?

    Thanks!
     
  21. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Nope, it was a bug which was setting the Intensity Multiplier of the new light setting slots to 0. Manually changing them to 1 should work. However a new update (beta 4) is already available which addresses this issue and also fixes other cases. Try it :)
     
    tntfoz likes this.
  22. tntfoz

    tntfoz

    Joined:
    Sep 29, 2016
    Posts:
    129
    Alright just tried the new b4 update and it gives me this error when setting the supported point lights above 6:

    Code (csharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. VolumetricFogAndMist.VolumetricFog.TrackPointLights () (at Assets/VolumetricFog/Scripts/VolumetricFog.cs:4345)
    3. VolumetricFogAndMist.VolumetricFog.set_pointLightTrackingCount (Int32 value) (at Assets/VolumetricFog/Scripts/VolumetricFog.cs:1347)
    4. VolumetricFogAndMist.VolumetricFog.CheckPointLightData () (at Assets/VolumetricFog/Scripts/VolumetricFog.cs:4222)
    5. VolumetricFogAndMist.VolumetricFog.InitFogMaterial () (at Assets/VolumetricFog/Scripts/VolumetricFog.cs:2603)
    6. VolumetricFogAndMist.VolumetricFog.OnEnable () (at Assets/VolumetricFog/Scripts/VolumetricFog.cs:2190)
    7. UnityEngine.GameObject:SetActive(Boolean)
    If I set the count back to 6 the error goes away again. I deleted the previous VolumetricFog folder before installing the package, so it should be a clean setup. Note that I've an Oculus CameraRig where VFM is assigned to the CenterEye camera if that makes a difference? Thanks.
     
  23. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Hi, thanks for reporting the error. Will take a look into it. Since this is ongoing work, please post your error logs and details on the same beta thread you downloaded it. Regards.
     
    tntfoz likes this.
  24. tntfoz

    tntfoz

    Joined:
    Sep 29, 2016
    Posts:
    129
    Will do!
     
    Kronnect likes this.
  25. friuns3

    friuns3

    Joined:
    Oct 30, 2009
    Posts:
    307
    Hello great asset! but could you fix Fog Void please?

    From outside it looks fine
    upload_2018-9-15_19-18-13.png

    but if you go inside the fog, its looks broken
    upload_2018-9-15_19-18-23.png
     
  26. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Hi,
    Fog Void is a feature designed for 3rd person view (ie. top-down or RTS perspective).
    I'll add the option to allow it when viewed from inside the fog - please join our support forum on kronnect.com to try out the beta when it comes out.
    Regards
     
  27. friuns3

    friuns3

    Joined:
    Oct 30, 2009
    Posts:
    307
    ok cool i will keep look on that feature, very needed :)

    and is there feature like using color from cubemap? so could make effects like this
     
    Last edited: Sep 15, 2018
  28. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    @friuns3 regarding the void areas, a new beta is available on kronnect.com includes an option to improve the void effect when viewing from inside the fog. The cubemap effect might be achieved spreading around some colored point lights.
     
  29. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    If the beta would help me here happy to try that. Looking to make this work with a water shader but not sure your approach will work with it as it assumes a single shared material, which in this case there are a bunch of material instances. Plus it uses a vert/frag shader. Even if I converted your script to use the same property blocks the water does and assuming that would even work, that's a lot of data to set every frame. The water shader is already fairly expensive itself due to a material per chunk in each lod.
     
  30. friuns3

    friuns3

    Joined:
    Oct 30, 2009
    Posts:
    307
    Thanks a lot! now its working, exactly what i needed!
     
    Last edited: Sep 28, 2018
    Kronnect likes this.
  31. UnityRocksAlt

    UnityRocksAlt

    Joined:
    Dec 28, 2015
    Posts:
    157
    I want to be honest, I am confused between this and HX Volumetric Lighting. Can anyone including the developer(s) tell me advantages and disadvantages of both.
     
  32. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    I think it depends on what you need. Or maybe both assets will help you.

    Volumetric Fog & Mist is aimed to cast ambient fog or cloud effects over the entire world or on certain areas which you can mask or control by area, altitude, etc. You can define a clear area around the character (fog void) or enable the fog of war which let you control the transparency at different positions effectively occluding the visibility.
    You can stack or combine multiple fog areas, for example to create several layers of clouds, one more dense than others, or add custom animated fog effects on different zones. Additionally the fog can be influenced by lighting, like directional or point lights - you can have lot of point lights illuminating the fog - and also receive directional shadow. Spot lights are not supported.

    On the other hand, lighting solutions are generally focused on adding "substance" to the area of influence of light, like dust / particles and also height based fog. For example, a spotlight illuminating a dark room or scene can show animated particles or dust while that effect won't be visible out of the area of influence of the light. Maybe this is one aspect which is more different than Volumetric Fog & Mist.
     
    UnityRocksAlt likes this.
  33. UnityRocksAlt

    UnityRocksAlt

    Joined:
    Dec 28, 2015
    Posts:
    157
    Thanks you are correct, yours add depth to the fog no matter what, the other one doesn't add depth but just noise to screen. I will buy yours later definitely. It's in my wish list. The reason is because, my game will feel cluttery because of the angle of my game. Thanks.
     
    Last edited: Oct 2, 2018
    Kronnect likes this.
  34. UnityRocksAlt

    UnityRocksAlt

    Joined:
    Dec 28, 2015
    Posts:
    157
    I have your other asset Beautify, I realised it now. You must be one of those developers on Unity Asset Store where it is a requirement or a necessity because you offer features which Unity Devs can't be bothered. I am sorry, but I have to say this, why does Unity focus on VFX, etc when its collider system does not work properly, when its UI Masking does not work properly, DOES NOT PROVIDE deferred decals (only in Unity 2018) I think.

    Most of my assets are technical assets. I will buy yours on Black Friday if I have enough money by then.
     
  35. tntfoz

    tntfoz

    Joined:
    Sep 29, 2016
    Posts:
    129
    @Thrawn75 Can you offer some advice on how to setup an in-game object to create a hole in the fog around it?

    I've fairly dense fog in a scene, and I'm hoping to implement a helicopter that would clear away the fog where ever it is.

    Is that possible (and how should I do it)? Thanks!
     
  36. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Hi,
    You can use the Fog Void feature, for example:

    Code (CSharp):
    1. using VolumetricFogAndMist;
    2. ...
    3.  
    4.         VolumetricFog fog = VolumetricFog.instance;
    5.         fog.fogVoidPosition = new Vector3 (10, 10, 10);
    6.         fog.fogVoidTopology = FOG_VOID_TOPOLOGY.Sphere;
    7.         fog.fogVoidRadius = 50;
    8.         fog.fogVoidFallOff = 3f;
    9.  
    10.  
     
    tntfoz likes this.
  37. tntfoz

    tntfoz

    Joined:
    Sep 29, 2016
    Posts:
    129
    Thanks for your help - so if I add a script to the helicopter and set the fogVoidPosition value above to follow the heli transform is that okay?

    And will it work if I already have a fog void setup on the player's camera via the actual VFM component settings (i.e. does VFM support more than one void?)
     
  38. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Currently only one fog void is allowed, although some users have modified the shader to pass two or more positions and combine them.
     
    tntfoz likes this.
  39. tntfoz

    tntfoz

    Joined:
    Sep 29, 2016
    Posts:
    129
    Thanks for the info.

    I'll see what I can do at my end to mitigate a solution, although messing around with the shader is beyond my ability!

    :)
     
  40. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    I'll see if I can add that as new options.
     
    tntfoz likes this.
  41. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    I noticed that the fog distance is locked to maximum 2000. This way to close for flight simulators. I another post I saw that VolumetricFogInspector.cs has to be edited in order to increase this limit. However, the script does not contain any value of "2000" so I can't see what I am supposed to change.

    Also, changing the fog height stretches the noise vertically. Eventually it looks a bit like the northern light. I want to be able to set the thickness without the noise stretching. It would be great if you can add this feature.
     
  42. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    In current version you need to edit VolumetricFog.cs, look for these lines:+

    Code (CSharp):
    1.  
    2. [SerializeField, Range(0, 2000f)]
    3. float _maxFogLength = 1000f;
    4. ...
    5.  
    Instead of increasing that limit you may combine the effect with the Fog Haze option, use the Max Distance Falloff and/or combine it with Dynamic Fog & Mist for the far distant fog (which would be faster).

    When increasing the Fog Height you will need to also increase the Fog Scale parameter.

    Cheers
     
  43. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Thanks, I will try that. In order to reduce computing power required, is it also possible to use a large view distance but with a lower noise frequency? Sort of stretching it in the horizontal plane?
     
  44. UnityRocksAlt

    UnityRocksAlt

    Joined:
    Dec 28, 2015
    Posts:
    157
    Hi it's me again (the one who asked you about your Fog asset), I need your help, I bought your asset Global Snow.

    Firstly, it is amazing.

    Now in your sliders, there is altitude scatter, which scatters vertically (like lines drawn across screen). Will you please have a horizontal option, or an image mask to scatter since my game takes place down top down (25 degrees down, but camera is at a height) those issues pop up.

    I am sorry i had to post it here, since there is no Unity forum option there.
     
    Kronnect likes this.
  45. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Thanks, glad to learn you’re enjoying Global Snow.
    We can discuss the horizontal scattering or mask feature in Discord if you prefer, by email or on the support forum of kronnect.com which is better option than having lot of scattered threads.
    Cheers
     
    UnityRocksAlt likes this.
  46. UnityRocksAlt

    UnityRocksAlt

    Joined:
    Dec 28, 2015
    Posts:
    157
    I will reply here in few days with details, right now I am busy with texturing. Let me finish that, then I can fully discuss this. You are an active developer and also produce very high quality assets, which is one of reasons I decided to buy your Global Snow Product, because there was another Snow product called Screen Space Snow.

    The moment I realised it is Kronnect, I was like hurray.
     
    Kronnect likes this.
  47. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    btw, Global Snow 5.1 just got released - and it comes with new footage.. this time using Village Exteriors Kit from @S4G4N. Enjoy:

     
    Dwight_Everhart and S4G4N like this.
  48. roger0

    roger0

    Joined:
    Feb 3, 2012
    Posts:
    1,208
    Does your system work as a high altitude cloud solution?

    I am making a flight simulator and have been shopping for the right package. Yours look promising, but I havn't seen any videos displaying regular off the ground clouds. It looks like its mostly for fog and mist.

    How does your compare to this other cloud system?
    https://assetstore.unity.com/packages/tools/particles-effects/true-clouds-fog-mobile-pc-107379

    One issue I have been having and hoped that a cloud package would solve is modifying how particle billboards rotate with the camera. When my airplane does barrel rolls you can see all of the particle clouds in the sky rotating with it, which seems odd. I want keep the billboards facing the camera but keep their up and down axis the same, if you know what I mean.
     
  49. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Did you watch this video?

    You can place any number of cloud areas or chunks using this technique anywhere and at any height.
    Volumetric Fog & Mist does not use billboards, it's a true volumetric solution and it's great for local cloud formations which you can cross with your plane. Note it's not designed for mobile.
    Full skybox cloud systems usually make use of a sky dome (a sphere or half-sphere) around the scene which works great as a skybox but cannot be crossed - so I'd say you can combine both systems.
     
    wetcircuit likes this.
  50. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,906
    Hi all,

    This is a not very-well known use case of Volumetric Fog & Mist "Distance Fall Off" effect which can be used to open / close a hole or space on the sky at the camera position for a variety of reasons or gameplay effects:



    It's similar to Fog Void although keeps the borders more natural.

    Regards
     
    tntfoz and wetcircuit like this.