Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Do I need a texture atlas
QtWS25 Last Chance

Do I need a texture atlas

Scheduled Pinned Locked Moved Game Development
5 Posts 2 Posters 2.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    albanj
    wrote on 26 Aug 2014, 22:23 last edited by
    #1

    Hi,

    I made a few kids Android games using libgdx. They were all pretty simple - matching letter tiles to pictures, etc.

    It seems Qt Quick is ideal for this sort of thing and being cross-platform is a massive bonus (I know, libgdx is too but I do like to tinker).

    What I'm struggling with is how to bundle my graphics together and load/unload them to reduce texture switching/binding.

    Does anyone know how I should go about this? I'm sure it can't be too complex as Sprite comes very close. It seems to expect all images to be the same height/width for animations though.

    Sorry for the poor description. Perhaps if I could describe it better I'd have been more successful with my googling.

    albanj

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sletta
      wrote on 5 Sept 2014, 05:48 last edited by
      #2

      If you use the Image element in QML, all smallish textures will go into the internal texture atlas and they can all be batched together and performance will be good.

      Sprite is currently not a good candidate as it generates a unique texture id for each spriteset so they don't allow batching.

      See http://qt-project.org/doc/qt-5/qtquick-visualcanvas-scenegraph-renderer.html for more details.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        albanj
        wrote on 5 Sept 2014, 18:17 last edited by
        #3

        sletta, thanks for the answer and useful link. I should really have known that Qt would make it easy for me.

        Does the scene graph load and unload textures from the atlas as they are needed?

        E.g. I have a mobile game. A level in the game consists of a number of questions. So I'd have a few image components on screen being rendered, the question is answered, those components are disposed of (or the image source changed) and some new ones created and rendered.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sletta
          wrote on 11 Sept 2014, 19:20 last edited by
          #4

          The images are unloaded from the atlas when they are no longer in use, basically when nobody references the Image element anymore + some time passes by.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            albanj
            wrote on 11 Sept 2014, 19:53 last edited by
            #5

            Great, thanks for the info sletta.

            Qt really does make simple games easy to develop.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved