Unity 半透明粒子特效无法动态合批问题

半透明粒子特效 Prefab,内含多个 ParticleSystem,复制多个后 DrawCall 增加明显,在 FrameDebugger 里发现粒子特效无法动态合批,说是材质球不同,但其实材质球明明是相同的,令人疑惑。

查阅官方文档 https://docs.unity3d.com/Manual/DrawCallBatching.html,发现下边这一段话:

Semi-transparent Shaders usually require GameObjects to be rendered in back-to-front order for transparency to work. Unity first orders GameObjects in this order, and then tries to batch them, but because the order must be strictly satisfied, this often means less batching can be achieved than with opaque GameObjects.

表述有些模糊,但判断和 RenderQueue 有关。

之后将相同材质球单独设置不同的 RenderQueue。

Prefab里有四个东西,都是ParticleSystem组件:

1、最靠前的硬币 设为 3004

2、其次的背光 设为3003

3、星星闪光

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值