F.X.
F.X.

Reputation: 7317

WebGL Buffer Size Limit

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?

Upvotes: 4

Views: 7983

Answers (2)

Chiguireitor
Chiguireitor

Reputation: 3306

It sounds like you've got an outdated driver. The definition of drawArrays():

void drawArrays(enum mode, int first, long count)

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.

Upvotes: 2

jfriend00
jfriend00

Reputation: 707158

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.

Upvotes: 2

Related Questions