Original Post
Dear Forum, I currently working on a project, where I need to render to a texture. I do that using glCopyTexImage2D in glOtho mode. Everything seemed to be workin just fine, until I got to a rather larger object. I chose it to have a size of 1024x256. However, when I tried to map (i dont know if that is the right term) it to my mesh, some of the right hand area was missing. It looked like the texture got cut off at some point. Do you know, dear forum, what I am doing wrong? If so, please help me out, cause my boss is in a grumpy mood today. ;) Thx in advance Best regards Woltan Edit: The strange thing is, if I change to size of the texture to 512x256 or 512x128 it works just fine. Anyhow I really need the higher resolution texture!
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-0.5f, 0.5f, -0.5f, 0.5f, 0.1f, 50);
glMatrixMode(GL_MODELVIEW);
glViewport(0, 0, w, h); //w, h are the width and heigt of my texture
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
gluLookAt(0, 0, 6, 0, 0, 0, 0, 1, 0);
ObjectPaint(); //Paints the object
glBindTexture(GL_TEXTURE_2D, uiTex);
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, w, h, 0);