WebGL 缓冲区大小限制
我今天在做一个关于点集可视化的项目时刚刚遇到了一个关于 WebGL 的小问题。我知道 drawElements 中有一个索引限制,因为索引是 16 位 整数。然而,根据 这篇文章,没有drawArrays,我通过能够向 GPU 发送大约 400k 点来确认这一点。
问题是,当我尝试使用 400k 时,我想探索 WebGL 的可能性,于是我尝试了 3M 顶点模型。砰!没有显示任何内容,并且 WebGL 检查器不显示 drawArrays 调用。
您是否知道直接绘制数组调用的某种限制?
I just ran in a small issue with WebGL today, while doing a project on point set visualisation. I understand there is a index limit in drawElements, due to the indexes being 16-bit integers. According to this post, however, there isn't for drawArrays, which I confirmed by being able to send some 400k points to the GPU.
The thing is, once I tried with 400k, I wanted to explore the possibilities of WebGL, and I tried with a 3M vertices model. Bang! Nothing gets displayed, and the WebGL inspector shows no drawArrays call.
Are you aware of some kind of limit for direct drawArray calls?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来同样的问题已经在这里讨论/回答了: 是否有WebGL 中的顶点限制?。在那条帖子中,brainjam 的帖子说他发现drawArrays 不限于65k。
It looks like the same question is already discussed/answered here: Is there a limit of vertices in WebGL?. In that thread, the post by brainjam says that he discovered that drawArrays was not limited to 65k.
听起来你的驱动程序已经过时了。 drawArrays() 的定义:
计数元素是一个长整数,这意味着在 32 位架构中至少有 2^32 个元素,在 64 位体系结构中至少有 2^64 个元素。
请记住,与任何人想象的不同,Chrome/Chromium 和 Firefox 都使用 Direct3D 作为 Windows 上 WebGL 的底层技术。
It sounds like you've got an outdated driver. The definition of drawArrays():
The count elements is a long integer, that would mean at least 2^32 Elements in 32-bit architectures and 2^64 on 64-bit archs.
Remember that, unlike what anyone could presume, both Chrome/Chromium and Firefox use Direct3D as the underlying technology for WebGL on windows.