UnityTips 之 LookUp 校色图的制作
2021-03-30 本文已影响0人
暴走TA
简介: 我们来讲解一下如何来调整一张自定义效果的LUT图
版本: Unity2019.4.12f1 HDRP版本 7.5.1
LUT 的分类
- 在出现SRP之前 Lut 纹理就是一张简单的贴图,目前的 Lut 纹理根据 管线的不同,分成了 cube 3D 纹理和普通的 2D 纹理,我们将分开进行讲解如何来制作一张自己想要的 Lut 纹理
2D 纹理的 LUT
- 一般用在 Legacy 和 URP 管线中,URP 管线中用在体积的 ColorLookUp 上

- 在 Postprocessing 的目录下找到 最原始的 LUT 贴图,名字一般为 NeutralLdrLut

- 将我们当前的屏幕输出截图做一个效果

- 将图片放入到PS中使用调整图层进行校色调整

- 用 ps 打开我们的 LUT 使用刚才的调整图层对它进行校色,只能使用整体类型的校色,整图调整,不能使用遮罩区域这种形式调整,这个一定要谨记。

- 将 lut 校色后的效果保存到文件,然后将保存好的图贴到校色节点上,观察游戏内的效果

- ps 内的校色效果与 unity 内的渲染结果对比

- 注意 lut 图的设置,不需要勾选 sRGB

3D Lut
- HDRP 中使用的就是 3D 的 LUT ,这些 Cube LUT 的尺寸大小要和HDRP 资源设置中的尺寸一致才可以使用。
- 一些不能正常使用的 CubeLut 的解决方案 https://www.jianshu.com/p/54bc6d91f9af
- 在示例资源下可以看到一些内置的 LUT。

- 将当前相机视图输出为 EXR 文件,Ctrl+Shift+Alt+E 菜单位置在 (Edit->RenderPipeline->RenderSelectedCameratoLogExr),注意导出时需要选择想要导出的相机,不然会报错。

- 使用 photoshop 打开我们导出的图片,图片发灰 这是因为我们输出的图是有


- 给图层添加校色层 Layer->New AdjustmentLayer->ColorLookup
- 然后选择3DLUT文件,加载 Unity 示例当中提供的 Unity Log to Linear r1,位置存放在Unity工程的 Asset/Samples/HightDefinitionRP/7.5.1/AdditionalPost-ProcessingData/CubeLUTs

- 设置仿色 数据排序为 RGB 表格排序为 BGR

- 开始进行校色处理,注意只能使用全局类型的校色处理,包括 色阶、色相饱和度、曲线、通道混合等

- 在 PS 内调整好效果后,使用 导出-》颜色查找表进行导出,设置网格点数量和 unity 内的设置一致


- 将导出文件存放到 Unity 工程内,引擎会自动进行格式设置,导入时系统会自动生成一个内容一样的 asset 文件,这是由于 HDRP 的工程内还存在 Postprocessing 模块,直接在PackageManager 内将其移除即可。

- 将我们调整好的 LUT 文件指认到需要使用的体积上 ,观察校色效果。

- 到此我们两种 LUT 的生成方式就都讲完了