I recently rewrote my code to use vertex arrays and vertex buffer objects for my models data instead of using immediate mode. it works fine so far. but, now i realized that if i use glDrawArrayElements instead of glDrawElements and specify values for start end end, still everything is rendered:
shouldn’t this actually only render indices 8 to 24? or are these values ignored as the data is stored in vbo’s?
i’d need a replacement for gluScaleImage(), it’s the only function that still makes me link to the glu lib. i searched google but didn’t find anything useful.
You mean glDrawRangeElements? Then the additional parameters specify the min and max value for the indices that you draw. This is used to tell the driver how much of the vertex array needs to be copied to the GPU for this draw call. It’s not a way to specify a subset of the index array.
i’d need a replacement for gluScaleImage(), it’s the only function that still makes me link to the glu lib. i searched google but didn’t find anything useful.
gluScaleImage(…) uses a box filter, if the image is being scaled down, and lerps the values if the image is scaled up. It won’t be too hard to do such a thing yourself. You might even find a simple implementation online somewhere.
You mean glDrawRangeElements? Then the additional parameters specify the min and max value for the indices that you draw. This is used to tell the driver how much of the vertex array needs to be copied to the GPU for this draw call. It’s not a way to specify a subset of the index array.
argh yes just a typo. so i got it wrong. but what’s the difference between specifying the min and max value for the indices that i draw and specifying a subset of the index array?
Also note that a conformant implementation can (but need not to) implement glDrawRangeElements() as just glDrawElements() (with additional parameter checking, of course). glDrawRangeElements() doesn’t provide any new functionality. It’s an optimization.