Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualunbird

Posted 22 May 2013 - 03:43 PM

One approach is a so-called texture atlas, i.e. combine all textures into a big one. An example use case is a bitmap font for rendering text. You should find plenty of examples and even tools to generate such atlases (also google "rectangle packing").

 

Edit: Simpler to implement, but memory wasteful: Stay with the texture array approach and set width and height like the largest of your textures. Pack all other textures e.g. topleft and when drawing make sure the instance hits the correct texcoords.


#2unbird

Posted 22 May 2013 - 03:42 PM

One approach is a so-called texture atlas, i.e. combine all textures into a big one. An example use case is a bitmap font for rendering text. You should find plenty of examples and even tools to generate such atlases (also google "rectangle packing").

 

Edit: Simpler to implement, but memory wasteful: Stay with the texture array approach and set width and height of the largest of your textures. Pack all other textures e.g. topleft and when drawing make sure the instance hits the correct texcoords.


#1unbird

Posted 22 May 2013 - 03:33 PM

One approach is a so-called texture atlas, i.e. combine all textures into a big one. An example use case is a bitmap font for rendering text. You should find plenty of examples and even tools to generate such atlases (also google "rectangle packing").


PARTNERS