Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback I'd like this GI solution in Unity, thanks a lot :)

Discussion in 'General Discussion' started by hippocoder, Apr 6, 2019.

?

Would you like this?

  1. Yes

    93.8%
  2. Yes

    67.9%
  3. Yes

    66.7%
Multiple votes are allowed.
  1. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Last edited: Jun 21, 2019
    JoNax97, NotaNaN, TerraUnity and 25 others like this.
  2. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    It would be soooo goood.
    yes.jpg

    But.... inb4 preview for 5 years.
     
    BeeNvizzio and hippocoder like this.
  3. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    Why can I vote yes only 3 times?
     
  4. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    974
  5. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    Yes. Please Unity devs get this working.
     
    hippocoder likes this.
  6. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,586
    Link please :)
     
  7. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    328
    upload_2019-4-6_20-3-20.png

    I want it right now
     
  8. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    2178y0.jpg

    Though I don't even have PC for realtime DXR.
     
  9. LukeDawn

    LukeDawn

    Joined:
    Nov 10, 2016
    Posts:
    403
    I would accept a delay until 2019.2 if that helps.
     
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    QFT
     
    Martin_H and dadude123 like this.
  11. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    How does it works though, is it at the link? What are teh drawback? how does it handle scene representation (ie out of screen ligting)? Can it be generalized to physics raycasting for gameplay (okay that's one is wish fulfillment)
     
    OCASM and hippocoder like this.
  12. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    At link. 0 drawbacks. It's solved mate. Scales all the way up from toaster to DXR. You can remove probes and AO as well from your chain since it will do it properly. AAA are all rolling out their solutions now, it's time. None of them are investing in Enlighten.

    No need to guess.

    Also we can see solo devs like @Lexie or @sonicether just rolling their own. With Unity's considerable resources I do expect something along the lines of the presentation link above. I ask for it, and if you do not ask you do not get.

    I battled Enlighten for years but having an open world broke me. I can't use it, even though dots encourages a big world.
     
    Martin_H likes this.
  13. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    Oh okay it's a pdf, look similar to Hxgi, but more closer to Nigiri (from the segi thread @Ninlilizi )

    Def not solved yet, but handy!
     
    hippocoder likes this.
  14. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Er, it's solved in production. Watch the vids. Stop assuming. This is used in a real game!
     
    MadeFromPolygons likes this.
  15. Ruberta

    Ruberta

    Joined:
    Mar 5, 2019
    Posts:
    114
    I want this now on Unity ready for production! Along with other features likes DOTS, new input system, animation rigging.
     
  16. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    I also find this very interesting
    https://www.gdcvault.com/play/1026323/The-Indirect-Lighting-Pipeline-of

    This could provide some useful insights for realtime light probes and GI

     
    keeponshading likes this.
  17. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    @hippocoder
    I didn't meant solved in that way lol Else it was already solved with segi, just for a bigger cost :p Also it's still a (good) approximation (ie not solved).

    But I read the paper, it's in inline with what Nigiri was doing almost literally. I'm not assuming at all. HxGI in fact use a different structure to traverse light, which would probably accelerate their stuff too, they do use both the cube basis. From nigiri he has similar screen space injection to kick start the lighting and stores lighting into voxel, with async casting inside compute. Innovation they brought is the convex stuff, geometry enlargement and negative space voxel to let through after enlargement, also ditching the cone tracing. It's basically an optimized SEGI fundamentally though, it has the same cascade system, the bigger optimization from segi is basically not casting all good damn rays in a single frame to spread them overtime and adding sugar to optimize the light leaking.

    I hope I can gather myself to proposed a casting less solution soon.
     
  18. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,066
    Bigger being "prohibitively expensive on lots of hardware" which is not what you could called "solved."
     
  19. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    Yeah that's the point, it works but a cost, where you draws the line is what constitute solved™. For example I'm looking for a GI solution on mali 400 level phone stuck in open gl es 2.0, this won't work for me. So it's not "solved"? I'm working on a solution (more approximation therefore more artefact) for these case, though I still need to go through other problem first.

    Anyway "solved" is I meant originally RT accuracy with any arbitrary objects and scene, which they still don't (dynamic don't participate for example), he didn't use the same solved that me.

    I think the technical term should have been good enough for my use case in the current state of the market and my hardware target:p I guess it's a mouthful compared to "solved" ;)
     
    OCASM likes this.
  20. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    OK cool but this is a practical solution that will work fine on high end phones and scale. Some things won't be solved like low-end current mobiles. That's what baking is for. You either support something that's clearly working, that's viable or you go with things that are too slow (SEGI) or probably not coming (Lexie's). And then you realise these guys, they can stop work any time and don't have a multi billion dollar company behind them.

    At this point you're just undermining the thread. It's a serious attempt to ask for something better than prebaked GI which won't scale at all, but will work for a tiny mobile phone that Unity already has.

    Frankly your *only* options are:

    1. something like this
    2. expensive DXR hardware

    TBH this is as "solved" as you're likely to get before your only option is hardware raytracing. This is the last stop. And this likely still will be needed in an age of hardware raytracing. It scales up to and beyond it (quality/perf/convergence).

    Will it work on mobile? yes high end ones, and yes for future phones. Something that you probably won't be getting option 2 for a long, long time so I don't see why we're not calling this solved (until everything is raytraced).

    But feel free to see how well Enlighten keeps up with large dots worlds tho :D

    Clustering...
    Unity Crash Reporter...
     
  21. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    Enlighten looked like a misstep even before it was released. It's completely useless for many types of games. Realtime GI is doable (other engines have been doing it for years)... Unity just prefers to partner and buy other solutions and position themselves as a technology company rather than strictly a game engine company. This comes with benefits and tradeoffs, one tradeoff being the inattention to things like REAL realtime GI.
     
  22. Frpmta

    Frpmta

    Joined:
    Nov 30, 2013
    Posts:
    479
    This is all that matters.

    It is pretty much as good as it gets in terms of performance.
     
    hippocoder likes this.
  23. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,066
    Still blown away by 0.6ms at 4k on an Xbox One X
     
    NotaNaN, Martin_H, Gekigengar and 6 others like this.
  24. LukeDawn

    LukeDawn

    Joined:
    Nov 10, 2016
    Posts:
    403
    Unity can make a big step forward in bringing this onboard. Over to you guys, what you going to give us?
     
    hippocoder likes this.
  25. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    Oh ... @hippocoder

    I didn't meant to to crap on your excitement for the issues, it was just an offhand remark, which wan't what you expected therefore I clarified what I meant, it don't feel like I undermine the issue ...

    BUT, I don't see how it's different from Lexie's, it's basically a slide that say it works for them, and explain how they did it in loose terms for people knowledgeable to try custom implementation. Just like lexie's released proof, video and explanation that work on his machine ... WHAT I DON'T SEE or have, is actual code I can download on my machine to verify the claim and study... just like Lexie's.

    BUT I can download Nigiri wip version on the discord...

    So it will be production ready when code will be on the wild and everyone can try for itself. It's easy to get excited at hypothetical, that's why you people like to tease me when I'm talking about advance tech™ potential lol :p

    It's just one more proposition to try and implement.
     
    SparrowGS and hippocoder like this.
  26. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,066
    I'm pretty sure Gaijin Entertainment, who have released almost a game a year for the past 14 years, including War Thunder, a game that is designed to be performant on a wide range of hardware, is on the level.
     
    chadfranklin47 and hippocoder like this.
  27. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    I'm just saying, it works, but show me the code now.

    THEY have something WE have nothing.
     
    hippocoder likes this.
  28. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,066
    No, we have a breakdown over the course of 49 slides, some of which include relevant code samples. Gaijin is not a company that does open source releases and they have given a quite profound amount of information here.
     
    angrypenguin, thelebaron and xVergilx like this.
  29. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I know you're not beating on me neo <3 but I was afraid you might give people the impression this thing is a negative. It's really all we got left before a raytraced world.

    And I can't blame Unity for wanting to dodge this in favour of just focusing on raytracing (it's the easy way out) but even Unity is first to admit that raytracing is not all or nothing, and has a huge few years to go before being optimal and that's basically the entire planet almost, that could benefit from the Gaijin approach, an approach they freely shared with us.

    It does take a few developers and a commitment to put together, but isn't that why we pick Unity? Enlighten will not scale with dots. Enlighten continues to be a bottleneck in the Unity pipeline, and frankly Unity can even dodge the whole lightprobe/multiple scene/streaming bullet just by using this.

    Suspect this is faster:
    GDC Realtime GI (Voxel magic stuff)

    Than:
    Post Effect AO + Lightprobes + streaming enlighten ligntmaps + Additive Scene Loading + Patching up probe leaks
    +Horrid editor bake time + authoring probes + getting pissed off at clustering + fiddling endlessly with GI Params...

    Remember, we're not actually comparing 0ms cost to 0.6ms.
    We're probably comparing something that costs 0.6-1 ms (A combo of AO/probes/enlighen/etc) to 0.6ms. It's very likely on modern setups with large levels, that Enlighten will be slower as well as being lower resolution (you need a cripplingly low res to handle open world, it just doesn't scale at all).

    Also perf is bad sometimes:
    Currently enlighten hits my profiler in a build with 50ms spikes. Why? because procedural sky dared to move and this triggered readbacks and other eye-rolling shenanigans. Enough, it's 2019 not 2004.

    Until then what will light megacity 2.0?

    PS. speaking of which, I tried Enlighten on my level before popping back here. I used the terrain style conservative very low res params. After making a tea, I got back to see:
    upload_2019-4-6_21-46-15.png
     

    Attached Files:

  30. dogzerx2

    dogzerx2

    Joined:
    Dec 27, 2009
    Posts:
    3,964
    I wanted to vote Yes, but only options on poll were: Yes, yes and yes. So I chose the closest one which was Yes.
     
    florianBrn, NotaNaN, xrooshka and 4 others like this.
  31. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    @hippocoder You are right, i'm coming off as more negative than I want to be, so I'll rephrase my take in a way thar=t's way more positive:

    You can have this very soon, without unity's meddling:
    1. it's basically an optimized version of SEGI, the latter being open source and have cascade too.
    2. you can jump start your solution with those slide and adapting SEGI (I have made a line by line commentary on the SEGI thread if that's helping)
    3. their major realization is to slow down update because GI is low frequency and low Update. This low hanging fruits can be done easily with SEGI by parametrizing the main raycasting loop (add an offset and a loop counter passed by c# code), you could probably have the burst update too (many ray in a single frame) to have the same effect to initialize updates. Since SEGI works with a kind of accumulation buffer (infinite bounces by spreading the bounces over the frame by accumulating them), you can also just stop update if the GI clipmap isn't moving to save precious cycles.
    4. continue adding idea presented on the slide to get the best version
    5. ???
    6. profit!!

    Be production ready with a limited amount of effort RIGHT NOW!
    That cubemap normalization was super handy and reduce a theorical problem I discovered while making an analysis for my own take on GI. Still I can't chase too many goose right now :( I'll have to wait...
     
  32. I don't support the Yes, because that would mean 100% of the people would vote for the same. So I support the Yes and the Yes instead. Now, it's not 100%.

    And BTW, oh man! My stealth-based game would really love this stuff. I could use real time lightning for everything, everywhere without tanking the performance. So pretty please!
     
    Last edited by a moderator: Apr 7, 2019
    NotaNaN, hippocoder and dogzerx2 like this.
  33. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    To be honest - you can't bake really big worlds. E.g. terrain module will freaking explode if you do so, or will take eternity to bake the lighting. And the results are meh at best.

    (Heck, even small ones 2x2 KM's are a pain in the bottom part to bake).

    So I'd rather have this real realtime GI than precomputed one. And I'd be more than happy to toss away freaking nightmare that is Enlighten and it's weirdo-brother Progressive.

    Also, solving problem by bruteforcing a hardware solution (Hi there, Nvidia) is not an actual solution to the problem.
    No doubt in the future we might see more of the "real" raytracing though.

    But at the same time, what if we got more cores / speed / memory for use instead of really costly RTX cores?
     
    hippocoder likes this.
  34. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,909
    How does it work at long distances?
     
    hippocoder likes this.
  35. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    Fine according to the paper, in fact their game is design around long distance.
     
    hippocoder likes this.
  36. Frpmta

    Frpmta

    Joined:
    Nov 30, 2013
    Posts:
    479
    Isn't SEGI screen-space based?

    Because the slides are mostly about avoiding a screen space solution.
     
  37. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,006
    Not the most stellar graphics I've ever seen, but no need for probes and AO? Sign me up ...

    EDIT: I could be wrong, their website has some very pretty stuff, not sure at which point they were taken..
     
  38. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,611
    This looks awesome. Nice!

    They do have a slide on limitations, which might stop it from being useful for some games.
    upload_2019-4-7_13-1-30.png

    I'm wondering how this would work with stuff like torches swinging around in dark areas. This really isn't my area of expertise, so I wonder if it could be combined with other methods to cover that kind of use case?
     
    OCASM likes this.
  39. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,066
    Torches and such have a pretty low radius, so you could probably fake it with some cheap volumetrics.
     
    Ryiah and angrypenguin like this.
  40. I think you still can combine with a real time lighting solution, so you can have real time torch light if you accept that it does not contribute in the GI at all. You only lit a small area directly.
    The more interesting problems would be asteroid falling or flare guns or fast daylight changing (bloodcursed elven arrows in skyrim) I think.
     
  41. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Enlighten suffers all these "flaws" and has variable perf depending on how much CPU you devote to it. Most realtime GI solutions take a while to converge, and are ideal for slower changes. You can prioritise things though. Enlighten isn't any better in this respect.

    Plus bigger hardware? faster convergence. This limitation didn't stop HDRP team from adding volumetric fog which has the same problem with fast moving things. In reality it's not an issue.

    In fact I'll bet most people just want their caves or buildings to be actually correctly dark inside / open a door / let light in.

    Anything else is a bonus and easily covered by realtime anyway.
     
    NotaNaN, Gekigengar and Lurking-Ninja like this.
  42. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,611
    Why so defensive? Nobody was saying anything bad...

    Right, in which case it's a non-issue. Stuff like explosions, flashes, torchlights won't look any worse than they typically do, and all of your "slow" light sources have better interaction with the world.
     
    hippocoder and Lurking-Ninja like this.
  43. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Apparently the lighting team at Unity has some magic brewing. Would love a teaser from them... what could it be?
     
    pcg, SunnySunshine and LukeDawn like this.
  44. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,066
    ...God, I'm not sure I can bring myself to care about a new lighting solution brought to us by Unity after Enlighten and Progressive.
     
  45. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,883
    Was Beast good enough to not be included in that list?
     
  46. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    Not really, it does use screen space query light, but so do this solution as told by the paper. Think about it, you need to resolve the visible rays. I have a break down of SEGI line by line in its thread.
     
  47. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,066
    Compared to Enlighten and Progressive, especially for baking tasks? Absolutely.
     
  48. Frpmta

    Frpmta

    Joined:
    Nov 30, 2013
    Posts:
    479
    Beast was good.

    The 32bit editor memory limitation was the only reason it got the bad reputation it did.
     
    xVergilx likes this.
  49. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    We haven't had support for large anything working in terms of lighting. Like probes only active on the last additively added scene. Anyone who has done large world stuff in Unity has had to to significant engineering just to get basic functionality. I feel bad for all the noobs putting in all the time on their open world games who will eventually find out lighting will force them to redo everything.
     
  50. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,066
    I got around that by making everything in my current game a static mesh with no lighting at all