Search Unity

HDRP Linear Fog

Discussion in 'High Definition Render Pipeline' started by Vaarty, Jun 2, 2021.

  1. Vaarty

    Vaarty

    Joined:
    Feb 1, 2020
    Posts:
    1
    Hi,

    I'm using Unity HDRP for my project. I would like to add linear fog to it but I don't understand how the new fog works and it's way too complicated for what i want to do. (set height, volumetric or no..)

    I just want to set how far it starts and where it stops, like in URP, but I can't, and the result is very ugly.
    After researching, I found that what I wanted to achieve was a Linear Fog, but the component is depracated in HDRP. I don't know what I can do and I don't know if my question is clear. If someone can help me that would be nice. ^^"

    (sorry for my english)
     
    AntonioModer likes this.
  2. Ne0mega

    Ne0mega

    Joined:
    Feb 18, 2018
    Posts:
    755
    I want the same thing.
    It is very frustrating Unity made HDRP fog so scientific.
    Great for first person shooters, but what about other games?

    My game is top down, so my only choice is ugly foggy map, or sharp edges on the sides of the map, because there is no simple linear fog!

    I am sure there is some kind of hack I could try using non-world fog volumes, but why cant HDRP just have simple Linear fog? I dont need it to do volumetric light blocking, or hi-def ray-traced emissive photon scattering... ...i just need some parts of the map clear, and other parts of the map obscured, that's it... ..like plain old linear fog does.

    I remember using standard and URP years ago, and linear fog was literally a couple of settings. Now HDRP fog is super complicated... ....and ugly, and only applicable basically for first person shooters.
     
    KhoolWasHereIsPog likes this.
  3. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    I don't mind the high number of settings in HDRP, once you get used to it, it's nice.
    But yeah, fog could see some improvements. Like start and end distance from camera. There's the main setting which is density and distance based on camera, but it's not versatile -- can't quite get the results I want.
     
  4. Ne0mega

    Ne0mega

    Joined:
    Feb 18, 2018
    Posts:
    755
    I like the power of HDRP and volume settings, I am just highly annoyed at the fog. Everything else, so far, is good.

    It jsut grates me, because every months or so, I think maybe this time I;;g et the fog I want from HDRP, and after about 2 hours of fiddling with everything I can, I get all sorts of mad, and give up on good fog for my game in HDRP.
     
  5. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,811
    The problem is I couldn't figure out how to add it to an interior setting, it seems to be tied to lighting and my cave is very dark. The only thing it does for me is making the scene more black and I don't want that.
     
  6. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,811
    I think I found out how to do it. Just try these settings and turn off the volume fog then increase the exposure or emission of the color to get something similar to linear fog.

    Volume Fog.jpg

    Note, I noticed it's kinda expensive because it's tied to your volume fog quality settings so you will have to sacrifice a little bit of quality for performance. I still wish HDRP had a cheap linear fog solution.
     
    Last edited: Feb 24, 2022
    Wolfos likes this.
  7. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    HDRP fog is so bad. They kept gradient lighting, why not linear fog?
     
  8. bonickhausen

    bonickhausen

    Joined:
    Jan 20, 2014
    Posts:
    115
    Linear fog isn't photorealistic thus not important for Unity's shareholders.

    However, stay tuned for the next upcoming half-baked hair solution that will be presented in 2024 alongside the new tech demo to be then abandoned in a few months!
     
  9. liyonghelp7

    liyonghelp7

    Joined:
    Feb 22, 2024
    Posts:
    2
    disable the fog volume, use custom Postprocess Pass, inject after opaque and sky, write custom fog shader,
    your shader should ignore the sky pixels
     
  10. liyonghelp7

    liyonghelp7

    Joined:
    Feb 22, 2024
    Posts:
    2

    Attached Files: