Skip to main content
gamedev.net
🔒 Locked

Texture Limits?

Started by Kilj 1 reply 450+ views
Original Post
Kilj
Kilj
Im working on a simple tile map thing at the moment. My problem lies in the tiles being represented as single textures. The method im currently using has one large texture that contains all the tile textures. I then just play with the mapping co-ordinates and..... well for some reason that i cant figure out this leaves little fragments at the texture ends. So i was thinking of just having each tile texture be one opengl texture. So i would have something like unsingned int tileTextures[200] for a 200 tile tileset. Is this better? Is there a limit to the number of textures defined? is there a performance hit to constantly switch between binded textures? -kilj
something...
g7tommyB
g7tommyB
The answer is - it depends.
If you are going to use alpha blending, then I would texture each tile separetly.
If you just want tiled textures, then you should have no problems calling glTexture2d with the appropriate values for just one big quad.
I would personally go with the latter approach as it reduces the number of OpenGL chage states (i.e you are just drawing one big quad).
g7tommyB
Raduprv
Raduprv
If you get black lines, between tiles, then perhaps you have to play a little with the texture coordinates, until you get them right. I use the same technique (for drawing fonts, etc.) and I got a similar effect at the beginning, but, with soem pacience, I managed to make it work.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.