Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

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:
    1,125
    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:
    11,881
    Are you on 5.5.0p3?
     
  3. Prodigga

    Prodigga

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

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,125
    @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:
    3,276
    My guess would be the the color space, Linear on desktop VS Gamma on android.
     
  7. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,125
    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:
    11,881
    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:
    11,881
    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:
    38
    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:
    58
    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:
    228
    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:
    1,080
    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:
    228
    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:
    1,080
    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:
    228
    스크린샷 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:
    1,080
    Please open a bug with a small repro project. Thanks!
     
    NGC6543 likes this.
  22. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    228
    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:
    228
    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:
    228
    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
     
  27. God-at-play

    God-at-play

    Joined:
    Nov 3, 2006
    Posts:
    330
    I'm having this problem with 2019.3.0f5. Changing compression settings did not make a difference, at least for 32-bit EXR images. I'd prefer uncompressed lightmaps, and setting to None did not help either.

    UPDATE: My problem is with the Unlit / Texture shader. If I use the workaround of switching to Mobile / Diffuse and then setting environment lighting to a white ambient with Intensity of 1, it works as expected. Not ideal, but hopefully it won't make a big difference for performance (this is for mobile VR, so every little bit helps).
     
    Last edited: Jan 26, 2020
  28. JenniferNordwall

    JenniferNordwall

    Unity Technologies

    Joined:
    Sep 19, 2016
    Posts:
    160
    Would you mind creating a new thread and add a bit more info? Thanks :)
     
  29. OmarVector

    OmarVector

    Joined:
    Apr 18, 2018
    Posts:
    130
    I know its old post, but my case was SSAO as render feature was enabled in the render feature... removing that made the lightmap looks the same as in the editor... And I'm speaking for assets bundle not just the build

    Its weird when building assets bundle and this happen to get darker lightmap if SSAO is enabled in render feature.

    Should I file a bug regard that or what?