-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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
BufferGeometry #2300
Comments
i am definitly interested in making one example work using this. it got advantages all over the places.
|
I got it working on 50dev. http://jsfiddle.net/jakLs/ It's written in CoffeeScript, but shouldn't be hard to understand. |
If you want to understand how https://github.com/mrdoob/three.js/blob/dev/src/extras/core/BufferGeometry.js#L160 The only tricky part should be getting proper indices - in the original CTM format index buffer can have 32-bit integers so for all practical purposes you can have as big geometries as you need. But in WebGL element indices can be only 16-bit, so in one draw call you can address just up to 65,536 unique vertices. You can have as many triangles as you want, but they all must use just these vertices, so for example for our "classic" Now in Draw call for each chunk is sending https://github.com/mrdoob/three.js/blob/dev/src/renderers/WebGLRenderer.js#L3235 Please note that when creating buffers, you need to take care that in each chunk only up to 65,536 vertices will be addressed (so for example you can't have triangle using vertices |
The "chunking" approach will not work if any of triangles has vertices with indices more than 65,535 apart. CTMLoader goes into an infinite loop in this case. See issue Issue #3524. |
Hi!
I'm generating some pretty big models, and the creation of Vector3s, Face3s etc. is simply too slow. Even if I let a WebWorker to most of the job, the creation of the THREE-classes still has to happen in the main thread. @jeromeetienne pointed out that there's something called BufferGeometry, but we're having a hard time getting it to work.
I tried looking at the CTMLoader, but no success so far. Would it be possible to get a small introduction/example on how it works?
I have populated the buffers, but apparently, I can't just throw the BufferGeometry into a Mesh, as it complains about geometryGroups offsets.
Thanks,
Olav.
The text was updated successfully, but these errors were encountered: