Hi,
we need somebody with a very good 3D knowledge to optimize the opengles 2D image rendering, I have a 2D sprite animation engine using draw2dImage to render frames and seems that the FPS drops drastically (under 10fps) when rendering over 40 modules(40 drawImage calls:) ) on screen.
Opengl-es very slow for 2d image rendering
After reading this post http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=43891 I realize that I should cache all vertices and and use drawPrimitives ... method, but still think that it will be much easier if this could be done at opengl-es driver level for 2d rendering and have a flush2D method or something like that to actually render all cached vertices.
-
hybrid
- Admin
- Posts: 14144
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Not sure if this really helps - I guess you are using different textures in each render call. And in that case you cannot merge those draw calls. If you have just one texture (e.g. for sprites) you can use the batched draw2dimage calls. Just create indices for the sprites to use and send an array of those indices to draw2dimageBatch
I don't use different texture for each draw call,many draw calls share same texture ,I just tested to see how spritebank works, but there is no improvement if I use draw2DImageBatch() because it use NullDriver::draw2DImageBatch() that don't do nothing than looping between modules(rectangles) and render each rectangle using draw2DImage that result in same number of drawPrimitive calls as I done in my code without using draw2DImageBatch. This method(draw2DImageBatch) should be optimized to reduce number of calls to setRenderStates2DMode and drawPrimitives() and merge vertices of rectangles that use same texture before calling drawPrimitive.
Last edited by [ghost] on Sun May 22, 2011 8:34 pm, edited 1 time in total.