Unity URP shader 出现 SRP Batcher 为 not compatible时 渲染性能会下降 应该怎么处理 ?
·
以下是Unity官网对SPR Batcher 加速渲染的介绍
https://blog.unity.com/technology/srp-batcher-speed-up-your-rendering
https://docs.unity3d.com/Manual/SRPBatcher.html
URP shader 在编写时,会出现 SRP Batcher 会出现 not compatible 此时 渲染性能会下降
报错:
Material property is found in another cbuffer than "UnityPerMaterial"
会提醒
如下图:

这不是我们希望的,我们是希望进行
出现的原因是因为,没有对我们定义的shader变量进行加速处理 如图:

如果修改:
只需要对变量进行做加速处理,如下

之后再次查看shader文件的SPR Batcher 就正常了

更多推荐


所有评论(0)