为什么Unity Terrain的草不合批,为什么顶点动画会有莫名其妙的抖动

    最近在写草的顶点动画时,发现一个很诡异的问题,在相机上下移动的时候,草会不由自主的抖动一下,而在Scene视角,居然看的好好的.百度了一圈,没有找到合适的答案,然后看了一下UnityTerrain Grass的shader  发现他写了这么一句话 "DisableBatching" = "True" 哦 原来Unity自己的草也是禁止合批的.

   那为什么官方也会禁止合批呢,查阅官方文档,得到以下内容:

DisableBatching tag

Some shaders (mostly ones that do object-space vertex deformations) do not work when Draw Call Batching is used – that’s because batching transforms all geometry into world space, so “object space” is lost.

DisableBatching tag can be used to indicate that. There are three possible values: “True” (always disables batching for this shader), “False” (does not disable batching; this is default) and “LODFading” (disable batching when LOD fading is active; mostly used on trees).

来源:https://docs.unity3d.com/Manual/SL-SubShaderTags.html

DisableBatching tag 禁用批处理
当使用绘制调用批处理 Draw Call Batching 时,一些 shaders(主要是做对象空间顶点变形的shader)不工作 - 这是因为批处理将所有几何转换为世界空间,因此“对象空间”丢失。

DisableBatching标签可以用来消除这个问题。 有三个可能的值:
“True”(始终禁用此着色器的批处理)
“False”(不禁用批处理;这是默认值)
“LODFading”(当LOD衰减活动时禁用批处理;主要用于树)。
 

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值