Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use VAO to save on vertex specifying commands when drawing #317

Merged
merged 1 commit into from Jun 25, 2014

Conversation

Oletus
Copy link
Contributor

@Oletus Oletus commented Jun 24, 2014

The new behavior becomes active if WebGL on the client system supports
OES_vertex_array_object. The VAO reference is stored on the geometry
chunk. If the interleaved buffer is dirtied and the VAO references it, it
is reconstructed based on the regular buffers. The VAO is also reset if
the chunk is rebuilt. VAOs are not used if morph geometry is present.

OES_vertex_array_object is a widely supported WebGL extension, around
75% of clients have it according to webglstats. In large scenes on
CPU-constrained systems that support the extension this patch can
increase FPS as much as 15%.

The new behavior becomes active if WebGL on the client system supports
OES_vertex_array_object. The VAO reference is stored on the geometry
chunk. If the interleaved buffer is dirtied and the VAO references it, it
is reconstructed based on the regular buffers. The VAO is also reset if
the chunk is rebuilt. VAOs are not used if morph geometry is present.

OES_vertex_array_object is a widely supported WebGL extension, around
75% of clients have it according to webglstats. In large scenes on
CPU-constrained systems that support the extension this patch can
increase FPS as much as 15%.
@Oletus
Copy link
Contributor Author

Oletus commented Jun 24, 2014

This ended up quite complex and is not a very good fit with the current way scene.js handles geometry. I imagine it would be much, much nicer if morphGeometry and geometry nodes were merged into one "VAO/VBO" chunk type when chunks are built and draw calls were in their own chunks.

It does have a very nice impact on CPU usage, but I'd at least test this carefully with complex content before merging.

xeolabs added a commit that referenced this pull request Jun 25, 2014
Use VAO to save on vertex specifying commands when drawing
@xeolabs xeolabs merged commit 875e50a into xeolabs:V3.1 Jun 25, 2014
@Oletus Oletus deleted the use-VAO branch June 26, 2014 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants