Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Discussion Adaptive Light Probes (APV) in-depth tutorials or how to get rid of light leaks?

Discussion in 'High Definition Render Pipeline' started by Jack_Martison, Sep 12, 2023.

  1. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    83
    Hey, I'm probably just like everyone else completely frustrated by using APVs, on the one hand this is robust and great technology, on the other complete mess with random light leaks that ignoring all the tools.

    I have shed/hut building made of woodplanks, every time I bake APVs I see light leaks along the corners and floors, I tried to invalidate it, applied virtual offset (not sure about this one how it works, though), only increasing density of probes helps just a bit.


    Screenshot_21.png

    Screenshot_20.png

    Any tips to remove it and increase overall indirect look to it? Traditional lightmapping still looks better somehow here, can't use it for obvious reasons.
    Screenshot_22.png

    What's more shocking, Unity presented it as major feature and put a lot of effort to promote it, produce, and literally nobody cared to explain what every feature does in detail, you should literally yell from every corner, that we have such nice feature and here's in-depth tutorial how it works and how to fix light leaks (not GDC talk with bare-bones statements, "just make thicker walls").

    But again, I could miss something, as it's been almost a year and a lot of tools added. So any help would be great.
     
  2. ElevenGame

    ElevenGame

    Joined:
    Jun 13, 2016
    Posts:
    143
    what is the obvious reason you cannot use lightmaps? :D APV is baked lighting too, so you don't have a day/night cycle or things like that. So you can use Lightmaps, too, right? I'd recommend it, it is very hard to get full scene lighting from just APV, especially in a scene with a lot of contrast like here.
     
  3. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    83
    I use day/night cycle, and lightning scenario is a life saver, lightmaps takes ages to bake big scene, if we are speking about lightmap blending
     
  4. ElevenGame

    ElevenGame

    Joined:
    Jun 13, 2016
    Posts:
    143
    Okay, well I see. But that's kind of a technological limitation then. If you have lots of baked APV light scenarios, those take less time to bake because they are way lower resolution compared to lightmaps (talking about the static objects that are affected) and therefore also have issues such as the light leaks. (sorry to repeat it, but that approach only works with: thicker walls ;-) )
    I don't know how well the Enlighten GI works these days, haven't used it for a long time, but yeah, the baking times for big levels are probably crazy. Data amount could also become too much. Just out of curiosity, how many lighting scenarios do you interpolate for a full day night cycle?
     
  5. ElevenGame

    ElevenGame

    Joined:
    Jun 13, 2016
    Posts:
    143
    @Jack_Martison I guess you use the ambient probe only for reflections, because that's kind of my issue with using the lighting scenarios, the fact that reflection probes are not included. If you really have a big level and need the day/night cycle, I'd look more into using some realtime GI effects. Maybe have a realtime reflection Probe at camera, which can be the fallback for some sort of RTGI. You'd save a lot of data that way, for the cost of performance.
    I also wanted to do a day night cycle in my game originally, but realized that there is no real benefit to the game from that. One either get's lower quality looking lighting or big amounts of baked data or high performance requirements for RTGI. I know it can create a kind of grounded and seemingly realistic game world, but as long as your gameplay isn't about exactly that, it comes with those mentioned pitfalls. Also it doesn't feel realistic to me if an in game day takes like an hour or something. So the only way that would feel correct to me would be realistic timing aka. 24h/day, which seems bad if you are just starting a 12 hour night, unless you allow the player to skip time (sleep). And if you allow such a thing, you are just one step from returning to baked lighting scenarios anyway. But yeah, those are my personal thoughts about my probably completely different game, you can ignore those, if they don't apply to your game. :)
     
  6. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,120
    If you have a proper level with dynamic l, with closed off interiors that aren't their own scene, light leaks are unavoidable with the current APV. The bigger your scene, the more difficult it'll be since you can't use insane probe densities (and even then, you'll still have light leaking, just less).

    You can change your entire layout to 'reduce' leaks (by using thicker walls, roofs, everything) but all it does is reduce, not get rid of light leaks entirely.

    You can also use a ton of adjustment volumes, but you'll still have some, you can invest an insane amount of time using custom virtual offset adjustment volumes, but even then, you'll probably still have some light leaks.

    Invalidate adjustment volumes do not remove probes, it deletes the lighting information in that probe and gets new light info from nearby probes, which means it won't be a ton of help to remove light leaks on walls/floors etc.

    And APV doesn't have any denoising, so an extreme probe density means a lot more probe samples are required for a clean image, which means much longer bake times.

    The only real solution I see is a better anti leak method, currently there's too many holes to cover.
     
  7. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    83
    Thanks for answer, but perhaps I'm using adjustment volume incorrectly? Obviously invalidate method doesn't work at all, I read that virtual offset works somehow