Unity Instancing类别

Hardware instancing:
This is a method supplied by Direct3D which allows you to draw multiple instances of a mesh in a single draw call. This is what the OP was asking about, and what Aras said would be difficult or impossible to implement in a generic way.

FBX Instancing:
This is a method that the FBX format allows you to use for models that contain multiple instances of the same mesh. It reduces the size of the FBX, but does not inherently improve rendering performance. As far as I know, Unity does not support FBX instancing. Each instance will be imported as a unique mesh. I'm not sure whether Unity's mesh asset format could easily be modified to support instancing, but it's something to ask about either way.

Unity's mesh instancing:
If you have two MeshFilters (or MeshColliders, or MeshParticleEmitters) pointing to the same Mesh asset, Unity will not duplicate that asset other than storing it both in video memory and main memory, as necessary. This is the standard behaviour for Unity, and (as I understand it) works automatically as long as you don't apply different non-uniform scales to your MeshRenderers. If you do this, then multiple copies are kept in memory due to the way Unity handles mesh scaling. I could be wrong, and it might just be that different scales create different VBOs, whether they are uniform or not.

https://forum.unity.com/threads/gpu-mesh-instancing.19670/

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值