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

We seriously need to add GPU GI baking.

Discussion in 'Global Illumination' started by jjejj87, Aug 2, 2015.

  1. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,105
    To keep it to the point and short, I would like to say a few words about GI baking in Unity5.

    I've been using Unity since the 4.0 and is generally in production of desktop games.
    I've been using Unity5 ever since it was released.

    Now, to Unity5's GI.

    I feel that it is great... I've had so many issues with it, and believe me, I've had many nights of frustration...(sigh) but when it works, it gives great results.

    As for the feature's production-not-readiness, well, welcome to game development. Also, I am willing to be more understanding given that it is a new feature. Good things take time to mature.

    However, this does not make my life any less frustrating. GI baking takes so many hours just to find out that it is not working...

    So, here is my suggestion, add GPU baking and shorten the baking time drastically.

    This way, it will only take a few minutes to assess the scene.

    From a developer's perspective, I can live with things not working, but I just hope it takes a lot less effort to know it.

    Here is our current work flow

    build a practical scene (approx 2m poly) -> bake GI -> 4~6 hours -> GI not working -> bake GI with tweaked settings -> 3~5 hours -> GI not working -> repeat this process until no end and waste dev time -> flame on Unity team

    Here is work flow with GPU bake

    build a practical scene (approx 2m poly) -> bake GI with GPU -> 4~6 minutes -> GI not working -> bake GI with tweaked settings -> 3~5 minutes -> GI not working -> repeat this process a few times -> understand that GI needs more time -> enough patience and support for Unity team

    I am posting this because I got the vibe that GPU baking is pretty much at the bottom of the GI team's to do list...and it shouldn't be. Correct me if I am wrong though...

    We all know that GI isn't going to be fixed next week, let's face it, and there is nothing wrong with it. It is part of software development. All I am saying is that GPU bake will make the process for the Unity team and us a lot less frustrating.

    Thanks for reading my post.
     
    Last edited: Aug 2, 2015
  2. O_and_N

    O_and_N

    Joined:
    Oct 17, 2014
    Posts:
    50
    I havent heard anything from Geomerics having a option to bake on the gpu so its most probably useles to ask somethng so big from unity.The possible solution here might be for unity to accept defeat,pay some extra to geomerics and let them integrate enlighten properly in unity.Im sure they can do it and im sure they have done it for many engines as its what they do.
    Enlighten is great but if only the unity team is working on the integration i say give the work to Geomerics and unity can focus on fixing other things.Same goes to speedtree too.Time will be saved,money will be spend but it might go in the right dirrection faster.
     
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,002
    Your post is an oversimplification.

    1) Porting GI baking to use the GPU might not be possible without drastically changing the way it works.

    2) It's not necessarily going to be faster.

    3) Baking GI uses a ton of ram, do you really want to be limited by the amount of RAM your graphics card has? (it's how the few GPU based renderers that are out there work right now).
     
    macdude2 likes this.
  4. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Pretty sure some parts can use compute shaders, practically some parts of anything can. But we need to at least reach bug free feature complete first.

    Also, they've said they'd look into it at some point. It's a good suggestion.
     
    jjejj87 likes this.
  5. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    954
    How you're setting up your scene plays a huge role in bake times, I've found out. We had a scene that took 4 hours to bake. But altering the environment to be uni-body, manifold and adding automatic secondary UVs improved that to 5 minutes. I'm not sure what exactly was going on before, but I think a lot of the times when a scene takes a huge amount of time to do, it might be incorrectly set up.

    I think if Unity added some kind of feedback mechanism of what is taking so long, and what we can do to improve it, it wouldn't be so frustrating. Or at the very least offer some through documentation of how to set up scenes for GI baking to operate optimally, common pitfalls and so on, that would help tremendously.

    edit:
    Also cleaning up geometry so there are no overlapping faces might have helped.
     
    Last edited: Aug 2, 2015
    hippocoder likes this.
  6. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,105
    Well here is my thought.

    1) if the GI baking was intentionally designed to work with CPU only from the first place, then we should seriously consider abandoning it as the baking performance will not improve in the future, making the whole system obsolete real soon. (I am assuming that CPU hardware baking speed won't improve drastically) Maybe some bugs will help when they are fixed, but it is just not going to be practical to limit the calculations to CPU. Although if we had 64 core CPUs it might be a different story. haha

    2) I am almost certain that it will be - given the nature of baking and the way GPU works. But, I could be wrong. It really is a suggestion, and since we don't really have a prototype or anything, why not give it a try?

    3) I have plenty of RAM to work with graphics already and it isn't helping, and I don't think plugging in more modules is going to help at this stage.

    yeah, but at production level, those things are done anyway so I don't really see that as a way of improving anything. Most of my experiences involve clean mesh and all. I even UVed some of it again hoping it would help.

    I am making this GPU suggestion because I see the future of GI pretty much the same as it is now in a few years. I am sure it will reach some plateau of stability but speed improvement? Not so much.

    Also, I think Unity should seriously toss Auto baking and introduce regional baking. Interface wise, we can have something similar to reflection probes with cubic space and a button to bake GI for that boxed area alone. Don't know about everyone else, but for my workflow, this would be more practical. This one is just my take on baking methods so, don't mind it too much :)

    but seriously, we need GPU baking.
     
    Last edited: Aug 3, 2015
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,002
    I remember when Brad Peebler of Luxology was researching GPU rendering for modo, the conclusion that they reached was it was no silver bullet. It was barely any faster and there were a lot of limitations.

    It was a while back though, things may have changed since then. But I still believe it's not as easy or as effective to implement it as the OP presents it (4hours to 4minutes).
     
  8. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,105
    agreed, I really don't think we will ever achieve 4 minutes. It's just not realistic :)

    but as for baking, I seriously find it weird that there is no room for GPU optimization. And if that turns out to be the case, then I will probably have to build a "baking farm" type of a machine with 100gb+ ram and 16 core CPU. It is a very primitive way of tackling hardware limits, but I make video games not render tech at the end of the day.
     
  9. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    427
    No doubt 4hours versus 4minutes is exaggerated, but it MUST have significant improvement if GPU can do its job and we tested it countless times in ANY other render engines. So I would rather think it's a design flaw :\ Perhaps that sounds harsh, but I'm sure you will feel better if you had bulit a medium-sized scene.
     
  10. macdude2

    macdude2

    Joined:
    Sep 22, 2010
    Posts:
    686
    Its hard to explain why this what you're thinking doesn't actually make complete sense unless you have some understanding of the algorithms behind light mapping and the way CPUs and GPUs work, but unfortunately this is not the case. In fact, a render farm is probably the best solution to light mapping at the moment despite it being inelegant.

    What I'm holding out for, though, is SE's realtime GI. In theory, what he's made should allow us to generate decent light mapping much quicker than with enlighten. His solution looks at the light problem in a completely different way than conventional light mapping algorithm works and could in theory be a very solid solution to our problem.
     
  11. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I can't see anything taking several precious millisecs at runtime being any kind of solution for me.
     
  12. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    427
    Hey, I'm also interested in his big plan, any news?
     
  13. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    No, there's no news. No point in holding out for something that might not arrive or when, and might not support actual baking at all. It's completely far fetched at the moment.
     
  14. macdude2

    macdude2

    Joined:
    Sep 22, 2010
    Posts:
    686
    I mean, I wouldn't go so far as to say "far fetched". He has a pretty solid demo up and I am confident it will eventually be released. Furthermore, there will be a way to transfer the data he has generated into light maps. I think the questions at the moment are in regards to quality and what to do about large environments. I have a few ideas myself and I'm sure quite a few others do. Maybe I'm too hopeful, but the possibility seems to exist.
     
  15. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    You just have to rely on what's available now. Given it's taken so long to even get to the realtime portion of it, and that's not out yet, I don't see this as being remotely viable. It's just theory :/
     
    GoGoGadget likes this.