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 ...
随机推荐
- mockjs
首先还是那句话,进来的GodBoy and GoodGirl 不妨看完再离开. 一个走在路上的前端攻城狮-along 一.mock的由来 mock有“愚弄.欺骗”之意,在前端领域,mock可以理解为 ...
- JSTL数据格式化
日期表示 <fmt:formatDate value="${DATE1}" pattern="yyyy-MM-dd hh:mm:ss" type=&quo ...
- 表格 滚动条 (tbody部分滚动)
本文是从简书复制的, markdown语法可能有些出入, 想看"正版"和更多内容请关注 简书: 小贤笔记 html <table> <thead> < ...
- Intellij IDEA快捷键大全汇总
Alt+回车 导入包,自动修正 Ctrl+N 查找类 Ctrl+Shift+N 查找文件 Ctrl+Alt+L 格式化代码 Ctrl+Alt+O 优化导入的类和包 Alt+Insert 生成代码 ...
- C语言——顺序表插入、删除、定位运算算法
说明:将元素x插入到顺序表L的第i个数据元素之前,这个i是从1开始的,但是程序中数组都是从0算起的,不要混淆了. 头文件: header.h // 顺序表的结构定义 #define Maxsize 1 ...
- 19_ThreadLocal
[概述] 线程局部变量,是一种多线程间并发访问变量的解决方案.与synchronized等加锁的方式不同,ThreadLocal完全不提供锁,而使用以空间换时间的手段,为每个线程提供变量的独立副本,以 ...
- Distributed TensorFlow
Distributed TensorFlow Todo list: Distributed TensorFlow简介 Distributed TensorFlow的部署与运行 对3个台主机做多卡GPU ...
- python SQLAchemy常用语法
SQLAlchemy是Python编程语言下的一款ORM框架,该框架建立在数据库API之上,使用关系对象映射进行数据库操作,简言之便是:将对象转换成SQL,然后使用数据API执行SQL并获取执行结果. ...
- 插入mysql语句报错:1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
插入一个很简单的sql语句时候,mysql一直报错: [SQL] INSERT INTO ORDER ( id, activity_id, order_type, phone, order_amoun ...
- P4python: python interface to Perforce API
P4python is the python interface to Perforce API, it helps to do Perforce operations through python. ...