1 Replies - 1851 Views - Last Post: 04 April 2013 - 01:58 AM Rate Topic: -----

#1 zehawk   User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 213
  • Joined: 23-February 12

OpenGL Dynamic Tile Mapping with Multiple Textures

Posted 03 April 2013 - 09:10 PM

So here's an issue I have, I'm making a game that uses tiling and the tiles are dynamic, (This is for a level editor.) As the user changes tiles, the textures change, but there is such a large assortment of textures that holding all the tile textures in a 4096 x 4096 array won't cut it, I need all my textures to be stored on the hard drive independently because of the immense amount of textures i will be needing. Basically, each tile texture is 16 x 16 pixels, RGBA, and up until now I have been using a large texture full of smaller textures to store all the data. This is insufficeient, as I said, because i will need much much more data than a 4096 x 4096 array of textures can give me.

I am using opengl, and I need to know how I can get 64 x 128 tiles, all with varying textures, drawn fast and if I can, easily. I don't think using glBegin/glEnd is a good idea, but I don't know how i can use multiple textures with Vertex Arrays or VBOs, and even if they support using multiple textures for one drawing call, then i don't know how fast it would be. So far, I tried using glTexSubImage2D to make a texture of the localized drawing area, and each frame the texture dynamically changed to match the tiles that are being drawn, but the problem is it is very slow, and yes, I am only using it once per update loop. Not only that, but just getting the tiles arranged into a bigger array and preparing to copy the data is slow. So, I present my prompt, is there any fast way to use multiple textures (And I mean a lot of textures) to draw multiple tiles, each with unique textures which can't be stored in a 4096 x 4096 pixel texture, fast?

Is This A Good Question/Topic? 0
  • +

Replies To: OpenGL Dynamic Tile Mapping with Multiple Textures

#2 Kainyu   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 14
  • Joined: 14-March 13

Re: OpenGL Dynamic Tile Mapping with Multiple Textures

Posted 04 April 2013 - 01:58 AM

I need to ask like 5 things real quick because I really dont understand.
Is this for an android?
Have you compressed the textures?
Do you know what/How to use a texture atlas?
Are the tiles animated?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1