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:
![]() |
![]() |
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:
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.
Inconsistant light map between PC and Mobile under Unity3D的更多相关文章
- zepto点击事件兼容pc和mobile
判断pc还是mobile,重写click事件 var CLICK='click'; (function browserRedirect() { var sUserAgent = navigator.u ...
- HTML5 PC、Mobile调用摄像头(navigator.getUserMedia)
废话少说,先贴上代码 html: <div id="main" class="masthead"> <div id="face_sc ...
- 判断PC或mobile设备
js 限制: <script type="text/javascript"> function uaredirect(f){try{if(document.getEle ...
- Launch Google Map in Android / IOS Mobile
<!--This only works in android mobile phone--><a href="geo:0,0?q=myaddress+encode)__&q ...
- 伪响应式开发(PC和Mobile分离)
screen.width 无论把浏览器缩小还是放大,screen.width的值都不会改变,但是IE9及以上浏览器才支持这个属性. @media screen 媒体查询的巨大缺陷:切换页面布局的时候J ...
- nginx 区分pc和mobile 到不同的404页面
if ($http_user_agent ~* '(Android|webOS|iPhone|iPod|BlackBerry|vivo)') { set $mobile_request '1'; } ...
- PC windows mobile 文件拷贝
在windows 系统中提供 RAPI.DLL,只需将RAPI.DLL中的,函数导出就可以实现文件拷贝.
- light Map
Unity5中lightmap的坑 http://blog.csdn.net/langresser_king/article/details/48914901 Unity中光照贴图一二坑及解决办法 h ...
- 百度地图Map属性和方法
map的L属性:TANGRAM__1 map的F属性:[object Object] map的xa属性:[object HTMLDivElement] map的width属性:1340 map的hei ...
随机推荐
- 20个实用javascript技巧及实践(二)
21. 使用逻辑AND/OR来处理条件语句 var foo =10; foo ==10&& doSomething();// is the same thing as if (foo ...
- Memcache 学习笔记(一)----Memcache — Linux部署
Memcache 一.Memcache简介(内容摘自 --百度百科) memcache是一套分布式的高速缓存系统,由LiveJournal的Brad Fitzpatrick开发,但目前被许多网站使用以 ...
- Hibernate (ORM)
1 框架体系结构 2 hibernate入门 2.1 ORM框架 Hibernate是一个数据持久化层的ORM框架. Object:对象,java对象,此处特指JavaBean Relational: ...
- 转:hive面试题
有一张很大的表:TRLOG该表大概有2T左右TRLOG:CREATE TABLE TRLOG(PLATFORM string,USER_ID int,CLICK_TIME string,CLICK_U ...
- makefile 通配符了解% $@ $^ $<
把目录下所有文件都编译的命令. 1 all:$(subst .c,.o,$(wildcard *.c)) 2 3 %.o:%.c 4 gcc -o $@ $< 下面是几个特舒符号的意思: $@: ...
- mongodb远程连接
1.关闭防火墙 firewall-cmd --state 查看防火墙是否运行中 systemctl stop firewalld.service 关闭防火墙服务 2.使用bind_ip指定 ...
- vscode环境配置
"go.goroot": "/home/ken/go", "go.gopath": "/home/ken/gopath" ...
- 使用POI解析Excel时,出现org.xml.sax.SAXParseException: duplicate attribute 'o:relid'的解决办法
1.使用org.apache.poi解析excle,.xlsx类型文件InputStream is = new FileInputStream(strFileName);XSSFWorkbook wb ...
- Spring学习总结之---装配Bean
Spring配置的可选方案 前言:Spring容器负责创建应用程序中的bean并通过DI来协调这些对象之间的关系,作为开发人员,你需要告诉Spring容器要创建那些Bean,以哪种方式创建,并且如何将 ...
- February 19 2017 Week 8 Sunday
We accept the love we think we deserve. 我们接受自己认为配得上的爱. A few months ago, I tried to date with a girl ...

