zoukankan      html  css  js  c++  java
  • Inconsistant light map between PC and Mobile under Unity3D

    Author: http://www.cnblogs.com/open-coder/p/3898159.html

    The light mapping effects between PC and Mobile become very incosistant just as following:

    Android_Lightmap PC_Lightmap

    With the same light maps, the left one is the Android Platform, and the right one is the PC Platform. But the right one is much brigher than the left one.
    Why? ????????????
    Let check the Unity3D light map decode function:
    lightmap_range
    The reason is that the light map encode use High dynamic range encode. The range on the PC is [0, 8], but the range on the Mobile will only in [0, 2].
    That means the when you switch the platform from PC to Android, the light map color range will clamp to [0, 2] no matter what value it is.
    And the best way to keep light map consistant on PC and Android is keep the light map color range in [0, 2].
    Sometimes, we would like to multiply the light map color with a factor. I strongly suggest that please make sure this factor larger than 1.0 (Only bright is instead of darker it).

    One altive method is also keep RGBM encode for light map on the mobile platform. Bake the light maps on the PC first, then retrieve those PC RGBM lightmaps out of the scene saved them as RGBM texture. Relink the scene light map setting with those RGBM textures.  Since we need a high precision for alpha channel, we need to save the alpha as another texture. That means we need two light maps on mobile device, one for RGB and another with one channel only to keep the M. The shader should be re-write too, Far and Near lightmaps could be keep as those two light map slots. Remember that here you need to keep a much higher precision for light intensity that value may more than 2, so you need to use at least half type variable to hold those immediate values in the shader.

  • 相关阅读:
    2020.11.5收获
    代码大全2阅读笔记11~1
    2020.11.4收获
    2020.11.3收获
    2020.11.2收获
    Java学习10.21(javaweb对输入信息进行验证1)
    Java学习10.20(使用 form 元素)
    Java学习10.18——Javaweb常用表单元素
    Java学习10.17(新课程添加)
    Java学习10.11
  • 原文地址:https://www.cnblogs.com/open-coder/p/3898159.html
Copyright © 2011-2022 走看看