Search Unity

Volumetric fog?

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

  1. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    721
    Yes, I get it, blending 2 different scene settings are in no use 99% especially when we can have compositing fog types later. And with all the great features in HDRP, I can see the team is actively working on new features and improvements.

    But we need an official answer from Unity staff regarding local Scene Settings!
     
  2. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    721
    Also can we have the "Atmospheric Scattering" used in Blacksmith and Book of the Dead in native HDRP? We never achieved looks close to it using traditional exponential fog!
     
  3. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,453
    It is available in HDRP.
     
  4. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,287
    Maybe devil in detail on that one. eg if I remember properly there is a version of atmospheric scattering that evolved from the blacksmith demo but modified to work with HD in the Book of the Dead project. But the stuff built into the HD pipeline as the main, standard volumetric fog is a different system, and not quite what some people who are used to blacksmith atmospheric scattering are hoping for. But already my memory starts to get a bit, err, foggy about some of this detail so apologies if I got something wrong!
     
    hippocoder likes this.
  5. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,287
    Also if the past forum activity is any guide, I think it is usually better to ask questions intended for Unity HD pipeline development staff in the main scriptable pipeline feedback thread. eg Seb has been far more likely to reply to questions in that thread (but have to be a little patient as he tends to answer lots of questions in one go, not every day) than all the individual threads people start, including this volumetric fog one.

    Feedback Wanted: Scriptable Render Pipelines
     
    hippocoder likes this.
  6. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,453
    Fine. OK. You win the dad joke of the day :)
     
    elbows likes this.
  7. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,287
    Careful now, the scriptable pun pipeline hasnt been put on the official roadmap yet :D
     
    hippocoder likes this.
  8. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    280
    I just double checked : Local scenes settings are here and are working (and blending).
    But : Some parameters can't be interpolated. Like, the fog and sky type (how would you interpolate enums ?)
     
    TerraUnity and elbows like this.
  9. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,453
    It is the same for post process, non float values don't interpolate that well :)
     
  10. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,287
    Thanks for that reply which makes a lot of sense, and sorry for doubting whether Unity staff would respond here!

    Also sorry for my incorrect guesses earlier in the thread about whether any sort of blending was supported at all. People should probably pay attention when I warn that I dont know what I'm talking about with certain features :p
     
  11. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    721
    I said native HDRP, not the custom one that comes in BOD, try it and you'll see a lot of missing callbacks and stuff.

    Thanks, I'm actually stuck at defining volumes then, would you tell us how do you create volume objects? About interpolating, you are right but compositing different fog types is going to be implemented right?
     
  12. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    280
    The atmospheric scattering is implemented as the volumetric fog and the density volumes.
    For compositing volumetric + height based fog, Sebastien already aswered this :


    And for creating volume objects :
    • For scenes settings volume, you can use the menu : Game Object > Rendering > Scene Settings.
      • Each of them needs to have it's own settings profile
      • You must disable the "Is Global" toggle
      • You must add a collider (box/sphere/mesh) to define the volume shape
    • For fog density volumes and how to use the volumetric fog, please refer to this post : https://forum.unity.com/threads/usi...-features-in-2018-2-hdrp.541085/#post-3567940
     
    TerraUnity and elbows like this.
  13. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,287
    This is an opportunity for me to make clear that some of the information I put in this thread will become out of date over time, and a lot of it was from before a time when volumetric fog was in a package manager version, and/or before your official post went through all the steps in a comprehensive manner. So better for people to use official sources like that one than things I've said in the past!
     
    Last edited: Jul 31, 2018
  14. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    549
    They can be local, I guess some settings can't blend yet or might not be able to. They did say they plan to add support for both fog working together in the future.
     
  15. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,453
    And I am talking about native.
     
  16. Voldeath

    Voldeath

    Joined:
    Jun 7, 2013
    Posts:
    5
    Hello, I've been trying this stuff out and I'm having some pretty weird artifacts, any ideas?
     
  17. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    721
    Yes, aware of this but not comparable to the mentioned Atmospheric Scattering unless blended with other fog types for further viewing distances. Because the volumetric fog is mono-colored and all over the place lacking distance/height falloff.

    That's going to be nice but approx. release date? We plan to stick with official releases and not customizing source.

    Thank you so much for the complete answer, knew everything except defining the shape by colliders ;) tested it and everything works fine.

    Note: Regarding changing settings in HDRP asset, all settings were grayed out for me and I had to open it in a text editor through file explorer to enable "Increase resolution of volumetrics"!
    First had to uncheck the "Read-only" flag in file properties and then change line "increaseResolutionOfVolumetrics: 0" to "increaseResolutionOfVolumetrics: 1".

    Where is it then?
     
  18. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    721
    SunnyChow likes this.
  19. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,287
    Ah I think I know what has happened there. You have used the HDRenderPipeLineAsset that comes with the HD pipeline package. Files in that package are indeed read only.

    You are really supposed to create a new pipeline asset of your own(which contains all the settings) which then lives in your asset folder, and that you then drag to your graphics settings 'scriptable render pipeline settings' field.

    To create one of these settings files of your own, just right click in the assets project browser, the Create->Rendering->High Definition Pipeline Asset.
     
    TerraUnity likes this.
  20. Voldeath

    Voldeath

    Joined:
    Jun 7, 2013
    Posts:
    5
    That's the first thing I thought about but it doesn't solve the problem and the cost is huge in terms of performance, I think i'm gonna end up having multiple spots for each "crack" in the dome, hopefully it won't cost nearly as much and it can fake the same effect.
     
  21. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    721
    @elbows Thanks man, that was the exact answer I was looking for.
     
    elbows likes this.
  22. firsttry21

    firsttry21

    Joined:
    Oct 10, 2017
    Posts:
    8
    is it working from the package manager yer?
     
  23. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    549
    It's been working for a few months now
     
  24. partha-d

    partha-d

    Joined:
    May 28, 2018
    Posts:
    8
    Hi, Vapor is not working in HDRP. Can anyone help on it
     
  25. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,287
    You should not expect 3rd party assets to work with the new render pipelines unless they have been redeveloped to work specifically with these pipelines. These pipelines are a total change to the rendering side of Unity, it is usually not trivial at all to make older rendering/shading/lighting assets work with them.

    Also there is a large overlap between what Vapor does and the volumetric lighting that is built into HDRP. So why do you even want to use Vapor with HDRP?
     
    hippocoder likes this.
  26. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,453
    HDRP is a new renderer. All old stuff will not work.
     
    firsttry21 likes this.
  27. firsttry21

    firsttry21

    Joined:
    Oct 10, 2017
    Posts:
    8
    k thanks budy
     
  28. partha-d

    partha-d

    Joined:
    May 28, 2018
    Posts:
    8
    Actually not specifically on HDRP or LWRP. I want to use Vapor on my Custom Rendering Pipeline. So unable to call the Camera Rendering Events e.g. OnPreRender(), OnPostRender() or OnRenderImage() from RenderLoop
     
  29. glenneroo

    glenneroo

    Joined:
    Oct 27, 2016
    Posts:
    42
    Does anyone know if HDRP works with OpenGLCore (and Stereo 3D with Quadro cards)? I thought I read an older Unity blog that only DirectX is supported (can't find the link anymore). HDRP is now at version 3.0.0-preview and viewing the changelog or documentation gives a 404 so I don't know where else to look.

    I'm afraid to just try it out because I've already had problems with importing unfinished packages nuking my project.
     
  30. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,453
    https://github.com/Unity-Technologi...render-pipelines.high-definition/CHANGELOG.md

    and

    https://github.com/Unity-Technologi...wiki/High-Definition-Render-Pipeline-overview

     
    glenneroo likes this.
  31. ducker29

    ducker29

    Joined:
    Mar 15, 2015
    Posts:
    3
    But what if in scene settings fog type there is no volumetric type, only linear and exponential. project was create in unity 2017 and right now reimport to new version 2018.2.3.f1. any ideas?
     
  32. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    549
    Make sure you are using a version of HDRP that supports it. I recommend updating to the latest version of HDRP
     
  33. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    280
    Not latest. HDRP version 2.x are for unity 2018.2 and HDRP 3.x are for Unity 2018.3 . If you try to mix those you might encounter API compatibility issues.
     
  34. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,372
    18.3 are delayed isn't?
     
  35. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    280
    Yes it is, but an error was introduced and you can currently select the package version 3.0.0 in Unity 2018.2.
    While this hopefully still works, we don't recommend it.
     
  36. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,372
    Got it
     
  37. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,453
    HDRP 3.0 can't be downloaded using Package Manager for versions earlier than 2018.3 (even in staging?), due to the editor version check, thankfully, but it's still an issue for people who go directly to github.
     
  38. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,372
    Well i accidently download 3.0.0 via PackMan last week :p
     
  39. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,287
    3.0.0 can because Unity made a slight mistake, subsequent 3.x versions cannot.
     
    hippocoder likes this.
  40. ducker29

    ducker29

    Joined:
    Mar 15, 2015
    Posts:
    3
    Volumetric fog appear and works after install hdrp version 2.0.8. Thanks)

    And i have two questions about hdrp - what does it mean preview in fact? And is there any instruction for hdrp components setup?
     
  41. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    667
    It means it's still experimental, not ready for production.
     
  42. Matthew-Schell

    Matthew-Schell

    Unity Technologies

    Joined:
    Oct 1, 2014
    Posts:
    236
    hey, has anyone had issues getting volumetric fog and light working on 2018.3b7 with HDRP 4.1.0?

    I'll document what I've done so far in case this pops up on Google for someone else later.

    1) I've added a Scene Settings GameObject
    2) I've set the Fog Type in the Visual Environment component override to Volumetric, sky in my case is None (solid color) in case that's relevant
    3) I've added a Volumetric Lighting Controller component override to the Scene Settings
    4) I've added a Volumetric Fog component override
    5) I've tried various settings. Importantly I can see pixels changing in the Game view (shifting around slightly) but nothing that looks like fog or volumetric lighting.
    6) In case it's relevant I have a single Directional Light for sun and then a bunch of Rectangle lights which are spawned and placed at runtime procedurally, maybe 50 or 60 of them.

    These are the current settings, not working.

     
  43. Matthew-Schell

    Matthew-Schell

    Unity Technologies

    Joined:
    Oct 1, 2014
    Posts:
    236
    Update: The issue is that Area lights are not currently supported. And here is a checklist to check if it's enabled on github:

    https://github.com/Unity-Technologies/ScriptableRenderPipeline/wiki/Volumetric-lighting

    Thanks @laurenth-unity

     
  44. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    667
    When I place volumetric fog box dimensions and directional light, I get in every direction the same fog thickness. How to set a falloff so that closer to camera is low fog and the farther the camera thicker the fog.
    Something like this

    Red Dead Redemption 2.png
     
  45. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,372
    @Matthew-Schell wait how do we get 410 in b7? the latest i can find is 401
    @konsic : did you try changing anisotropy settings?
     
  46. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    667
    No, what does it do ?
     
  47. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,372
    Try it out, it doesn't hurt :D
     
  48. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    667
    This gives different feel to it.

    Is it ok if I put volumetric fog box dimensions for the whole scene with landscape ?

    The thing is I want to control where the fog is but if I place smaller fog boxes, there is visible cut between them.
     
  49. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    441
    Doesn't your "Base Mean Free Path" in the Volumetric Fog component need to be something around 0 - 10, rather than 1,000,000?
     
  50. Nienna90

    Nienna90

    Joined:
    Jun 6, 2018
    Posts:
    5
    Hello,

    I have been trying to get the volumetric lighting to work following this thread's guidelines over and over..

    no success.
    I am not really sure what I am missing. I did it with several different HDRP versions.
    Tried it on Unity 2018.2
    2018.3b

    and.. nothing.