Search Unity

Inconsistent ambient when using precomputed realtime GI

Discussion in 'Global Illumination' started by Berenger, Nov 8, 2016.

  1. Berenger

    Berenger

    Joined:
    Jul 11, 2012
    Posts:
    78
    Hi guys,

    I'm having inconsistent results with my lighting due to the environment ambient lighting. In the pic below, you can see that the doors are brighter than the drawers in the scene view / irradiance mode.

    ss.jpg

    This is Unity 5.4.1f1. My lights are turned off. Here are my settings :

    ss_lighting.jpg ss_scene.jpg ss_camera.jpg

    What is going on ? Should I even use ambient lighting at all ?
     
  2. SentientSkull

    SentientSkull

    Joined:
    Apr 26, 2013
    Posts:
    75
    I have similar issues. With building interiors, some walls will just 'glow' for no reason. If I turn off indirect light and/or ambient light, it goes away. I try to adjust the lighting settings, but nothing will affect it at all. I'm on v5.4.2f1.
     

    Attached Files:

  3. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    Two tips:
    All shaders must be the same (with same color brightness)
    Lightmap UV must be generated for each model before baking
     
  4. Berenger

    Berenger

    Joined:
    Jul 11, 2012
    Posts:
    78
    @aliyeredon In my case, I disabled the autounwrapping of lightmap UV from the model import settings and unwrapped them manually. Both my doors and drawers are using the same material.
     
  5. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
    Hey @Berenger,

    Have you assigned custom lightmap parameters to your objects? If not, can you try what @aliyeredon2 suggested, generate lightmap UV in import settings and see if you still end up with the same result? I think it's related to the way you created your UV maps. So if you can try that, we can narrow down the problem. In addition to that, can you also share how "Irradiance" mode looks like in your scene view and lastly, which version of Unity are you using?

    Thanks!
     
  6. Berenger

    Berenger

    Joined:
    Jul 11, 2012
    Posts:
    78
    I've tried for the table in front of the screenshots below, but with no luck so far.

    imgur.com/a/ZiUo6
     
  7. Berenger

    Berenger

    Joined:
    Jul 11, 2012
    Posts:
    78
    Ok so I got better resultq this time, here is what happens.

    I have a big Fbx containing the walls, the floors, the ceiling and the kitchen's furniture. The other items are from their own fbx. In my previous post, i tried changing the table's import settings without success. This time I tried changing the big fbx import settings (auto lightmap uv on) and everything looks as it should. I'll investigate further and I'll get back to you. Thanks :)
     
  8. Berenger

    Berenger

    Joined:
    Jul 11, 2012
    Posts:
    78
    So I extracted the furniture from the walls. They now have their own file. Aaaaaand I'm back to square one ... Although it's only in the living room now, kitchen mostly fine. Doesn't seem to matter if all my models unwrap lightmap uvs automatically or not.

    Here is a package with the scene. I removed all the textures to make it lighter. If you play with the environnement ambient you'll notice some objects are more affected by it than others.

    https://drive.google.com/file/d/0B6RhFyXBTlpbVW96NERXRGNIWUk/view?usp=sharing
     
  9. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
    The issue is identified and it's being investigated. I'll also post an update here when we have more news. Thanks for providing information!
     
  10. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
    One more user reported a bug for this issue recently and although the problem still persists, there are workaround solutions, therefore I will share my insights here so that it's beneficial for everyone, especially for those who are using modular tile sets. So if you encounter a problem as depicted in the image below, you'll able to "make it work" after applying these solutions.

    01.gif

    First of all, in Baked Lightmap scene visualization mode, it is possible see that it is the Ambient Color that ignores occluders and leaks into geometry. Changing Ambient Color and building lightmaps again reveals this issue. It is caused by multiple factors so I will try to explain how you can address these issues.

    1) Modular Tile Pieces: First of all, you can “easily” fix this problem by welding all your geometry and merging them together in your external 3D package. But obviously, you will then lose the flexibility of working in-editor and this is not preferable. But working with modular tile pieces bring an important problem that needs to be taken into account while handling lighting. It is explained in the next section.

    2) Gaps and Light Leaks: When placing modular assets, it is easy to ignore the gaps and regardless of how much importance you pay to snapping and grid, some manual tweaking of assets is necessary to avoid leaving gaps in-between pieces. Otherwise rays from light sources can easily leak through and generate unwanted renderings. This was not the root cause of the problem in your scene but helps to fix some “consistency” problems here and there. So it’s always a good practise to keep this in mind.

    3) Indirect Resolution: Technically, Enlighten always precomputes realtime light maps even when Realtime GI is disabled and this problem is caused by realtime lightmaps. When working on other cases that encountered the same issue, we observed that lowering indirect resolution helps to fix this issue. Usually, an indirect resolution value of 10 or bigger than that introduces this problem. In addition, there is no way to discard realtime light maps when working with Enlighten backend.

    4) Different Systems: Using high indirect resolution values split lightmaps of assets into different systems. When this is the case, some assets can no longer *read* each other and therefore, some assets can not read the occlusion data from occluders and simply ignores them, which causes ambient light to affect them directly. Now as mentioned in third section, lowering indirect resolution is one way to force the assets to be included in the same system. Another alternative is to use “Prioritize Illumination” flag under Mesh Renderer component. This option also forces assets to be evaluated under same system.

    5) Clustering issues: If you switch to Clustering scene viz mode, you will see that there are some missing clusters on the geometry, particularly on the walls and the ground. This clustering issue especially occurs when you use single sided geometry such as planes. Backface of single sided geometry can invalidate clusters and can cause light leaks. Assets can be authored more carefully in order to prevent this issue. In this case, I have simply used default and large Unity cubes as occluders behind these geometries and this has really helped to fix the issue.

    Clustering.png

    6) Using hemisphere skybox model instead of ambient: Another workaround you can use in order to achieve consistent lighting is to eliminate Ambient Lighting completely and use a hemisphere as skybox instead of ambient.

    Link for original case in IssueTracker: https://issuetracker.unity3d.com/issues/realtime-gi-some-static-objects-are-brighter-in-enlighten (you can vote for it, so that it's prioritized but lighting team is already aware about the problem)

    I hope this helps until a proper fix is available.

    Thank you,
    Graphics QA Team
     
    scvnathan likes this.