Search Unity

Volumetric Light solution for URP?

Discussion in 'Universal Render Pipeline' started by BATTLEKOT, Feb 23, 2020.

  1. BATTLEKOT

    BATTLEKOT

    Joined:
    Oct 2, 2016
    Posts:
    179
    Hi there! I know that URP is pretty fresh, but if someone have or working on Volumetric Light solution for URP?
    I know that HDRP has own volumetric light, but what about less complex volumetric light and fog solution without density volumes so that will allow us to run volumetric light on low mid GPU's ?

    I'm just port project to URP and optimize whole content that give me a lot of performance resource that I want to waste on extra graphic features like AO (I saw from Unity GitHub they probably working on own solution for AO) and Volumetric light.
     
    OfficialHermie likes this.
  2. Tudor_n

    Tudor_n

    Joined:
    Dec 10, 2009
    Posts:
    359
    You'll probably go URP to go low-perf ( or high coverage ). Doubt volumetric effects are a common enough denominator at this point.

    That being said, we needed a cheap volumetric fog solution. Ended up writing our own ray-marched fog shader for it. You can control performance on lower-end devices by having multiple variants with different step counts. You can skip the whole (expensive) Perlin generation by using a single Perlin texture and a noise texture. Texel density can be kept quite low if sampling density with a random offset ( poor man's dithering ).

    There's a bunch of articles on ray-marched clouds/ fog.
     
    Last edited: Feb 24, 2020
  3. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
  4. BATTLEKOT

    BATTLEKOT

    Joined:
    Oct 2, 2016
    Posts:
    179
    thanks, but im looking for full volumetric light solution, like HX Volumetric Light or AURA 2.
     
  5. fearlesshyena

    fearlesshyena

    Joined:
    Apr 19, 2014
    Posts:
    6
    BATTLEKOT likes this.
  6. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,349
    My urp fog for Sky Master Ultimate was lately augmented with spot and directional light volume shadowing, though currently point lights dont cast shadows in urp which means wont give shadow to the volume. The system is in beta currently.

     
    Last edited: Jun 16, 2020
  7. BATTLEKOT

    BATTLEKOT

    Joined:
    Oct 2, 2016
    Posts:
    179
    its possible to render fog (white for at background) without 3d noise texture?
     
  8. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,349







    Sure, all parameters are adjustable
     
  9. projectorgames_unity

    projectorgames_unity

    Joined:
    Oct 15, 2018
    Posts:
    107
    Are these images from Skymaster Ultimate in URP? I just quickly imported it into a URP scene, and it's just magenta as far as the eye can see, and searching within the project for URP or Universal doesn't give anything back. Do I need to wait for the beta to become a proper release?
     
  10. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,349
    Hi,

    The urp is a separate download for all users, let me know the invoice and will send link asap.

    Note that due to how Unity created that strange pipeline system there is no way to get one system for all pipelines, is like 3 different engines and thus i decided to go with full conversion for hdrp and urp is separate projects, so the store one is standard and urp and hdrp betas downloads for users of the store system.
     
  11. mikeohc

    mikeohc

    Joined:
    Jul 1, 2020
    Posts:
    215
    @nasos_333 Is it possible to use baked lighting? How would it work in a scene with a lot of indoor lighting?
     
  12. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,349
    Sky Master ULTIMATE - Ethereal spot light volume with no layers selected in the light, volume is disabled


    Sky Master ULTIMATE - Ethereal spot light volume with one empty layer selected, light does not affect the scene, but volume appears


    Sky Master ULTIMATE - Ethereal spot light volume with all layers selected, both volume appears and light affects the scene in real time


    Hi, not at the moment, baked lighting cant be accounted for, the effect is full real time and will be applied to any real time lights over the baked lighting.

    That said, it might be possible to have the real time lights in the scene, but select nothing in the light layers option, so they do not affect the scene and render the volumes in the correct place of the baked lights as long as the lights used in baking are setup like that.

    I will do a few tests on this and get back to say if it is possible, because Unity may disable the light if no layer is selected, so in this case would not work.

    EDIT: I checked and it may work, you need to have at least one layer in the light, but i suppose the layer can be empty, so wont affect the scene and only the baked light will be applied. If no layer is selected the light is disabled, but can circumvent that with using an empty layer in the baked lights and enable them in scene.
     
    Last edited: May 15, 2021
    mikeohc likes this.
  13. mikeohc

    mikeohc

    Joined:
    Jul 1, 2020
    Posts:
    215
    Thanks for the reply, appreciate it a lot. I guess one major obstacle is the use of real time light in a scene that is completely indoors. There are no windows to illuminate the scene with natural light, like a bunker.

    Would "light popping" still be an issue if for every volumetric light, I have an extra baked light at the same position?
    So first, I'd use the baked light at the same position of the real time light to bake in light and shadow information. Then I disable the baked light and enable the real time light to achieve volumetric effects with accurate lighting and shadow information. Lastly, I'd apply this method to every light in the area.
     
  14. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,349
    You mean baked light be activated in the scene when game runs ? That could be a problem.

    But i assume if it does not illuminate the scene, could just use this light to create the volume, but cant say for sure as have not used lightmapping before and i am not sure on the setup of lights when running the game.

    I assumed that baked lights means there is no more Unity light in the scene for the baked.

    EDIT: I see you mean disable the lights used for baking, then not see why have light popping, also let me know what mean exactly by popping in case i understand something different
     
  15. mikeohc

    mikeohc

    Joined:
    Jul 1, 2020
    Posts:
    215
    The light popping I'm referring to is in forward rendering used in URP (Link). You can see this happening if you just create an empty scene with a cube and place over 8 lights I believe.

    There's a limit to how many lights a mesh can be lit by, so the popping comes when that limit exceeds.
    2021-05-15 10-12-40_Trim.gif

    My suggestion would be to bake all those lights to retain all lighting/shadow information on the wall. Then use the volumetric light afterwards. But I'm not sure if the flickering will occur for the volumetric light.

    Since the second photo of yours shows the volume without the light affecting the environment, I'd assume light popping wouldn't be an issue with the method I have suggested?

    CqKQOXt.jpg
     
  16. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,349
    My system supports 6 local lights out of the box for performance reasons, so you would always be less than the URP max allowed lights is my guess, i think is 8 max if i recall right.

    Note that is trivial to extend the shader to any number of lights, but i support 6 for balance in performance.

    The system cycles the 6 active lights in run time, as there is no pre-processing involved, so i suppose if one is disabled and another enabled somewhere in the level should work for the new, so you could do a dynamic system to keep always the 6 closest volumes active, though i have not tested that dynamic scenario.
     
    mikeohc likes this.