Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Enter the 2020.2 Beta Sweepstakes for a chance to win an Oculus Quest 2.
    Dismiss Notice

Volumetric fog?

Discussion in 'Graphics Experimental Previews' started by id0, Apr 20, 2018.

  1. Chaiker

    Chaiker

    Joined:
    Apr 14, 2014
    Posts:
    50
    Do you enable "support volumetrics" in HDRP asset?
     
  2. Nienna90

    Nienna90

    Joined:
    Jun 6, 2018
    Posts:
    5
    Yes, I have.
     
  3. wlad_s

    wlad_s

    Joined:
    Feb 18, 2011
    Posts:
    127
  4. GlitchInTheMatrix

    GlitchInTheMatrix

    Joined:
    Apr 12, 2010
    Posts:
    285
    anyone know how to add noise animation in the volumetric fog?
     
  5. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,432
    i believe (haven't tried that myself) you need to use the density volume and 3d texture volume (there's a tool to create that for HDRP)
     
    GlitchInTheMatrix likes this.
  6. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    546
    On the subject of animating fog, is there a way to programmatically define the fog density each frame? Perhaps with the Shader Graph?
     
  7. seanybaby2

    seanybaby2

    Joined:
    May 17, 2013
    Posts:
    112
    Any idea how to make a Density volume effect only a specific light, rather than an area of space?
     
  8. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    144
    I think you cant. There is no scattering masking or multiplier on lights yet :/
     
  9. seanybaby2

    seanybaby2

    Joined:
    May 17, 2013
    Posts:
    112
    Yeah, I think you're right. It's okay though I figured out a solution to my problem anyway. I just needed to change the bounds of a spotlight and I managed to change the source code of the LightLoop to do that.

    Any idea how to remove the ghosting effect that the lights are creating when I swivel them around quickly? I looked into a command buffer but frankly, I don't know where to start with that.
     
  10. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,439
    I've been mostly focussed on the VFX stuff in recent months so some of my memories of detail are starting to fade, but in regards to recent questions I was under the following impression:

    You can use 'volumetric dimmer' settings per light to change how much particular lights influence the volumetrics.

    Ghosting when moving lights is an inevitable side-effect of the volumetric technique used. Or to be more specific, the volumetric system makes up for relatively low resolution/visual quality by sampling temporally, ie across multiple frames. I think I saw a HDRP option to disable the temporal stuff for the volumetrics, but I am not 100% are about this, and the visual quality will almost inevitably suffer as a result.
     
  11. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    759
    Hi, you can disable Reprojections For Volumetrics in FrameSettings (in HDRP Asset or your current camera). There is no adjustment for settings, this problem is know and is hard to solve. We will try to do improvement in the future.
     
    seanybaby2 likes this.
  12. seanybaby2

    seanybaby2

    Joined:
    May 17, 2013
    Posts:
    112
    Hmm okay, thank you for this information. I'm having trouble finding the "Disable Reprojections for Volumetrics" option. Is this in a newer version of Unity HDRP? I'm currently using 2018.2.17f1. Should we switch to 2019?

    Thanks for the help SebLagarde.
     
  13. revanth611

    revanth611

    Joined:
    Dec 9, 2018
    Posts:
    1
    Pls say how you did this . pls.
    Im not getting the same results.
     
  14. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    144
    I have found a simple and hacky way how to make strong volumetric scattering for specific light source.
    1)We need to crank up light intensity. We will get strong volumetric effect but overexposed environment.
    2) We need to reduce emission dimmer parameter
    Done:)
    Scene without hack for comparison:
     
    Last edited: Dec 27, 2018
    seanybaby2 and thelebaron like this.
  15. kev42100

    kev42100

    Joined:
    Apr 17, 2010
    Posts:
    56
    Is it possible to have 2 directional lights on a scene + volumetric fog ?

    Here is my scene and its settings:

    A global scene settings and a local scene settings (green box collider trigger)
    2 directional lights
    upload_2019-1-11_20-48-54.png

    Both have "Volumetric Fog = Unchecked"
    upload_2019-1-11_20-49-25.png

    And a point light, volumetric Fog = true

    GLOBAL
    upload_2019-1-11_20-50-5.png

    LOCAL
    upload_2019-1-11_20-52-0.png


    The global scene settings rendering looks like to this:

    upload_2019-1-11_20-52-47.png
     
  16. kev42100

    kev42100

    Joined:
    Apr 17, 2010
    Posts:
    56
    When my camera enters inside the local settings volume:

    upload_2019-1-11_20-55-37.png

    My second dir light which lits the right side of my sphere disables itself automatically...


    In my HDRP asset, LightLoop.MaxDirLightsOnScreen = 16
    Lighting settings, all the options are checked.

    Any clue ?
    Thanks in advance !
     
    Last edited: Jan 11, 2019
  17. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    375
    Hi @kev42100 !
    Well, what you have here is a bug, thanks for reporting :)

    The issue here is not that you have two lights, but that one of the directional is pointing up. The volumetric fog applies attenuation to the direction lights, but was ment to lit thing "from the ground", not in space, thus was not expecting directional lighting to come from the ground :D

    While waiting for the fix, I suggest that you switch to an other light type.
     
  18. kev42100

    kev42100

    Joined:
    Apr 17, 2010
    Posts:
    56
    Thanks Remy_Unity, hope it will be fixed for the next release 2019.1 ;)
     
  19. GamdineProductions

    GamdineProductions

    Joined:
    Aug 18, 2016
    Posts:
    11
    Yes please
     
  20. Nigey

    Nigey

    Joined:
    Sep 29, 2013
    Posts:
    1,115
    @elbows loving the work on fluid/gas simulations using volumetric fog! Any chance there's a git repo kicking about with any of your stuff on it? I saw you said you might be making it public. I'm currently using Flex asset (https://assetstore.unity.com/packages/tools/physics/nvidia-flex-for-unity-1-0-beta-120425), but I'm super curious to maybe just grab the raw data of the fluid sim, and chuck that data into some volumetric bounds and use that to display fluid simulations and gas dispersion.
     
  21. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,439
    Thanks. Not available anywhere at the moment I'm afraid. Chunks of it need rewriting really, as at pretty much every stage I took shortcuts to get things working, I was punching above my natural programming weight and only learnt what I needed to get results, not nice clean tidy code etc.

    I still plan to share it one day, even if it doesnt get rewritten and tidied up. I've got a couple more features to add and a couple of projects of my own to do that use it, so unfortunately the sharing will not be very soon. And my hack to get it working with the HDRP density volumes is especially weak right now, I have to improve that and will be watching HDRP development closely to see if obvious opportunities to improve my method arise. Integration with the new VFX Graph is much cleaner, I didnt need to hack any VFX code to make that work.

    I should point out that my sim wasnt written from scratch, I rewrote the work of someone else, so that it used 3D rendertextures rather than compute buffers. So people with the right knowledge about compute shaders and these sorts of simulations could make their own similar system without a truly insane amount of effort. I happened to convert every part of the sim to use rendertextures, but to get results that can be made to work with volumetrics, you could just add an additional step to the end of the sim which writes the density data into a 3d render texture. This is what I used as a starting point for my sim: https://github.com/Scrawk/GPU-GEMS-3D-Fluid-Simulation
     
    Nigey and id0 like this.
  22. jiuweishenhu

    jiuweishenhu

    Joined:
    Apr 12, 2017
    Posts:
    5
    QQ截图20190429121949.jpg QQ截图20190429122043.jpg
    QQ截图20190429122651.jpg
    What happen to me??? HDRP 5.13 VolumetricFog
     
  23. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    181
    My volumetric fog always seems to fade to black (where the Antisotrophy value is high), is this expected, or is there a way I can change the colour it fades to?
     
  24. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    181
    Managed to fix it by adding the Static Lighting Sky script to the Render Settings and setting the Static Lighting Sky - ProceduralSky. Not sure why that effects it?
     
  25. josue16

    josue16

    Joined:
    Apr 24, 2017
    Posts:
    3

    Attached Files:

    • ds.JPG
      ds.JPG
      File size:
      52.8 KB
      Views:
      245
  26. yuliu616

    yuliu616

    Joined:
    Jul 24, 2018
    Posts:
    1
    I am using the VolumetricFog and want to access it in my script. For most of those parameters, by using the class "UnityEngine.Experimental.Rendering.HDPipeline.VolumetricFog", I could access and modify their value without issue. But one of the parameter "baseFogDistance" is just missing in the API. is it a not yet implemented function? (I am using HDRP 6.9.1)
     
  27. JulinoleumOne

    JulinoleumOne

    Joined:
    Nov 2, 2016
    Posts:
    13
    Can we increase the view distance of the density volume? Looks like its appearing only at a certain distance from the camera and playing with the fade distance or the fog distance doesnt solve the problem
     
unityunity