Results 1 to 5 of 5

Thread: glDrawTexiOES z parameter on mx31

  1. #1

    glDrawTexiOES z parameter on mx31

    Am working on the mx31 platform

    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!

  2. #2
    Senior Member
    Join Date
    May 2006
    Posts
    353
    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?
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

  3. #3
    Yes I am sure....

    This is enough to enable it right:
    glEnable(GL_DEPTH_TEST);

  4. #4
    Senior Member
    Join Date
    May 2006
    Posts
    353
    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?
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

  5. #5

    Call details

    Here is what the code structure looks like:

    InitApp()
    loop forever:
    RenderOGLObjects()
    RenderBkgdScreen()

    Detailed pseudocode:

    InitApp
    {
    //eglInitialize,chooseconfig, createwindowssurface, etc

    //create screen texture (glGenTex, glTexImage2D)
    //glViewPort(x,y,w,h)
    //glMatrixMode(GL_MODELVIEW)
    //glLoadIdentity()
    //glortho(0,w, 0, h, -100,100);
    }

    RenderOGLObjects()
    {
    glMatrixMode(GL_MODELVIEW);
    glPushMatrix();
    glLoadIdentity();
    glMatrixMode(GL_PROJECTION);
    glPushMatrix();
    glLoadIdentity();

    //enable/disable textures,blending, etc
    //use glFrustum/glOrtho
    //rotate/translate/scale etc
    ////draw objects


    glMatrixMode(GL_MODELVIEW);
    glPopMatrix();
    glMatrixMode(GL_PROJECTION);
    glPopMatrix();
    }

    RenderBkgdScreen()
    {
    //enable textures, depth testing
    //croprect, gltexenv, glTexparameter calls
    //gltexSubImage2d, with screen buffer
    //glDrawTexioes(z = 1/-1/10/-10)
    //eglSwapBuffers
    }

    Anything smell fishy?

Similar Threads

  1. glDrawTexiOES Behavior
    By krighton in forum OpenGL ES general technical discussions
    Replies: 0
    Last Post: 06-01-2010, 01:52 PM
  2. OpenVG and i.MX31
    By birger in forum OpenVG and VGU
    Replies: 1
    Last Post: 05-07-2008, 09:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •