当前位置: 首页 > news >正文

光照贴图的中的编码格式

https://docs.unity3d.com/Manual/Lightmaps-TechnicalInformation.html
https://blog.uwa4d.com/archives/1882.html
http://ranaitian.com/2018/04/03/unity-lightmap-on-mobile/
https://zhuanlan.zhihu.com/p/35096536 这篇文章中介绍了unity_Lightmap_HDR

unity stores lightmaps with different compressions and encoding shemes, depending on the target platform and the compression setting in the lighting window.

unity projects can use two techniques to encoded baked light intensity ranges into low dynamic range textures when this is needed:
RGBM encoding. RGBM encoding stores a color in the RGB channels and a multiplier (M) in the alpha channel. 我一直纠结这个M是啥,原来是multiplier的首字母。the range of RGBM lightmaps goes from 0 to 34.49(5的2.2次方) in linear space, and from 0 to 5 in gamma space.

Double Low Dynamic Range (dLDR) encoding.
dLDR encoding is used on mobile platforms by simply mapping a range of [0, 2] to [0, 1].
Baked light intensities that are above a value of 2 will be clamped. The decoding value is computed by multiplying the value from the lightmap texture by 2 when gamma space is used, or 4.59482(2的2.2次方) when linear space is used. Some platforms store lightmaps as dLDR because their hardware compression produces poor-looking artifacts when using RGBM.

When Linear Color Space is used, the lightmap texture is marked as sRGB and the final value used by the shaders (after sampling and decoding) will be in Linear Color Space.
When Gamma Color Space is used, the final value will be in Gamma Color Space.

Note: When encoding is used, the values stored in the lightmaps (GPU texture memory) are always in Gamma Color Space.

The Decode Lightmap shader function from the UnityCG.cginc shader include file handles the decoding of lightmap values after the value is read from the lightmap texture in a shader.

HDR lightmap support
HDR lightmaps can be used on PC, Mac & Linux Standalone, Xbox OneMicrosoft’s eighth generation video game console.
See in Glossary, PlayStation 4Sony’s eighth generation video game console.
See in Glossary, iOSApple’s mobile operating system. More info
See in Glossary, tvOS and Android.
The Other Settings panel in the Player settings has a Lightmap Encoding option for these platforms, which controls the encoding/compression of the lightmaps.
在这里插入图片描述
choosing high quality will enabled HDR lightmap support, whereas normal quality will switch to using RGBM encoding.
low quality will switch to dLDR encoding on mobile platforms, on other platforms it is equivalent to Normal quality.

when lightmap compession is enabled in the lighting window,
在这里插入图片描述

the lightmaps will be compressed using the BC6H compression format on desktop and console platforms.
for mobile platforms, unity selects the HDR format according to the table below.

advantages of high quality (BC6H) lightmaps
HDR lightmaps do not use any encoding scheme to encode lightmap values, so the supported range is only limited by the 16-bit floating point texture format that goes from 0 to 65504.

BC6H format quality is superior to DXT5 + RGBM format encoding, ant it does not produce any of the color banding artifacts that RGBM encoding has.
shaders that need to sample HDR lightmaps are a few ALU instructions shorter because there is no need to decode the sampled values.

here is the list of encoding schemes and their texture compression formats per target platform:
在这里插入图片描述
*If the target is Android then you can override the default texture compression format from the Build Settings to one of the following formats: DXT1, PVRTC, ETC2, ASTC. The default format is ETC for RGB textures and ETC2 for RGBA textures.

Precomputed real-time Global Illumination (GI)
The inputs to the GI system have a different range and encoding to the output. Surface albedo is 8-bit unsigned integer RGB in gamma space and emission is 16-bit floating point RGB in linear space. For advice on providing custom inputs using a meta pass, see documentation on Meta pass.
The irradiance output texture is stored using the RGB9E5 shared exponent floating point format if the graphics hardware supports it, or RGBM with a range of 5 as fallback. The range of RGB9E5 lightmaps is [0, 65408]. For details on the RGB9E5 format, see Khronos.org: EXT_texture_shared_exponent.

相关文章:

  • macOS U盘制作启动系统
  • 再谈gamma校正——重要知识点
  • 微信小程序小结
  • RenderDoc截取unity帧,分析shader
  • pc和android平台下lightmap的质量选取导致的宏变化
  • mac 笔记本编辑文本命令
  • SHADOWS_SCREEN宏打开的时机
  • swagger 如何在UI界面加入Authentication token值
  • unity屏幕空间阴影
  • UNITY_NO_SCREENSPACE_SHADOWS打开时机
  • mixed模式下烘焙shadowmask记录的数据
  • 第七章 数组实验
  • unity_OcclusionMaskSelector
  • unity_ShadowFadeCenterAndType
  • 人月神话阅读笔记02
  • 【跃迁之路】【444天】程序员高效学习方法论探索系列(实验阶段201-2018.04.25)...
  • 07.Android之多媒体问题
  • CentOS6 编译安装 redis-3.2.3
  • Hexo+码云+git快速搭建免费的静态Blog
  • Joomla 2.x, 3.x useful code cheatsheet
  • jquery cookie
  • Linux编程学习笔记 | Linux IO学习[1] - 文件IO
  • NLPIR语义挖掘平台推动行业大数据应用服务
  • python大佬养成计划----difflib模块
  • Redis在Web项目中的应用与实践
  • 从重复到重用
  • 技术胖1-4季视频复习— (看视频笔记)
  • 简单实现一个textarea自适应高度
  • 腾讯大梁:DevOps最后一棒,有效构建海量运营的持续反馈能力
  • 一个SAP顾问在美国的这些年
  • 追踪解析 FutureTask 源码
  • mysql面试题分组并合并列
  • ​软考-高级-系统架构设计师教程(清华第2版)【第12章 信息系统架构设计理论与实践(P420~465)-思维导图】​
  • # 再次尝试 连接失败_无线WiFi无法连接到网络怎么办【解决方法】
  • #Linux(权限管理)
  • $L^p$ 调和函数恒为零
  • (06)Hive——正则表达式
  • (保姆级教程)Mysql中索引、触发器、存储过程、存储函数的概念、作用,以及如何使用索引、存储过程,代码操作演示
  • (附源码)spring boot球鞋文化交流论坛 毕业设计 141436
  • (附源码)计算机毕业设计ssm高校《大学语文》课程作业在线管理系统
  • (七)c52学习之旅-中断
  • (转)Oracle存储过程编写经验和优化措施
  • ****Linux下Mysql的安装和配置
  • ./configure、make、make install 命令
  • .htaccess配置常用技巧
  • .NET 2.0中新增的一些TryGet,TryParse等方法
  • .NET CORE Aws S3 使用
  • .NET Core引入性能分析引导优化
  • .Net环境下的缓存技术介绍
  • @Pointcut 使用
  • @在php中起什么作用?
  • [20180224]expdp query 写法问题.txt
  • [52PJ] Java面向对象笔记(转自52 1510988116)
  • [AI]ChatGPT4 与 ChatGPT3.5 区别有多大
  • [Android]一个简单使用Handler做Timer的例子