[solved] ios ES2 renderer + QCAR example = white screen

Hi !
I’ve been playing with ES2 branch (for iOS) and QCAR addon example.
Without any modifications, it works!
But when using GLES2 renderer, I got a white screen when I should get a cute teapot.

My only modification is adding in the main.mm:

    ofGLES2Renderer * renderer = new ofGLES2Renderer();  

and I #include ofGLES2Renderer.h in both main.mm and testApp.mm

My guess is that teapot drawing should be modified (?), but I need help with ES2 and shaders stuff
Here is the current code for drawing (wich is the original code from QCAR example):

        ofDrawTeapot(qcar->getProjectionMatrix(), qcar->getModelViewMatrix(), 3);  
static void ofDrawTeapot ( const ofMatrix4x4 &projectionMatrix, const ofMatrix4x4 &modelViewMatrix, float objectScale = 3.0f )  
    glEnable( GL_DEPTH_TEST );  
    glEnable( GL_CULL_FACE );     
    glTranslatef( ofGetWidth() * 0.5, ofGetHeight() * 0.5, 0 );  
        glEnableClientState( GL_TEXTURE_COORD_ARRAY );  
        glEnableClientState( GL_VERTEX_ARRAY );  
        glEnableClientState( GL_NORMAL_ARRAY );  
        glLoadMatrixf( projectionMatrix.getPtr() );  
        glMatrixMode( GL_MODELVIEW );  
        glLoadMatrixf( modelViewMatrix.getPtr() );  
        glTranslatef( 0.0f, 0.0f, -objectScale );  
        glScalef( objectScale, objectScale, objectScale );  
        glTexCoordPointer( 2, GL_FLOAT, 0, (const GLvoid*)&teapotTexCoords[ 0 ] );  
        glVertexPointer( 3, GL_FLOAT, 0, (const GLvoid*)&teapotVertices[ 0 ] );  
        glNormalPointer( GL_FLOAT, 0, (const GLvoid*)&teapotNormals[ 0 ] );  
        glDrawElements( GL_TRIANGLES, NUM_TEAPOT_OBJECT_INDEX, GL_UNSIGNED_SHORT, (const GLvoid*)&teapotIndices[ 0 ] );  
        glDisableClientState( GL_TEXTURE_COORD_ARRAY );  
        glDisableClientState( GL_VERTEX_ARRAY );  
        glDisableClientState( GL_NORMAL_ARRAY );  
    glDisable( GL_DEPTH_TEST );  
    glDisable( GL_CULL_FACE );  

I’m using this branch for OF: https://github.com/julapy/openFrameworks/tree/ios-feature-es2
and for QCAR: https://github.com/julapy/ofxQCAR/tree/develop

hey, thanks for bringing this up.
im currently working on getting ofxQCAR working with ES2… its getting there but still has a few holes to patch.
ive fixed up the teapot example to work with ES2.
let me know if you come across any other issues…


Hi, thank you !
Their is what seems to be a depth problem, faces that should be hidden are shown
and I noticed I’ve got the same problem with models imported with assimp !

ah yes, the depth buffer hasn’t been added to the ES2 renderer yet.
i can sort this out sometime this week…

Thanks julapy,
have you finished it ?