MaxPrimitiveCount 的限制

最近在绘制3D的地形,128*128的毫无问题,但绘制256时就出问题,当视野里的三角形数量大到一定程度后,会导致渲染失败。查了查MSDN才知, DrawIndexedPrimitive绘制三角形是有个数限制的。
MaxPrimitiveCount Maximum number of primitives for each DrawPrimitive call. Note that when Direct3D is working with a DirectX 6.0 or DirectX 7.0 driver, this field is set to 0xFFFF(65535). This means that not only the number of primitives but also the number of vertices is limited by this value. MaxVertexIndex Maximum size of indices supported for hardware vertex processing. It is possible to create 32-bit index buffers by specifying D3DFMT_INDEX32; however, you will not be able to render with the index buffer unless this value is greater than 0x0000FFFF.

找出问题才好,要不心里不踏实啊。

解决方案:把顶点数组和索引数组分成几组,然后多次调用DrawIndexedPrimitive解决。

转载于:https://www.cnblogs.com/Mochi/archive/2008/07/02/1234120.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值