davedes wrote:
Kova wrote:
3) using FBO or any offscreen rendering will just be slower as you must render that final image to screen. No benefit AFAIK.
In the case of, say, a grid or tiled map, where the many images together do not need to change over time, and thus can be combined into a single image, there is a huge improvement since you are only rendering once per frame instead of X images per frame.
This gives a noticeable FPS boast here (~101 average to ~123 average). On my 260GTX it goes from 32 fps to 968 fps! Insane.
This is rendering 32*32*9 tiles. I'm not even drawing images yet, but I do have some draw shapes (per title, just a rect that outlines it). I'll have to retest once I have images.
I take all tiles, draw them to a FBO. Once I have that, I just render the entire thing (instead of each tile).
Once on startup:
Code:
target = new Image(GameConfig.DEFAULT_MAP_SIZE_X_IN_PIXELS, GameConfig.DEFAULT_MAP_SIZE_Y_IN_PIXELS);
gTarget = target.getGraphics();
{draw to gTarget}
gTarget.flush()
Then every render:
Code:
target.draw();