Significant optimizations to the the generation of picking primitives for ray picking. In the new performance example provided, time to generate picking primitives was reduced from ~380ms to ~60ms. Memory churn is also reduced due to picking geometry arrays being pre-allocated, and overall memory footprint is reduced because picking primitives no longer need an index array.
Also fixes a bug that prevented picking from working with meshes containing more than 64k vertices.
Key changes include:
Use drawArrays to draw picking primitives, so indices are no longer needed.
Pre-allocate arrays for picking positions and colors rather than pushing to dynamic arrays.
Don't re-allocate arrays when creating WebGL buffers.
Get picking positions and colors in a single pass, if possible.
Example of ray picking on an extremely large mesh (1.28M triangles).
Significant optimizations to the the generation of picking primitives for ray picking. In the new performance example provided, time to generate picking primitives was reduced from ~380ms to ~60ms. Memory churn is also reduced due to picking geometry arrays being pre-allocated, and overall memory footprint is reduced because picking primitives no longer need an index array.
Also fixes a bug that prevented picking from working with meshes containing more than 64k vertices.
Key changes include:
drawArrays
to draw picking primitives, so indices are no longer needed.