Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Batching static makes lightmapped object appear brighter in play mode

Discussion in 'Global Illumination' started by KennyGuillaume, May 11, 2020.

  1. KennyGuillaume

    KennyGuillaume

    Joined:
    Mar 7, 2014
    Posts:
    11
    Hi

    I'm running into an issue and can't find any solution online.

    I've started introducing baked GI into my scene. One directional light source uses the 'mixed light mode', all other light sources (a few point lights) are all marked as 'baked'.
    For the smaller objects I'm not using lightmaps, but instead relying on light probes.

    These are my lightmapping settings:
    03_LightmappingSettings.png

    In scene view everything looks as expected:
    01_SceneView.png

    But in playmode, some/most/all (I think some are just more prominent than others) objects appear to be brighter.
    02_PlayMode.png

    I can confirm that it only affects the objects that are marked to be 'batched static'. When they are not batched, everything looks normal.

    Using,
    Unity 2019.3.7f1
    Custom amplify shader

    Any help would be greatly appreciated!
    Thanks.
     
    Last edited: May 11, 2020
  2. KennyGuillaume

    KennyGuillaume

    Joined:
    Mar 7, 2014
    Posts:
    11
    Might be important as well. It happens both with objects influenced by:
    - light probes (the ivy in the top right corner) and
    - lightmapped objects (the old wooden box bed)
     
  3. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    168
    Static batching groups meshes together, essentially building a new mesh. Per object probes are calculated based on the mesh's bounding box, so a batched mesh may end up with an interpolated probe that's different from what the invidivual mesh would have received. Are you sure the brightended lightmapped objects are actually using the lightmap when rendered?
     
  4. KennyGuillaume

    KennyGuillaume

    Joined:
    Mar 7, 2014
    Posts:
    11
    Hi. Thanks for the help!

    The ivy plants get static batched and use light probes indeed. Makes sense it would happen there, of course!
    So, the alternative here would be GPU instancing?

    But, the other object, in this screenshot selected, is using a lightmap as you can see.
    And it still appears brighter once I go into playmode and it gets batched.
    Annotation 2020-05-13 162254.png
     
    Last edited: May 13, 2020
unityunity