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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Baking give very bad results (I may be doing something bad)

Discussion in 'Global Illumination' started by rapidrunner, Mar 19, 2016.

  1. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    I am trying to understand how to use proficiently the GI system. Most of my scene is marked as static; I just have few indoor areas with point lights, to simulate ceiling lamps; which I would like to turn on and off.

    Now, I did read the docs about how to configure the GI settings, but I get continuously sub par results.

    1) Baking takes forever; and when it runs, I get often errors related to a baking that didn't successfully complete. Sadly the console has only a brief description of what happened; so I can't track the issue. So far it is happening more often, since when I installed the latest release of the editor (the one released few days ago, not the beta).

    2) Using a skybox; if I select my direct light as sun; it get selected when I bake, but then it is deselected from the "sun" slot in the illumination settings; I assume that since I have only one direct light, it does not require me to put the gameobject in the slot, but it is strange anyway.

    3) once baking is done; some objects have artifacts (check picture attached); it looks like a corrupted jpeg image, where you see dark pixels all over. It did happen few times already; the only way to fix it, is to clear all the maps and bake again (in my case it takes about 20 minutes, for a very simple scene).

    Capture.JPG

    4) even if in the preview, the light intensity is very high; to the point that it wash away colors; when the baking is completed; the internal rooms looks really dark. I like that sort of mood given by the light bleeding through doors and windows, but I would expect to see a room with open windows, illuminated like in the real world by sunlight; with average intensity. Cranking up intensity in the baking settings, didn't make much of a difference.

    I am looking online for a good tutorial that explain how to bake correctly; so far I did try to change the parameters following the manual, and also I did try the standard configuration for baking (which include both GI render paths; which on the manual is described as a waste of space and memory, but it is the default settings); but it is not giving me the results that I would expect. Any suggestion is appreciated; I may be doing somehting wrong here, and it could be not related to Unity itself.
     
  2. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Did you tick on the generate lightmap uvs select model > model > generate lightmap UV box?
     
    DaveMero likes this.
  3. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    For some objects I did; for others I didn't.

    I can't see a difference between the objects that has that tick on and the ones without; the artifacts appear in both cases
     
  4. halfshey

    halfshey

    Joined:
    Apr 26, 2015
    Posts:
    15
    Hi,

    just looked at your image, and i had similar artifacts.

    Try out to change the pushoff value in the lightmap settings.
     
  5. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    Where is this value handled from ? I don't recall any pushoff neither on the light component of the light GO, nor on the lighting panel.
    For the time being I ditched the baked option, in favor of Precomputed realtime GI....it is not perfect but at least is fewer parameters to play with, and also more consistent outcomes
     
  6. halfshey

    halfshey

    Joined:
    Apr 26, 2015
    Posts:
    15
    Under the default Parameters in the Lighting Window, you can create a new one. You can edit these settings and they are pretty important. Don't know why they are hiding them. :D In these settings you will find the pushoff value.
     
  7. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    Fascinating...is this a pro feature? I have the scene panel of the lighing tab in front of me, and all that I see is
    - environment lighing
    - precomputed realtime GI
    - baked GI
    - General GI
    - Fog

    There is asection called "other settings", but I don't see any way to add parameters in there either.

    Do I have to fiddle with some menu to get the option to add new parameters? Sorry but I am very new with Beast in general; this is my first project where I am using all the various Unity components...in the past I just wrote code, touching the editor just to see how things are coming up :)
     
  8. halfshey

    halfshey

    Joined:
    Apr 26, 2015
    Posts:
    15
    Yeah, no worries, like I said it is pretty much hiding! :p

    It's und General GI:
    ...
    ...
    ...
    Default Parameters.

    There you can set different quality settings, there are some predefined settings like Default, Default High Resolution etc... But you can also make a new one and edit it. And in these settings you will find a value called Pushoff.

    Try to set it to 0.1 and see if the artifacts are gone.

    You can also lower the resoultion in this setting to make really fast lightmap tests.
     
    rapidrunner likes this.
  9. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    ARGH!, now I see it :)

    Will try that and see if that makes any difference. I assume that is for both precomputed and baked GI, so it will be useful to experiment with various settings.

    For now, out of frustration, I just gave up on baked; my scene looks rubbish, because I have indoor and outdoor locations; so I can't find something that give me nice indoor light, and not washed effects on the outside elements and walls.
     
  10. halfshey

    halfshey

    Joined:
    Apr 26, 2015
    Posts:
    15
    It's so sad that lighting just keeps breaking :( We are developing a VR Game in which we need to use 5.3.4p1, now we are getting stuck on bake indirect... In 5.2.3p2 it didn't...
    Once you see how good baked lighting can look you can't go back to realtime anymore :D and of course the performance reasons.

    I really hope that it will get better soon... I just love Unity but lightmapping definitely forces me to use unreal on the next project. :(
     
    Last edited: Apr 1, 2016
    rapidrunner likes this.
  11. halfshey

    halfshey

    Joined:
    Apr 26, 2015
    Posts:
    15
    In case anyone else get stuck on bake indirect -> Seems like this is the case for very big scenes. Change the scale in lightmap parameter under the objects tab of the lighting window. That should work :) , but it will take some time to adjust your settings to create a good looking lightmap again.
     
  12. DavidMarchessault

    DavidMarchessault

    Joined:
    Jan 8, 2016
    Posts:
    2
    Those are overlapping lightmap UVs as far as I know.