zomgistania

Main page | About | Articles | Previous Posts | Archives

Thursday, June 08, 2006

Tilemap rendering optimization

Getting rather horrible frame rates with lot's o' tiles, I decided to yet again foray into optimizing the rendering procedure...


For now what I've done...

I added a DumpVerts function into my Quad class. You give it a list as a param and it dumps the verts of itself into the list, transformed to the coordinates of the quad.

When the TileEngine class renders the map for the first time, it just initializes a huge VertexBuffer, dumps all the tile verts there, sets dumped flag to true... and that's it.

Gained 100 more FPS, which keeps fluctuating though... and the textures are b0rked for now at least...

The texture breakdown is probably caused by the fact that I use TriangleFans for rendering quads... and it would look like it tries to render a gigantic trianglefan.
So now I need to change the method I render the quads... very much completely. Bahhh. Why does anyone even bother to write tutorials where you do trianglefans when you'll eventually run into the fact that you get shit FPS and you need to batch things because a billion DrawPrimitves calls cause huge overhead.



Did also all the small things like reducing repeated device state sets etc.

I still don't want to get 40-140 FPS with a 20x20 map and a bunch of units in it. Bah. And the textures are broken... except for units which aren't using the dump-render method... yet.

Labels:

2 Comments:

  • I got a hit from your website..did you link to me? Or was it the link I left in one of my old comments..hmm

    By Anonymous Anonymous, at 3:43 AM  

  • Probably your old comment, although I should link to you since your site has all that fun stuff ;)

    By Blogger Jani, at 3:46 AM  

Post a Comment

<< Home