unity-shader-轻量级渲染管线LWRP
轻量级渲染管线 (LWRP) 是一种预建可编程渲染管线 (SRP),为提供图像高性能进行了优化。它可以针对移动平台以及高端游戏主机和 PC 进行扩展。
这个新特性 lwrp 中的 PostProcessVolume, shader graph 感觉和 u4 的 PostProcessVolume, 材质编辑器 一个样啊.
前篇
- 官方资料
- 介绍: 可编程渲染管线(SRP) - https://unity.com/cn/lightweight-render-pipeline
- Getting started with the Lightweight Render Pipeline - https://www.youtube.com/watch?v=n8Q4lvhi_Gc
- 官方示例仓库: https://github.com/UnityTechnologies/LWRPScriptableRenderPass_ExampleLibrary
源码仓库: https://github.com/Unity-Technologies/ScriptableRenderPipeline - The Lightweight Render Pipeline: Optimizing Real Time Performance - https://blogs.unity3d.com/cn/2018/02/21/the-lightweight-render-pipeline-optimizing-real-time-performance/
- Unity 可编程渲染管线 LWRP 的详细步骤 (源码分析) - https://blog.csdn.net/q568360447/article/details/88131901
- 开发自定义ScriptableRenderPipeline,将DrawCall降低180倍 - https://zhuanlan.zhihu.com/p/38623208
里面的新增的 post process volume 和 ue4 中的很像 (名字都起的一样)
PostProcessVolume
这个和 ue4 的基本是一样的. 参考: ue4-shader-后处理 中的 PostProcessVolume.
参考: Post Processing Layer - https://www.youtube.com/watch?v=Ts2F2SxeRSY
给 摄像机go 增加一个 Post Process Layer 组件 (默认会把 trigger 设置为 camera组件 ), 并把该组件的 layer 指定为 PostProcessing (当然这个layer可以自行添加)
创建一个 Post-processing Profile.
创建一个 go 命名为 PostProcessVolume, 指定 layer 为 PostProcessing (与之前指定的一致), 并增加一个 Post Process Volume 组件, 把新创建的 Post-processing Profile 文件拖到 Profile 字段中. 勾选上 Is Global. 然后就可以 Add effect 添加 Bloom 等效果了.
指定区域触发 PostProcessVolume
上面的操作勾选上 Is Global 是指 不用摄像机碰撞某个包围盒就能触发效果. 所以如果不需要这样全局触发, 可以设置一个包围盒用来碰撞触发. 需要碰撞的是 摄像机go.
- PostProcessVolume go 的 Post Process Volume 组件取消勾选 Is Global, 然后增加一个碰撞组件
用 摄像机go 碰撞包围盒就可以触发 PostProcessVolume