Closed reyandme closed 7 years ago
Good idea too. Have you checked how much this improves performance? Just in case it's actually slower to use larger textures (I expect this change will be faster though). I doubt any video adapters these days don't support 2048 textures.
I'm not sure why the bin packing is not working correctly for GUI_Base and GUI_Main. Looks like a bug to me. Maybe it doesn't understand your new atlas size so it puts the large sprites in a single atlases each?
Yes, I found that bug - there was a limit, fNotFit, set to 256x256, so bigger images always initiated new atlas. So I can just set it to smth like AtlasSize*AtlasSize, and it will be fine.
Also rxx packages with only 1 image (like all Campaigns) should make smaller atlases. So in case 2048*2048 there will be no too big atlases, just 1024x1024.
Also maybe we can specify atlas size for some rxx. F.e. for tiles we do not need 2048 now, 1024 is enought.
here how it looks now:
I tried some test with lots of units and AtlasSize 4096, when all units can be placed on 1 atlas, but did not get any noticable performance improvement. But still, if we will have atlas size = 1024x1024, then we will be able to use VBO for tiles, and that should give performance improvement
We were using atlas size = 512, which is quite small. Its worth considering to use bigger atlases. We can get this info from video adapter to be sure what texture size is supported.
Also may be some atlas bin packing improvement can be done: This is what we have now, when atlas size set to 2048x2048:
GUI_Base and GUIMain , as well as Custom_Base atlases are not packed well. May be its not important, but anyway...