-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Line: Add support for interleaved geometries in raycast(). #20366
Line: Add support for interleaved geometries in raycast(). #20366
Conversation
Correctly compute stride and offset for reading vertices from InterleavedBufferAttribute
Fix lint errors.
Does it make sense to use |
Yup that makes great sense. |
@gkjohnson I looked into the implementation of fromBufferAttribute, and it looks like it involves more function calls and index multiplies than computing the indexing inline.. and this is a pretty performance critical piece of code, and am leery of changing the runtime characteristics. I already agonized over the 2 tests of fromBufferAttribute calls: whereas the inline version only has to do index * this.itemSize once, and then fetches consecutive vertices. on a 1million point/line cloud that could be 2m more multiplies and 3m function calls on a raycast... Of course I could be wrong and the jit inlines all of it no problem, but on less capable browsers it may still be relevant. Thoughts? |
Here's the alternate version using Now, I'm not sure if we will ever see any more types of BufferAttributes (only I could think of would be float64-emulation like deckgl does it), in which case the version using fromBufferAttribute would be preferrable. I think something could be done to improve the perfomance in that implementation (maybe adding Also the js raycaster already isn't very high-performing to begin with and I think most people dealing with larger geometries will go for alternatives like GPU picking anyway. |
Sounds good to me. :) |
Please use |
@Mugen87 Can you take @usefulthink s patch as is? If it's more helpful to you, i can update this PR... |
I guess it's easier if you just update the PR 👍 |
Updated PR.. thanks @Mugen87, @usefulthink. :) |
Thanks! |
Correctly compute stride and offset for reading vertices from InterleavedBufferAttribute.
#20365