So I was playing around with opengl and ran into a bit of a problem. I want to be able to use a very large amount (upwards of 15k) of small (128x128) 2D textures at once (during a single draw call). Problem is I can't figure out how to do it efficiently. Here are the approaches and their problems I have found so far:
A bit of a follow up in case anyone has the same problem.
I chose to try the 3-rd option I outlined in the question (using TEXTURE_2D_ARRAY with each layer being a texture atlas generated from separate textures at startup) and can indeed confirm that, while not ideal and somewhat unconventional, it does, at least, work. Moreover, while it is unusual to use a texture atlas array as if it was a single atlas, texture atlases themselves are very well practiced and easy to research.
I tested it with only a few textures in total so far, but, in theory, with a typical 8192x8192x2048 2D texture array of atlases I could have up to 8 million 128x128 textures (though in practice the actual number would, of course, be far less due to VRAM limitations)

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With