Hi,
I am very new to OpenGL, and I am having problems getting my code to work. I am trying to write a program that takes a scene and tries to determine how much the camera has moved from the previous frame. My strategy is to slightly move and rotate my camera, and compare the pixels it sees after the transformation with the pixels from the previous frame. The transformation that yields the smallest difference is what I use.
Now, to achieve that, I create an FBO once, and every time I want to render the scene, I create a texture, and attach it to the FBO at GL_COLOR_ATTACHMENT0. The problem I am having is that seemingly the function I wrote which returns a ByteBuffer of the scene pixels works 3 times, and then always returns a ByteBuffer with all zeroes until I advance to the next frame. I don't understand why that happens, and since I just got my head around the whole concept of FBOs, I have no idea as to where to start to debug this. Any help would be appreciated. Here's my rendering code:
ScreenRenderer.java