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

How to get volumetric light shafts without absurdly strong lights?

Discussion in 'High Definition Render Pipeline' started by Alan47, Dec 3, 2019.

  1. Alan47

    Alan47

    Joined:
    Mar 5, 2011
    Posts:
    148
    Hi,

    I'm working on a very simple corridor scene - just a hallway, some windows, the moon outside. What I'm trying to achieve is volumetric lighting in the form of light shafts coming in through the windows, as shown here:

    upload_2019-12-3_22-14-53.png

    This picture also shows my problem: I only ever get this effect if I turn the intensity of my directional light waaaay up (from 4 to over 5000). Of course, this causes all sorts of unwanted side effects and it can't stay like that, I just wanted to showcase the effect I'm looking for.

    My question is: how can I achieve light shafts as shown in the image, without cranking up the light intensity to extreme levels?

    I'd be thankful for any advice, I'm new to lighting.
     
  2. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,212
    Hi @Alan47

    To get effective volumetrics that are dense, you need to add a Density Volume (right click scene hierarchy, Rendering/Density Volume). This confused me in the beginning too, as you can't crank up that volumetric fog setting high enough and it's not meant to be used like that.

    But with that density volume you can make your fog almost solid.

    It might not give you additive looking volumetrics but you will definitely have proper volumetric shadows then etc.
     
    Univin likes this.
  3. Alan47

    Alan47

    Joined:
    Mar 5, 2011
    Posts:
    148
    Holy moly, that advice was spot-on! Thanks a lot :)

    upload_2019-12-3_23-16-58.png

    Look at those beautiful volumetrics, just what I was looking for!
     
  4. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    Wait, that doesn't seem right ?
     
  5. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,212
    @Alan47 Well how nice of you to start mocking people who try to help you.
    You can go find your help elsewhere, not going to get it from me. But it's definitely possible to get plausible looking volumetric light beams with HDRP, you just need to know how to read the manual. here's one simple quick example.

    volumetric_beams.png
     
    hippocoder likes this.
  6. Alan47

    Alan47

    Joined:
    Mar 5, 2011
    Posts:
    148
    @Olmi I was not trying to mock you, I was absolutely serious! It worked for me! I realized later today that my screen apparently is brighter than most displays. It's barely visible in the screenshot on my phone, but it looks fine on my desktop monitor.

    I was totally serious, it worked! Sorry if I left a wrong impression :/
     
  7. Alan47

    Alan47

    Joined:
    Mar 5, 2011
    Posts:
    148
    upload_2019-12-4_20-11-7.png

    Here's another shot to hopefully make it more obvious. The effect is subtle, but it is there, and much more noticable in motion. @Olmi thanks again, you really *were* on point, no sarcasm here :)
     
  8. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    It doesn't look right.
     
  9. Alan47

    Alan47

    Joined:
    Mar 5, 2011
    Posts:
    148
    That's really odd. The image looks fine on my desktop monitor, but way too dark on my smartphone display. Strong back-lighting really seems to do a number on this one... I'll try to adjust the brightness and contrast in my post processing and try again. It's really hard to fix a problem you can't see on your screen though. But I swear: the volumetrics look fine on my screen :)
     
  10. Alan47

    Alan47

    Joined:
    Mar 5, 2011
    Posts:
    148
    Here's a photo I took with my smartphone from my actual screen (a "screen shot" lol) just to prove that I wasn't trying to fool anybody. Here's what the pic I posted looks on my desktop:

    20191204_203324.jpg
    As you can see (hopefully), the effect is very much noticable on my screen. I don't know exactly why the difference between screens is so drastic in this case though.
     
  11. Alan47

    Alan47

    Joined:
    Mar 5, 2011
    Posts:
    148
    Here's what happened. I've got a gaming monitor for my desktop, and apparently it performs all sorts of image transformations - all on its own, and it's not just brightness and contrast. I didn't even know it can do that. When I took a screenshot, it resulted in the image as it was when it left the graphics card (OS level). What appeared on my screen was the image after post processing on the monitor device. I didn't notice because the same post processing was of course also applied when I uploaded the screenshot. I'm investigating how to turn off this post prcessing on the monitor.

    Sorry again for the confusion, I meant no offense to anybody.
     
  12. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,212
    @Alan47 Ok np, but it's bit hard to understand that it wasn't sarcasm etc. when you send image that is almost pitch black and has about 30-40% less volumetric effects visible than your earlier attempt... No wonder it causes confusion. Maybe it's time to check how to calibrate a screen and how you light your work environment.

    Anyway, let's move on. :)
     
  13. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    Grading will also play a large difference at the end as well.
     
unityunity