glDrawRangeElements

You can’t just DROP the arguments if you want to create new support for what it did.  glDrawRangeElements is for drawing a portion of your mesh.  Using glDrawElements draws will render an entire multi-object mesh with one texture.  If you want separate textures for each separate object of your mesh you need separate render calls between texture assignments.




 

Your suggestion of just dropping the arguments would require the programmer to break the vertex/index/normal/texturecoord arrays for a single mesh up into multiple separate arrays for each object of that same mesh.

 

Instead of just dropping them, continue to support them via this method:

 


    glDrawElements(GL_TRIANGLES, end-start, GL_UNSIGNED_SHORT, &((short *)indices)[start]);

theojohn wrote:
You can't just DROP the arguments if you want to create new support for what it did. glDrawRangeElements is for drawing a portion of your mesh. Using glDrawElements draws will render an entire multi-object mesh with one texture.

This is incorrect. glDrawRangeElements is specified to behave exactly like glDrawElements provided that each supplied index value is either within the range [start, end] or equal to the primitive restart index. The start and end values allow the driver to implement certain performance optimisations. They are not used to determine the number of primitives drawn, as the number of primitives is not bound by the range of index values used.
Xmas wrote:
theojohn wrote:
You can't just DROP the arguments if you want to create new support for what it did. glDrawRangeElements is for drawing a portion of your mesh. Using glDrawElements draws will render an entire multi-object mesh with one texture.

This is incorrect. glDrawRangeElements is specified to behave exactly like glDrawElements provided that each supplied index value is either within the range [start, end] or equal to the primitive restart index. The start and end values allow the driver to implement certain performance optimisations. They are not used to determine the number of primitives drawn, as the number of primitives is not bound by the range of index values used.



This is not incorrect. I never said glDrawRangeElements doesn't behave like glDrawElements. Your response doesn't have anything to do at all with my response to the other poster. Someone complained that glDrawRangeElements doesn't exist in OpenGL ES, and someone else recommended he simply drop the range elements he was using and go with glDrawElements instead... a suggestiion that would drastically alter the ouput of his program. I suggested a way he can use glDrawElements to get the same output as glDrawRangeElements would have rendered instead.



Quoting to me how arguments passed into glDrawRangeElements behave was completely pointless, and had nothing at all to do with this discussion... it's doubly moot seeing as how glDrawRangeElements doesn't even exist in the API any of us in this discussion were talking about.



Next time someone says "Oranges are orange", try and restrain yourself from chiming in with "No, you're incorrect, Apples are red".
theojohn wrote:
Someone complained that glDrawRangeElements doesn't exist in OpenGL ES, and someone else recommended he simply drop the range elements he was using and go with glDrawElements instead... a suggestiion that would drastically alter the ouput of his program.

I suggested using glDrawElements in place of glDrawRangeElements, simply omitting the start and end parameters. This would not alter the output at all.



The following two lines of code are functionally equivalent, provided that all indices given are within the [start, end] range (glDrawRangeElements may raise a GL error if they aren't, but is not required to do so).

Code:
glDrawRangeElements(mode, start, end, count, type, indices);
glDrawElements(mode, count, type, indices);



The line of code you suggested does something quite different.