The screenshot is viewed from the top, and the supposedly bottom part of the shape is seen through the top view.
I wrote my FBO like this:
//This is all done per rendering just to figure this one out first
//getting motion's fbo to return to
GLint originalFramebuffer;
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &originalFramebuffer);
GLuint fbo;
glGenFramebuffers(1, &fbo);
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
//Creating texture for framebuffer
GLuint texColorBuffer;
glGenTextures(1, &texColorBuffer);
glBindTexture([outTex target], texColorBuffer);
//Having it as null means the texture's data will be created dynamically
//Using RGBA since the alpha layer is going to be needed
glTexImage2D([outTex target], 0, GL_RGBA, 1920, 1080, 0, GL_RGBA_FLOAT16_APPLE, GL_UNSIGNED_BYTE, NULL);
glTexParameteri([outTex target], GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri([outTex target], GL_TEXTURE_MAG_FILTER, GL_LINEAR);
//Attach texture to framebuffer
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, [outTex target], texColorBuffer, 0);
//Creating render buffer
GLuint renderBuffer;
glGenRenderbuffers(1, &renderBuffer);
glBindRenderbuffer(GL_RENDERBUFFER, renderBuffer);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, 1920, 1080);
//Binding the renderbuffer to the framebuffer
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, renderBuffer);
//start using framebuffer
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
//This part is drawing my shape
//initating glTex0
glActiveTexture(GL_TEXTURE0);
[linkedTexture enable];
glBindTexture([outTex target], [linkedTexture textureId]);
//setting up texture stuff
glViewport(0, 0, 1920, 1080);
glClearColor(1, 1, 1, 0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDisable(GL_CULL_FACE);
glEnable(GL_DEPTH_TEST);
//this sets up my shape
glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, &compoundPoints[0][0][0]);
glEnable(GL_MAP2_VERTEX_3);
//This sets up the texture/image
glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, &texpts[0][0][0]);
glEnable(GL_MAP2_TEXTURE_COORD_2);
//This keeps the shapes's size intact
glMapGrid2f(20, 0.0, 1.0, 20, 0.0, 1.0);
//End of framebuffer usage
glBindFramebuffer(GL_FRAMEBUFFER, originalFramebuffer);
glViewport(0, 0, 1920, 1080);
glActiveTexture(GL_TEXTURE0);
//drawing my shape
glEvalMesh2(GL_FILL, 0, 20, 0, 20);
What I end up getting is the shape with the appropriate texture. Is there a different way of drawing the shape for my goal?
Thanks!