So basically this is my problem: I am creating a game that needs a texture for each object. Now I would use a sprite sheet but the textures are different sizes. I am using VBOs and I need to some how bind the correct textures when calling drawElements. Now I don't know what to do because I don't want to separate each class to its own VBO because that will just make it like 100+ VBO per level which isn't so efficient (or maybe it is?) Note this is a 2D game but I still want to make it efficient.
Maybe there is some thing I can do with shaders? I am using shaders...
So that is my question: What Do I Do?
Things I came up with:
- Separate the classes to different VBOs (Easy but I am not sure if very efficient)
- Use sprite sheets but have a really really big cellsize then just draw big quads with transparent backgrounds.. (Seems like a stupid idea :P)
Thats it.. So I hope you have ideas!
EDIT: I read some where its possible to have an attribute of which texture to use and pass it in as an element and then the fragment shaders use it.. If this is true I'd love if some one could describe it in more detail and add some examples.. (Also if you need to customize the fragment shader please tell me how because I dont know how to write shaders)