I am working on implementing a selection for an OpenGL game that I am writing for Android. It uses the unique color method to draw each tangible object as a solid color that is unique to each object. User input then reads glReadPixels () at the point of touch. I got the coloring and glReadPixels works, but I could not separate the “color” rendering from the main actual rendering, which made it difficult to use glReadPixels.
Presumably the trick to working with this is to make the second scene (for input) into an off-screen buffer, but this seems a bit problematic. I researched using OpenGL ES1.1 FBO to act as an off-screen buffer, but it looks like my phone (Samsung Galaxy S Vibrant (2.2)) does not support FBO. I don’t understand how to properly visualize this scene (and run glReadPixels on it) without observing it.
Any ideas on how you can do off-screen rendering of this kind?
source
share