Hi
I added FBO support but looks like the performance is much lower than I expected. I'm using two screens (scene rendered for two cameras). Without FBO I have 55 fps. After adding it (texture 1024x768) - it's only 26 fps.
I also checked different configurations:
1. "Slower" - scene rendered 4 times + 2 quads with texture:
Camera1 to FBO1
Camera2 to FBO2
Screen1: Camera1 - fullscreen, Camera2 - FBO2, shown on small quad
Screen2: Camera2 - fullscreen, Camera1 - FBO1, shown on small quad
Results (for different texture size):
256x256 - 50 fps
1024x768 - 30 fps
2048x2048 - 9 fps
2. "Faster" - scene rendered 2 times + 4 quads with texture:
Camera1 to FBO1
Camera2 to FBO2
Screen1: Camera1 - FBO1, fullscreen, Camera2 - FBO2, shown on small quad
Screen2: Camera2 - FBO2, fullscreen, Camera1 - FBO1, shown on small quad
256x256 - 43 fps
1024x768 - 23 fps
2048x2048 - 8 fps
I'm using device with Vivante gc2000.
Part of code:
// ## rendering to texture1 ##:
glViewport(0, 0, 1024, 768);
glBindFramebuffer(GL_FRAMEBUFFER, m_FBO);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// drawing scene
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glViewport(0, 0, 1024, 768);
// ## rendering to texture2 ##:
// (performed for 2nd FBO)
eglMakeCurrent(...);// setting screen1
// drawing fullscreen quad with FBO1
// drawing small quad with FBO2
eglSwapBuffers(...);// for screen1
eglMakeCurrent(...);// setting screen2
// drawing fullscreen quad with FBO2
// drawing small quad with FBO1
eglSwapBuffers(...);// for screen2
Do I need to change/add something or the device is not enough fast for using FBO?