Add to .drawRange the possibility to store multiple entries
See original GitHub issueIt would be great if the .drawRange
function could be an array storing multiple entries ( like the .groups
array from .geometry
) or even better, to be able to set a visibility value to each positions/vertex of a mesh.
https://threejs.org/docs/#api/core/BufferGeometry.drawRange
As for now, .drawRange
work like this :
geometry.drawRange { start: a, count: b }
Instead, we could have this :
geometry.drawRange[0] { start: a1, count: b1 }
geometry.drawRange[1] { start: a2, count: b2 }
geometry.drawRange[2] { start: a3, count: b3 }
etc…
The reason behind this request is because I use a big mesh that I can’t split in different part ( ratio between drawcalls, numbers of triangles and loading time, where loading one big mesh is the best option in that situation), while at the same time, I can’t really use .drawRange
because of the multiple intersection that the mesh must provide ( player map ).
Here’s an example :
Reaching the 2nd part (brown one with 30,60), the intersection will lead to either blue ( 90, 30 ) or ( ?, ? ), why " ?, ? " simply because If I set let’s say ( 300, 30 ), then, how could I render ( 30, 60 ) ( 300, 30 ) at the same time (without having to render a huge part like ( 0,330 ) ? this will mean that one part of the map will disappear / pop only when the player is inside.
Of course, there is a lot of alternative, but all of them add more complexity, performance and compatibility issue (knowing that I render all the texture by one shadermaterial + texture atlas).
In the end, I think making .drawRange
not linear at it is right now would make it more powerful and versatile.
Issue Analytics
- State:
- Created 5 years ago
- Comments:16 (1 by maintainers)
Top GitHub Comments
@zaykho Why can’t you use
groups
in your app, instead ofdrawRange
?Closing for now.