Found algorithms which pack rectangles, but at the same time overturn them.

Is it possible to opengl in textures with the glTexSubImage2D command, or can I inject another into the texture without overturning the textures?

If not, then how exactly is the task called, where the rectangles should not roll over (in English) (ideally, I would like to have ready C / C ++ code)?

  • Not sure, but maybe you can use shaders (texture). - perfect
  • Do you have a task to just get a ready-made texture atlas? you can use a third-party packer, or a library that does it. - IronVbif
  • @IronVbif Yes, such a task. But you need to form on the fly. Well, there are ready-made libraries? On the topic found: CRectPlacement - turns a rectangle. BinPacker (by "scgames" gamedev) - there is a bool rotated, but it does not function. GuillotineBinPack (and 5 more identical algorithms) (by Jukka Jylänki) - rotate the rectangles. @perfect Well, most likely it can be done, but the question is whether there will be a benefit from it? But this can lead to additional copying and will reduce the effect of using the atlas to nothing. - manking
  • @manking in general, Google gives a lot of things, you can specifically search for githubs, etc. there is one thing for sure that can not turn over. - IronVbif
  • one
    In general, the fact that the rectangles are turned upside down is even a plus. With glTexCoord2d and glVertex3s, you can impose whatever texture you want without loss of performance. The MaxRectsBinPack library from the author Jukka Yuldnki is very quickly and tightly packed. The question can be closed. - manking

0