Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

What is the expected multi-scene lighting pipeline? Because it appears to be broken...

Discussion in 'Global Illumination' started by hypnoslave, Sep 5, 2018.

  1. hypnoslave

    hypnoslave

    Joined:
    Sep 8, 2009
    Posts:
    282
    I'm a long time Unity fan, so if this post sounds salty, no disrespect was intended...

    It seems to me that the multi-scene lighting pipeline is currently broken and making an additive-loading game in Unity is either profoundly limited or impossible because of the ongoing bug where light probes are used from the most recently loaded scene, which makes separate baking impossible.

    What is the expected multi-scene lighting process here? Loading my entire game together for lightmapping theoretically solves the light probe issue, but introduces other problems. Even if I can load my entire game at once to generate mapping, I would need to create a single set of lightmapping options that work across my whole game. that means:
    1. No ambient light can be used anywhere if I want even a single dark area, which means I need a complex material solution for ambient lighting, including a solution for objects traveling between areas.
    2. Areas with Unrealistic lighting (such as a portal to another dimension where there are two suns) is simply impossible without a loading screen.
    3. Cheating by having sections overlap slightly is impossible - all scenes must be perfectly laid out in rational physical space so they do not block lighting from one another.

    I hope someone can tell me that I'm completely flying off the handle here and I'm just a dummy?

    I have no doubt that Graphics programming is insanely difficult and well over my head... but unless I'm missing something, making this sort of game simply isn't feesible in Unity, and as a consumer, if I had known how broken this was I'd have considered Unreal.

    Is there an ETA on the light probes issue, by any chance? I'd rather not re-build everything I have an another engine, if I can avoid that.
     
  2. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,655
    Try to ask bakery's creator
     
  3. hypnoslave

    hypnoslave

    Joined:
    Sep 8, 2009
    Posts:
    282
    Bakery?

    I'm out of the loop, apparently.
     
  4. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,655
    https://forum.unity.com/threads/bakery-gpu-lightmapper-v1-2-released.536008/
    I mean you might have faster answer and turn around with bakery than anything with unity team, because he is on a much smaller target than them. He was willing to listen about interval mapping which an obscure lightmap technique, so it will certainly inform you of the feasability of your issues. Also it's a damn fast and efficient lightmapper, like 10x faster at worst.
     
  5. hypnoslave

    hypnoslave

    Joined:
    Sep 8, 2009
    Posts:
    282
    Huh. No kidding. that's very interesting. Thanks very much neoshaman, I'll take a good look into this and see if it doesn't alleviate my woes.
     
  6. jStinson

    jStinson

    Joined:
    May 9, 2017
    Posts:
    20
  7. hypnoslave

    hypnoslave

    Joined:
    Sep 8, 2009
    Posts:
    282
    Thanks very much! Unfortunately that script solution does not work. it's possible that it's broken as a result of later unity patches, but who knows. I took some time, analysed it, understood it, and ran it, and it does what it purports to do (almost) but the probes that it ultimately creates are not correct - the data fails to copy to them properly. most of them are black, for example.

    I'm going to investigate this new light mapper, and in the absence of that, I'll simply see if I can use Unity's solution - to just bake all of my scenes together. I think I can prooooobaabbbllyyy get away with all scenes having a similar lighting set up. I'll just have to be super sneaky and put in some effort.
     
  8. danielrugu

    danielrugu

    Joined:
    Jul 24, 2016
    Posts:
    14
    Did you solve it yet?
     
  9. hypnoslave

    hypnoslave

    Joined:
    Sep 8, 2009
    Posts:
    282
    Nope.

    I've been onto other things. Hopefully unity can fix this (they are aware of the problem) but it's possible that I'll just have to load all the scenes together and bake. I've altered my design slightly and my entire environment should all be able to be baked together, as it makes euclidean sense.

    God help anyone who's making a non-euclidean game who needs to bake lightmaps.
     
  10. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    369
    Well I guess there still isn't a solution. I'm using Unity 2017.4.24f and still seeing this as an issue.

    All of my scenes must be baked separately as they are much to large to fit in memory at the same time. I'll have to make in-between scenes (with very small and very little meshes), that have no light probes...so there are only main large scene light probes to go off of.

    Not ideal, but that's the only "solution" I could come up with.
     
  11. hypnoslave

    hypnoslave

    Joined:
    Sep 8, 2009
    Posts:
    282
    Hey, that's a very creative solution. good idea!
    Still sucks though, really, as it will only work with some pretty specific design restrictions.

    Honestly, I'm not sure why this isn't higher priority (or perhaps it is and it's just a really difficult problem). It's not like seamless open world games aren't insanely popular. It's not like Unity didn't revamp their entire scene management system to allow for seamless multi-scene loading/uloading. This bug basically F***s that all completely up.

    Very strange.
     
  12. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    369
    I totally agree. I wish there were at least guidance or best practices to get around these kind of issues. It seems as though more advanced issues gets unresolved.
     
  13. hypnoslave

    hypnoslave

    Joined:
    Sep 8, 2009
    Posts:
    282
    Yeah, I know the feeling. Well it could very well be that they're absolutely gargantuan ice-berg problems, for all we know, so.... meh.

    Honestly, this isn't the first massive issue that I've navigated around and it won't be the last. it would have been nice to get a response on this particular issue but... I guess that's game development when you're using someone else's engine.
     
  14. thefranke

    thefranke

    Unity Technologies

    Joined:
    Jun 20, 2015
    Posts:
    90
    Hello everyone,

    I can confirm that there is a solution to the Light Probe problem with additive scenes. In the latest 2019.3 beta, probesets from additively loaded scenes will be merged together automatically. You will however need to call an API function to finalize the merge. This call - Lightmapping.Tetrahedralize() - will update the tetrahedralization structure you see when you click on a probeset (the lines connecting the probes) to include the newly added probes. Because re-tetrahedralizing probes is quite heavy work, you want to reduce calls to this function to a minimum.

    E.g. let's assume you build a Spacehulk like game where characters move along corridors, and each corridor segment is a scene. You load each neighboring/connecting segment to the current corridor because you don't know which way the characters will move next, i.e. each time characters move into a corridor segment, multiple new scenes are additvely loaded rather than just one. In cases like these, first load all scenes, then when everything is done call Lightmapping.Tetrahedralize().

    Cheers
     
    FiveFingerStudios likes this.
  15. hypnoslave

    hypnoslave

    Joined:
    Sep 8, 2009
    Posts:
    282
    Fantastic!!! Thanks very much for the tip, thefranke!

    You guys have saved me quite a lot of forehead rubbing and eye squinting, etc. This is great news for my forehead and others.

    I'll give this a try quite soon.
     
    thefranke likes this.
  16. pcg

    pcg

    Joined:
    Nov 7, 2010
    Posts:
    214
    Am I correct in assuming that the baked probe data from an additive scene cannot be moved to a new location and then retetrahedralized ?

    What I want to do is bake a series of rooms in their own scene all at the same location. Then load the additive scenes and move the rooms in to their correct position, retaining the baked light probe data. Is this possible?