Hi there,
I just want to capture the actual scene and use it as a texture. This works fine if width and height of the viewport is a power of two when using
gl.glCopyTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA, 0, 0, width, height, 0);
But for width=640 and height=480 I first have to set the viewport to the next power of two:
gl.glViewport(0,0,1024,512);
gl.glCopyTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA, 0, 0, 1024, 512, 0);
Is it also possible to render the complete scene to a much smaller texture, e.g 64x64? Calling
gl.glViewport(0,0,64,64);
gl.glCopyTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA, 0, 0, 64, 64, 0);
doesn’t work, because only a small section of the scene is captured.
Has somebody a simple code sample for doing this task?