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
    OK but lets have faith. Unity's been doing wonderful things in the lighting department - the DXR stuff, SRP, so I am going to give them the benefit of the doubt. That was all inhouse.

    Enlighten isn't inhouse and seems a battle of attrition to keep it relevant.

    But the performance and quality bar is clearly set with the GDC stuff. So it would need to be quite async and quite compute shader optimised. Just not DXR (obviously scaling to that but as above links show, 0.6ms without DXR is a very good thing). We want something that runs from toaster to starship.

    Time of day? Dark inside when light outside? Open world? Those are my requirements and unless you've solved them...

    It's not vert cols is it?
     
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,066
    1. It's never not 14:35
    2. Environments are also static
    3. It is a single street
     
    DMeville and hippocoder like this.
  3. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    If its means no bake and no lightmaps and at a lower perfomance cost, I'm in

    what about setpass calls? Its a pain with lightmaps in Unity since lightmaps end up on different systems it doenst matter they share same material they will still double the setpass count. And it doesnt matter if you try to manually configure the lightmaps systems, Unity will ignore it anyway
     
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    :D
     
  5. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,066
    I half joke, but when I made the choice to do this compared to the previous spec (below), it opened up a lot of creative avenues for interaction and storytelling.
    • All times of day supported over a week long period
    • A full work week scheduled for lighting conditions
    • A full week of crowd simulation down to a tenth of a second
    • A full week of weather simulation
    • Five mostly explorable environments, each a city block in size
    • Environments based entirely around CCTV visibility, with some static cameras but some panning ones
    Honestly, it wasn't that I was unable to implement these systems but that I wanted to release this game before I died of old age since I can't afford other team members.
     
  6. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    And it becomes special if it's small, due to the care allowed. But, that's actually a perfect use-case really for existing Enlighten but any bigger will require more and more hours put into keeping Enlighten working well enough to even finish authoring.
     
  7. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    I'm collecting bets on whether Unity implements this or something like it in the next 5 years. To be clear, I'm not betting (that would be silly!), I'm just collecting the bets and charging a small-but-industry-standard fee of 30%. PM me for bitcoin address. ;)
     
    DMeville and xVergilx like this.
  8. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    They like physically accurate things, seblagarde complained in another thread about current "hack".
     
  9. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,662
    I'll stretch that a bit and say never :p I mean... VXGI by Nvidia, anyone? While there's an experimental branch for the Unreal Engine on GitHub, VXGI never got ported to Unity. I wonder, why.
     
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Martin_H and angrypenguin like this.
  11. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    Look absolutely great. But, there are some areas which are unnaturally too dark so maybe it does not work for everything.
    I think the best is to develop further SEGI for Unity.

     
  12. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    Is it though? I mean why haven't you start implementing or even sketching a solution then :p I can lend you papers that review all techniques currently done and their draw back so you shop and mix for your solution. No GI hack (even link to this thread) does anything new except clever ways to make trade off by realizing what they really need for THEIR case (ie specific adaptation not generic solution).
     
    Zaax likes this.
  13. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Maybe need to bump up the indirect resolution/intensity
     
  14. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Are path tracing shaders an option?

    An example of minecraft using path traced shaders...



     
    OCASM likes this.
  15. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,434
    After playing "Kingdom Come: Deliverance" with its realtime GI in a large open world that even works well with vegetation, I'm not sure I can go back to something like "Skyrim". KC:D visually blew me away like no game has in a long time, and to a large part that is thanks to the realtime GI.
     
    hippocoder likes this.
  16. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,066
    Path tracing works very well for Minecraft and similar because it suffers from lots of issues the more geometrically complex a scene gets.
     
  17. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    Yep minecraft benefit from having a world structure that don't have the problem of arbitrary geometry. You don't thin wall, you don't get weird angle as everything is axis aligned, you either have empty or solid cells and you can easily analyse and partition space for skips. Since everything is so coherent (and therefore limited) you don't have problem sampling texture too, it's almost guarantee to be where you think you it will be.

    tl;dr, minecraft is not generic, you can optimized for its case.
     
  18. Frpmta

    Frpmta

    Joined:
    Nov 30, 2013
    Posts:
    479
    You do know those path-traced Minecraft shots are from SEGI maker (Sonic Ether), right? :D
     
  19. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    All these engine developers doing raytracing for the future must be mindful not to neglect the 99% effective hardware out there without special rtx:
    • all consoles known so far
    • all mobiles
    • nearly all desktops
    But for us here in dev land with the rest of the world playing our games, I want to solve a problem: and that is current "realtime" GI is still not a solved thing at Unity. I believe the lighting team is working on something but it would be nice to have some details and a tentative date for something. If it will be "2020 sometime" for early access than that's too late for my game. I need something useful by August.

    Years ago this developer had no choice but to hack their own in:
    - while not as nice as the GDC one, nor as dynamic, it is still something I would use if available and working under HDRP.

    It's not even bounce we truly crave but making interiors properly lit with time of day without resorting to things that need a lot hardware and staff to be practical.
     
  20. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Dang, I hope to be done with my current open world real time GI project before this would likely be in Unity.
     
    Ryiah and hippocoder like this.
  21. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,594
    From the description of that video it seems pretty doable.
    I mean it will be a good amount of work, but seems doable.

    In any case, back to the topic at hand, I don't really have much interest in realtime GI solutions, which is why I'm not really participating in this thread, but at the very least will say this:

    RTX/DXR based realtime GI/whatever is useless. At the very least I can see what is being proposed in this thread as being handy. I'd rather see resources be spent towards a solution like that than rtx/dxr whatever.
     
  22. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    That's possible, use a top down shadow map like in gta 5, everything below is tainted in interior ambient light and yes it's distinct (generally bake too) from the shadow map for .... shadow (it's actually called ambient occlusion even though it's not really.

    Also that video isn't GI at all, it's ... ambient occlusion ... man why people take liberty with naming stuff ....

    There is probably half a dozen of (easy?) hacks you can do if you don't need/want true GI.
     
  23. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    It's title Ray Tracing Minecraft but it's Sonic Ether's Shaders, amazing...
     
  24. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    A bit of strange art direction having realistic reflections on that block graphics (imo)
     
    andreyefimov2010 likes this.
  25. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    If that were my situation then I would already have given up on that side of things (or compromised using an existing solution if possible), August is surely way too tight a schedule for anything new to adhere to? Whatever Unity are working on, I'd consider myself lucky to have even heard the merest of details about it by August.
     
    hippocoder likes this.
  26. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    There is something in the roadmap
    Unity 2019 Roadmap.png
     
    Ruberta likes this.
  27. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    (mild rant but not at you!)

    I want it solved by August but the game does not ship by then, so I'd have about a year past August to finish up. The thing is, I need this aspect solved early as gameplay relies on night/day, so that's the specific visual thing I need solved by August.

    If I can't then I need to compromise soon. If I know Unity is actually planning something by 2019.3 of some sorts that would allow for an open world environment and time of day with high perf, then I can calm my indirect titties and focus energy on other things.

    Really it's not solved though. Enlighten crapped out with bake, with probes, everything basically whenever the world gets beyond a small test level. I can't and won't tie up the machine with baking because it kills iteration and visual quality has to be checked often :(

    I ended up tweaking meshes individually (again killing dev times) and ended up with a bunch of custom super low detail gi param files. I know what I am doing 100% with the existing Unity GI. It just really, really doesn't scale at advertised quality, so you end up doing *so* much work including micromanaging what and when it will update, and more. Really it's marketed as a one click solution but you need a team if you go beyond 500 meters or so. At that point, it starts bringing the pain and you start requiring silly hardware / hands on tweaking / or accepting too low quality.

    I get why AAA is moving away from it since really the detail level Enlighten is designed to solve isn't a problem that needs solving. It's the big questions that need answering. Every mutt and his github can light Sponza. Going beyond that is the problem since not everyone is lighting Sponza.

    And when you make it scale, it's at such a low resolution you may as well just bloody paint it in lightmaps yourself with a fill tool.

    Now if Enlighten worked as advertised then I would use Enlighten. The problem is it's failing. It's looking bad. It's crashing. Probes are frankly not useful without stencil or other strategy and it's behind a closed source box.

    Obviously I did the right thing chucking Enlighten. It already consumed months of my time automating probes and other stuff. I'm done with it unless Unity do a solid, top tier job that works with HDRP - OR give me realtime! :)

    I'm not being too demanding (in 2019) of a multi-billion dollar valued company am I?
     
    SparrowGS, Tartiflette, Ryiah and 4 others like this.
  28. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Frostbite used enlighten, so it's possible to build pretty large worlds with it.

    Edit: completly with you btw, unity is pain for large maps with both interior and exterior. For example it's a pain getting reflection probes to deliver
     
    hippocoder likes this.
  29. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Frostbite is on record with their extremely huge render farm costing actual $$$way too much, though, that was used for Enlighten. Plus developers handling all the corner cases etc... And we'd probably need someone to write all that stuff / fix stuff.... Unity is closed source in this respect :(
     
    AndersMalmgren and xVergilx like this.
  30. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,662
    Pretty sure the folks at DICE use render farms... And I'm not sure if Unity's Enlighten integration would be capable of that (spreading the baking work over multiple devices). Plus, I think Unity's version of Enlighten lacks features that are normally available in the native Enlighten SDK?!

    This PDF is interesting (and has been shared here on the forums multiple times, I think):
    https://media.contentapi.ea.com/con...-precomputedgiobalilluminationinfrostbite.pdf

    But can you do that in Unity?
     
    hippocoder and AndersMalmgren like this.
  31. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Yeah, I just ment Enlighten can yield great results. Not that its possible in Unity. Though Tarkov did have some nice GI
     
  32. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Sorry for thread steal but its kind of related to GI, why does this reflection probe almost look like specular lighting?

    Untitled.jpg

    I need to use mixed mode lights to achieve similar results on other places like
    upload_2019-4-9_20-50-4.png
     
  33. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,303
    Where's the summon appropriate Unity devs to thread button?
     
    andreyefimov2010 and xVergilx like this.
  34. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,662
    Maybe it's just a regular specular/gloss map?
     
  35. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Yeah, but both are fully pbr. But the latter needs a fully specular light source (Mixed mode light in Shadowmask mode) to make the effect pop. Its only baked light with reflection probes in first pic
     
  36. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,594
    Because speculars and reflections are more or less (well, not quite, but specular is supposed to simulate "light reflections") the same effect?

    Specular is just a simplification for "reflection of bright light sources".

    A contrasty cubemap/reflection map can be used to give a specular like look, people have been doing it this way for ages.
     
  37. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Yes but why does it not work with all materials? Both are PBR.
     
  38. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,594
    So like on the hand rail? Feels like there should be a highlight on that too, yeah. Are the normals correct on it?

    (also we are getting off topic.... maybe we should start a new thread for this? :p )
     
  39. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    haha :D Sorry! I'm soon done and everything can go back to normal!

    Here, first I show reflection probe only, than a specular light on same brick material. And then at the end the ceramic tile material down in the subway.
     
    Last edited: Apr 10, 2019
  40. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    232
    A fast performing high quality lighting system is something everyone would want. Hopefully Unity gets one incorporated at some point (whether built in or a well supported asset) but for now I would question why your game design seems to require it when the engine doesn't have that feature?
     
  41. Because in software development world, including game development we try to find/create/beg for tools which help us to achieve our plans, we do not form our plans according to the tools we have at the moment. Usually.
     
  42. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    There is also the aspect of shadow quality in real-time, I would say it's only the directional light that have acceptable shadow quality in real-time
     
  43. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    A general rambling reply:

    It was working during development and during feasibility study. Problems arose with cases much later in dev. Enlighten promised a solution, I have good experience in it but it turns out there are cases in actual dev where it just falls over, however much you try because ... probably need source + renderfarm or some pretty impressive GPU acceleration for bake, and doesn't really have a use past arch vis right now and it probably hasn't been accepted in bigger games in Unity.

    That's not so hot for a game a few km in size WITH inside/outside, and even completely omitting terrain from the solution still left the heavy hands on work of just preparing geo for bake that has flawed probes anyway (for inside/outside).

    I'd use Enlighten if it actually scaled for my crappy scenario. I don't have the staff or hardware to use it currently, it's really that simple. And reducing the quality to the point where it becomes usable for me, actually reduces visual quality and introduces artefacts! Don't even get me started on probes. It will defeat even carefully hand-placed probes in a large number of cases.

    All through dev I fed back to Unity, and got promising noises in return but no actual data. I see studios like Bossa being forced to work around these issues and their case is way more forgiving that the average open world game with inside elements because they have geo and constraints by default that can allow it to work. Plus paid staff.

    Honestly, I would be happy with Enlighten... if it was really usable:
    • Fix bake times, sorry even with ultra conservative params, splitting geo etc it's still taking too long to prebake for realtime GI. I can't afford thousands on a render farm that does not work with Unity's Enlighten. I don't have staff to help. I can't iterate worth a damn and visual iteration is a thing that shouldn't be limited to Frostbite and the pdf above.. bake time also includes geo prep time by human hands, obviously!
    • Fix probes. Unity and I both know they're broken as hell and we've been over this. Even their FPS sample showed just how much
    • Fix weird bugs with async readback costs with PBR sky etc for HDRP
    If they can fix all that and make the runtime perf around 0.5 to 1ms on a PS4 then we are very much cooking with gas.

    OR I'll happily take a 2-3ms / frame hit for pure realtime and sacrifice elsewhere as it's so nice having beautiful lighting.

    You would have expected some kind of movement here from Unity by now, and I think the lighting team might be up to something but seem rather mums the word at the moment! That is their decision and I will neither harass nor ask, but welcome any voluntary info they provide.

    Also, as this game is not strictly biz only, it's my game, so I can compromise and ship without time of day. Do want to do that? heck no! so If I can nudge back on track I sure as heck will try...

    I don't think Unity is particularly upset with me, I'm doing what any user should do, identify a strong need or a strong flaw, kick up a fuss and it turns out... I'm not the only one by a long shot!

    This is clear signalling to Unity, and stuff they found probably harder to look at on feedback site because you got 10 votes but little else, and no discussion!

    I know not to drag it out so at this point I'm just waiting for 2019.2 to hit beta, then if there's still no sign or noise about this I'll have no option but to compromise and have a game which better fits Unity's abilities.

    And I'm not sure Unity wants to be known as something that doesn't scale.

    I would like higher quality and I do not have resources so please Unity, democratise the S*** out of this!
     
  44. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    It seems they have addative plans for light probes in 2019.3 so things are moving atleast
     
    hippocoder likes this.
  45. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    I don't think that 2019.2b will have this as solution becuase it too close. First beta will hit this end of april/start of may.
    But 2019.3 could eventually have something improved becuase a lot of graphic API will be changed.
     
    hippocoder likes this.
  46. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    I havent played either, but isnt Rust and Tarkov have pretty big worlds? Wonder how they solve their GI needs.

    I have a dream of moving our mechanics to a larger open world. So I'm very keen on this progress. We are a VR game too, so performance and forward rendering support (Or a new render pipeline with good anti aliasing support) is crucial
     
  47. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,557
    Do you think this would work on iPhone and android ?
     
  48. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yes they can handle it (but only latest ones). Seems like it could be really interesting to use this as a runtime baker a well... very interesting actually for VR too (runtime baking).

    Having said that if Unity can really fix up what they have then I'll take it. I just don't understand why PLM GPU bake is for... baking lightmaps nobody really wants any more. Everyone and their hamster wants realtime these days.

    Maybe GPU accelerate the precalc for enlighten, that would make me top happy :p
     
    xVergilx and protopop like this.
  49. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    One downside of lightmaps are like I said earlier these damn lightmaps systems (Which texture atlas a lightmap ends up on). They can really F*** up your setpass budget. And it seems impossible to configure it decent for a large complex scene.

    If realtime means less and cheaper set pass calls I'm all in
     
    Martin_H and hippocoder like this.
  50. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    In Battlefield II and other Dice games they choose to pack the *entire level* onto one single indirect lightmap. These lightmaps can be huge but it's good performance for them. 60fps on older consoles is not a joke.

    Unity lacks the technology for this, and users lack the hardware / staff!

    (From what we know so far)