Search Unity

Lightmap textures become darker when swapping from PC to Android.

Discussion in 'Global Illumination' started by Prodigga, Jan 5, 2017.

  1. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    796
    Our lightmap textures become darker when swapping from PC to Android.

    Not using Precomputed Realtime GI. Only using Baked GI. Ambient Occlusion enabled. No lights in the scene. Ambient color light gray. (85% rgb). Our goal is to bake ambient occlusion.

    The bake looks fine on PC, but when we swap to Android the lightmap textures become darker (Even if we re-bake the scene). Looks completely different.

    Left is PC, right is Android

     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    6,267
    Are you on 5.5.0p3?
     
  3. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    796
    No, I have tried this on 5.4.1f1 and the latest beta.
     
  4. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    796
    @AcidArrow tried 5.5.0p3 as well - same issue.
     
  5. UDN_b12c25da-88c4-4cbb-bccc-4c7f86bfbf28

    UDN_b12c25da-88c4-4cbb-bccc-4c7f86bfbf28

    Joined:
    May 26, 2016
    Posts:
    1
    yes...I have the same problem,is baked system available in Android platform?
     
  6. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    2,892
    My guess would be the the color space, Linear on desktop VS Gamma on android.
     
  7. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    796
    No both are set to Gamma on my end.
     
  8. lavi_mahal

    lavi_mahal

    Joined:
    Nov 30, 2016
    Posts:
    9
    do u guys found any solution for this????
    I m facing this problem too...... I on latest unity build (2017.1)
     
    Last edited: Sep 1, 2017
  9. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    6,267
    I've seen this in a few build around the 5.5 releases, but it was quickly fixed.

    Since then I haven't seen it happen again and I'm building for android pretty regularly these days.

    Have any of you made a repro scene? Submit a bug report with it and it could also be a good idea to post it here so we can see if it has anything to do with your specific computers or android devices, or something.
     
  10. lavi_mahal

    lavi_mahal

    Joined:
    Nov 30, 2016
    Posts:
    9
    May be u know what is wrong with baking lightmap for android. I have read somewhere that lightmaps when used on android work as 2x LDR (converted from editor lightmap which is RGBM) so it losses its hdr information and looks dark.
    See my projects screens here
    May be u can guide me as u r building for android regularly.
     
  11. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    6,267
    That's true, but it means that some higher values are clamped, not that the overall texture gets darker.
     
  12. lavi_mahal

    lavi_mahal

    Joined:
    Nov 30, 2016
    Posts:
    9
    So what I am doing wrong????
    I pretty much checked every option in lighting window.
    Please help
     
  13. big_march

    big_march

    Joined:
    Mar 2, 2015
    Posts:
    37
    I met the same problem.
    Has anyone solved it?
     
  14. lavi_mahal

    lavi_mahal

    Joined:
    Nov 30, 2016
    Posts:
    9
    Hope its not too late to reply,
    I just found that android doesn't support the baked lightmap in linear space and it fall backs to sRBG or LDR (not sure what it was called). So what I did was simply changed the color space back to gamma and pumped the ambient light very high to get a similar look. Its not the exact same but its almost same.
     
    NGC6543 and pixelR like this.
  15. pixelR

    pixelR

    Joined:
    Sep 16, 2013
    Posts:
    38
    I can confirm that switching to gamma solved my problem too. It's a bit weird, as LWRP supported Linear color space well enough until I updated to Unity 2019.1.0b7 yesterday, so my specific scenarion might just be a temporary, unlucky combination of 2019.1 beta and LWRP 5.6.1 (and even LWRP 5.10.0) package...

    But since I want to support a bit older devices too, if I can pull it off, I guess I'm better off with gamma color space anway.
     
  16. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    209
    I'm experiencing the same here on Unity2019.1.0f2 with LWRP v5.7.2. Looks like Unity Dev need to investigate this issue.
     
  17. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    402
    Make sure that Lightmap Quality is set to either Normal or High in the Player settings for the platform of your choice.

    Here's a brief overview of what each setting does:
    • Low Quality -> dLDR (same as before)
    • Medium Quality -> RGBM (ETC2 compressed, ASTC on tvOS)
    • High Quality -> native HDR (RGB9e5, ASTC HDR for Android coming in a later PR)
    • OpenGL ES 2.0 only supports Low Quality, added warnings similar to Linear Rendering
     
  18. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    209
    Hi @kristijonas_unity , thanks for your reply.

    I tried what you suggested, but didn't fixed my issue. I tried the Lightmap quality to both 'Medium' and 'High'.

    This is the expected result(Editor), and Standalone build works fine :
    On Editor and Standalone.png


    But on Android, it looks like this :
    On Android_Lightmap with linear color space looks darker.png
     
  19. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    402
    Seems like there's no ambient light in the second screenshot. What is your lighting setup? Could you please post a screenshot of your Lighting Settings?

    Also, which color space are you using?
     
  20. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    209
    스크린샷 2019-05-09 오후 6.39.53.png

    Also, I only use 1 mixed directional light so, I disabled Additional Lights and checked 'Mixed lighting' option in LWRP Asset.
    스크린샷 2019-05-09 오후 6.41.35.png
     
  21. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    402
    Please open a bug with a small repro project. Thanks!
     
    NGC6543 likes this.
  22. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    209
    It was a postprocess layer attached to the camera that causes the issue. But it's weird, since the postprocessing only affects a certain layer(Vehicle in my project) only, and all it does is anti-aliasing and Bloom.
    I'll do another research and if the problem persists, I'll submit a report then.
     
    Last edited: May 10, 2019
    kristijonas_unity likes this.
  23. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    209
    I did some more test using another Android device(Nvidia Shield TV with genuine Android ROM) and the repro scene rendered as expected. My target device is a custom Android board(Hardkernel's Odroid XU-4 device with custom Android ROM(Lineage OS)) so fixing it looks very hard or never be achieved.:eek:
     
  24. salma_unity986

    salma_unity986

    Joined:
    Mar 13, 2019
    Posts:
    2
    Facing the same issue while building using unity 2018.2.0f2 editor . Is this an issue because of postprocessing or lightmap baking ?
     
  25. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    209
    In my case, the problem lies on a hardware / OS side. My target device runs custom Android OS(Linease OS) and it looks like the OS has some bugs. I couldn't fix the issue.
     
  26. salma_unity986

    salma_unity986

    Joined:
    Mar 13, 2019
    Posts:
    2
    Thanks for the reply , In my case upgrading project to Unity 2018.3 resolved the issue
     
unityunity