Quote:Original post by Erik Rufelt
The corner-coordinates are in world OpenGL coordinates. You never want to cull tiles, just sectors right?
Umm sector is collection of tiles(in my case 32x32 though that's adjustable in settings). World is collection of sectors(currently 6x6 though again adjustable in settings). I wouldn't want to draw every single tile as techicly there's no reason why sector couldn't be 10000x10000 tiles(though obviously that would be getting pretty silly). I specifically would wish to limit number of tiles to not draw any more tiles than absolutly neccessary.
Though I suppose I CAN draw it but that will be lots o' wasted effort drawing stuff that's outside the camera.
Would determining number of tiles in X/Z axis(and starting point) be slower than drawing spare tiles? If I draw complete sectors then in worst case scenario I would be in my example be drawing total of 4096 tiles when only 484 tiles is actually needed(and even that includes tiles off the camera but getting non-rectangle area limited is probably inefficient). Almost 10x as many tiles as is needed! And we aren't even talking about objects yet which would cause similar wasted effort if I would draw full sectors.
And if we assume average vertex count for terrain tile is 8(ATM tile #1 has 6, tile #2 has 12. Polygonwise one of them has 18 and other 2(but then again the 2 is just flat ground)) that's 32000 vertexes to be drawn. Ugh. When 3200 or thereabout would be enough.
Doable and I suppose it wouldn't be issue in my limited needs but sure would hate to do so inefficient engine here.
Edit: Crap. I think I know where the issue might lie. I wonder if the sector co-ordinates are essentially from top-left to bottom right. Ie 0,0 tile is at top-left of sector. This would play havoc of drawing routine...Have to check this.