The drawRange influence both face indexing & vertex attributes such as position.
For exemple if my index use the vertex 0 to 10, I was expecting setDrawRange( 0, 30 ) will do the job, but actually if I have more than 10 face indexed, then the extra face after the 10 first will not be draw,
I wonder if its a Webgl limitation or if we can separated setDrawRange in two function setVertexDrawRange & setIndexDrawRange.
For non-indexed BufferGeometry, count in setDrawRange( start, count ), is the number of vertices.
For indexed BufferGeometry, count in setDrawRange( start, count ), is the number of indices.
I wonder if its a Webgl limitation or if we can separated setDrawRange in two function setVertexDrawRange & setIndexDrawRange.
I do not vote for this. Having a single function setDrawRange() is the better approach from my point of view.
Thanks for the clarification about it. Also I agree a general setDrawRange is good but cant we have the tree : setDrawRange with the general behavior describe by WestLangley & the two others for deeper control ?
cant we have [three] : setDrawRange with the general behavior describe by WestLangley & the two others for deeper control ?
I expect that would be too confusing.
Perhaps you can use geometry.addGroup() for additional control in your app:
geometry.clearGroups();
geometry.addGroup( start, count, 0 );
material = [ material ]; // if there is just one material
@WestLangley So the param start/count in addGroup are about index for indexedGeometry & vertex for non indexed too?
I'm not sure if this will resolve my needs about discarding by face & vertex at the same time. but thanks to your explanation, I already solved my original problem, this extra control isnt really need anymore.
I suggest to clarify the documentation with your explanation :)
I suggest to clarify the documentation with your explanation :)
Done!
I wonder if its a Webgl limitation or if we can separated setDrawRange in two function setVertexDrawRange & setIndexDrawRange.
It is a WebGL limitation indeed. DrawRange maps to gl.drawElements() and gl.drawArrays()
Most helpful comment
It is a WebGL limitation indeed. DrawRange maps to gl.drawElements() and gl.drawArrays()