WebGL 中的顶点数有限制吗? [英] Is there a limit of vertices in WebGL?

查看:15
本文介绍了WebGL 中的顶点数有限制吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Three.js 说不能加载超过 65k 个顶点.在我的纯 webgl 应用程序中,它什么也没说,但是当我尝试大对象时,它不会显示整个对象.

Three.js says that can't be loaded more than 65k vertices. In my pure webgl application, it doesn't say anything, but it doesn't show the entire object when I try big objects.

我正在考虑拆分我的对象以放入较小的缓冲区,但这会让我感到难过.有没有更好的解决办法?65k真的是顶点数的极限吗?

I am figuring out in split my objects to put in smaller buffers, but it would make me sad. Is there any better solution? Is 65k really the limit amount of vertices?

推荐答案

是的,WebGL 的顶点索引缓冲区现在仅限于 16 位.这是因为他们的目标是使 1.0 版本尽可能跨平台,因此有一种趋势是让东西面向最小公分母——在这种情况下,图形硬件有限的移动平台.

Yes, WebGL's vertex index buffers are limited to 16-bit right now. This is because they're aiming to make version 1.0 as cross-platform as possible, so there's a tendency to make stuff target the lowest common denominator -- in cases like this, mobile platforms with limited graphics hardware.

一旦 1.0 出来并且最初的匆忙结束,他们可能会在扩展的帮助下放松这些限制——应用程序将能够询问实现是否支持给定的扩展,并利用如果是的话——就像在普通的桌面 OpenGL 中一样.已经有一些扩展可用,但它们再次只允许具有非常广泛的硬件支持的扩展,因此没有任何东西可以帮助您增加顶点数.但是,一旦他们放宽跨平台要求,他们很可能会支持诸如 GL_OES_element_index_uint 扩展之类的东西,该扩展允许 32 位顶点索引.

Once 1.0 is out and the initial rush is over, they're likely to loosen these constraints with the help of extensions -- an app will be able to ask whether a given extension is supported by the implementation, and make use of it if it is -- just like in regular desktop OpenGL. There are already a few extensions available, but again they've only allowed ones with very broad hardware support, so nothing that would help you increase your vertex count. However, once they loosen the cross-platform requirement, they are likely to support something like the GL_OES_element_index_uint extension that allows 32-bit vertex indices.

您可以阅读 关于这些问题的一些讨论公共 WebGL 邮件列表.

这篇关于WebGL 中的顶点数有限制吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆