Search Unity

Unity Lightmap Baking and GI problems (beginner)

Discussion in 'Global Illumination' started by madpolydev, Jan 18, 2019.

  1. madpolydev

    madpolydev

    Joined:
    Nov 23, 2016
    Posts:
    86
    So I have been fiddeling around wiht unity's lighting and I must unfortunately say that it is very problematic. I keep getting seams across my wall modules which are standard unity prefabs just scaled up 10x and modified so they look like walls. The objects around dont seem to be picking up the colors from my sphere( yes everything is static). What also frustrates me is that I have to put the lightmap resolution to 10 rather than 4 which was recommended for indoor scenes just to avoid any artifacts and seams. Can someone explain me what I am doing wrong. I have followed tutorials but all of their lightmaps seemed to bake fine except for mine which always looked weird and had many seams and artifacts. I dont know what I am doing wrong.

    https://imgur.com/a/pCkRffO

    In this album the first picture is with resolution of 4 the other has 10. Notice that I dont get blue tinted bounces plus notice how bad the walls and seams are even with a high resolution
     
  2. madpolydev

    madpolydev

    Joined:
    Nov 23, 2016
    Posts:
    86
    https://imgur.com/a/qRIg48l

    decided to give it a little bit of metalness and as expected the seams are destroying my reflections and somehow the sphere isnt even represented in the wall reflection. It looks like a blue shadow in the reflections, thats it
     
  3. poulskrae

    poulskrae

    Joined:
    Aug 10, 2018
    Posts:
    8
    Have you added the "Stich Seams" to the wall object, for the Static Lighmap Calculation?

    upload_2019-1-18_10-56-1.png
     

    Attached Files:

  4. madpolydev

    madpolydev

    Joined:
    Nov 23, 2016
    Posts:
    86
    Yes I think so. And whats the issue with my sphere not bouncing the color on the walls?
     
  5. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    There is no easy way to mitigate seams across different game objects. One way to fix it would be to use larger contiguous meshes, as opposed to smaller modular ones.

    Stitch Seams toggle only mitigates lightmap seams for a single game object, not for separate objects.
     
  6. madpolydev

    madpolydev

    Joined:
    Nov 23, 2016
    Posts:
    86
    How come I follow tutorials and the tutorial doesnt show the artifacts I am getting at all? Like same settings and all? And what about the sphere not bouncing off blue color? What do i need to do to make it react and bounce blue ish tints to the environment?

    So far I am pretty frustrated with unity. Following tutorials is very inconsistent as I am running into issues despite of following the same procedures as the tutor; while his bakes seem to be flawless. I really don’t get it. Would be nice if someone could adress some of my issues and help me fix them :)
     
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    Is the sphere static?
     
  8. madpolydev

    madpolydev

    Joined:
    Nov 23, 2016
    Posts:
    86
  9. madpolydev

    madpolydev

    Joined:
    Nov 23, 2016
    Posts:
    86
    so i tried lightbaking a scene again and look how bad the bakes are even at 150 units per texels! after that I had switched to realtime lightmapper to see how it would look and the scene got overexposured like crazy.

    I am sorry to complain here but unity has been such a pain to work with so far as almost every attempt of doing lighting ends up in weird unexplainable issues. Seams and bad behaviour everywhere even though tutorials show non of these signs. Please help me out as I am going crazy
     

    Attached Files:

    • 45.JPG
      45.JPG
      File size:
      135.7 KB
      Views:
      727
    • 452.JPG
      452.JPG
      File size:
      190.6 KB
      Views:
      662
  10. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    The value value you should have raised should be the indirect samples.
     
  11. madpolydev

    madpolydev

    Joined:
    Nov 23, 2016
    Posts:
    86
    Well I am willing to try one last time and if it doesn’t work out I am honestly just gonna switch to unreal.
     
  12. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    Well, if you switch engines that easily, you're going to run out of engines soon.
     
    Ruslank100 and dadude123 like this.
  13. madpolydev

    madpolydev

    Joined:
    Nov 23, 2016
    Posts:
    86
    True, maybe I am just burned out a bit. Tried to do alot of fixes yet none worked yet .. kinda made me mad a bit since I think I have fiddled with so many settings already
     
  14. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    Whenever you observe noise artifacts in your lightmaps, it indicates that you need to shoot more samples. Please raise the Indirect Samples amount to get rid of the noise in indirect area, just as @AcidArrow had suggested.

    Increasing the Lightmap Resolution does exactly what is says, it simply raises the global lightmap resolution value, but it will not rectify the noise. Increasing lightmap resolution is useful if you want to get higher fidelity bakes and well-defined baked shadows. Keep in mind that this setting will bloat the bake times considerably.\

    In your case, I would suggest the following:
    • Set your Directional Light to Mixed mode to have the benefit of realtime direct contribution and baked indirect GI
    • Direct Samples at 32
    • Indirect Samples at 4096
    • Switch to Advanced filtering and enable A-Trous filtering to preserve edge details
    • Lower the Lightmap Resolution to 32
    • Increase the Lightmap Size to 2048, as this should reduce the number of lightmaps considerably
     
    AcidArrow likes this.
  15. madpolydev

    madpolydev

    Joined:
    Nov 23, 2016
    Posts:
    86
    Hey,

    I had switched to unreal and here is my result (attached).

    Although I encountered those artifacts as well, I was able to fix them quite a bit today due to the community and fixes provided. I could find fixes for that issue for unreal but some of the fixes regarding this for unity were kind of unanswered and I had followed alot of tips. Anyway, what you have to do is place ur lightmap uvs on the grid and have enough padding between the shells. In unreal you then had to fiddle with some settings (that i couldn’t find in unity?) and then I got this result. Its not perfect but close enough.

    Overall I am way more happy with what unreal offers out of the box compared to unity. I hope that unity will soon catch up, its also a spectacular engine but as an artist, unreal is just better and offers me lots of flexibility like shader graph etc.

    Thanks for the help guys!
     

    Attached Files:

  16. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Unity has a shader graph too https://unity3d.com/shader-graph :)
     
  17. madpolydev

    madpolydev

    Joined:
    Nov 23, 2016
    Posts:
    86
    yea but its very limiting at the moment i think? No vector displacement atm Afaik:

    also found out that you can "merge actors" in unreal which reduces draw calls but also got rid of all the lighting seams as unreal merges the objects.
     
  18. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913