I am facing issues when using both glDrawArrays and glDrawTexiOES.
I use glDrawArrays to draw various objects on screen, and glDrawTexiOES to draw the background image. The way the architecture is, the foreground objects are drawn first, and then the background.
Now glDrawTexiOES draws on top of whatever glDrawArrays has drawn irrespective of what z values are given to glDrawArrays.
The z values I have tried with glDrawTexiOES is 1 and -1. Both ways, the background is drawn in front of the foreground objects.
Am I doing something wrong? What is the correct value of z for glDrawTexiOES on MX31? Thanks in advance!
If you want to draw a background the correct z value for glDrawTexiOES likely is 1, unless you’ve inverted your depth range for better precision with a floating point depth buffer.
Are you sure depth test is enabled when you draw the background?
Are there any other state settings concerning the depth buffer in your application, especially in between the rendering of the foreground objects and the call to glDrawTexiOES?