Reputation: 1
I've been trying to render a GLSurfaceView on the surface of a OpenGL Cube as a Texture. Is it possible? How to go about it?
Upvotes: 0
Views: 582
Reputation: 52353
The usual approach is to render to a framebuffer object (FBO) backed by a texture, and then render from that.
You can google for examples of FBO usage in GLES2 (the setup is a bit complicated). One example showing it in practice is the "record GL app" activity in Grafika, which is using FBOs (and a couple of other approaches) to record GLES rendering. The last "else" clause in doFrame()
renders to an FBO, then renders that texture twice, once on-screen, once to a video recorder.
You may want to switch from GLSurfaceView to plain SurfaceView to get more control over the rendering process. Most of the code in Grafika uses SurfaceView or TextureView.
Upvotes: 1