Display 400 images at the same time

Hi,

I need to display ~400 different images at the same [and move them around].
I started using images with a size of 500x500 but the performance were bad so I resized them to 300x300.

Here is a screen capture of a test app - video
[Even if there is some duplicate images in the videos I still load and use 400 different images. I get 60fps on the video due to the screen capture running at the same]

So far I have tried using ofImages and ofTextures, and I get the same results which make sense [~160fps].
I guess this is the binding of each textures that is slowing down the all thing.

Is there any tricks/advices in order to get better performance. Meaning higher fps and being able to work with bigger images ?

Thanks

hugues

you could try mipmapping (which is kind of like a level of detail system for textures usually used for better antialiasing) so that you dont always upload the fullresolution texture to the GPU when it only fills a small portion of the screen.- just google openGL geomipmapping.

Not sure if it helps much though since 400 images are quite a load :slight_smile:

Thanks Moka. It makes total sense.

I just tried, doing it by hand. I load twice as much textures [big and small for each texture] and I switch between them ‘manually’. It’s already faster, I moved from ~160fps to ~230fps.

Next step will be to do it using the openGL api.

A few things that cross my mind, maybe it will help you a bit:

400 different images of 500x500 pixels each, using 3 bytes per pixel, means:
400 x 768KB VRAM = 300MB VRAM.

-your application may have been written in such a way that the full 300MB of data is sent to your videocard every frame? Probably not at the frame rates you are reporting :slight_smile:

-if not, it may be possible your videocard does not have that much VRAM available and it needs to swap out some memory just so it can draw?

-I have heard that it is relatively slow to paint the same pixel multiple times each frame. If you are drawing lots of images on top of each other, this may affect the frame rate as well.

So now I’m doing the mipmapping using openGL. It works quite well.
I don’t I’m doing everything correctly though. Therefore, I have started a new thread, in the forum, just about mipmaping. - here

I still have a question related to this current thread though :slight_smile:
I’m wondering if I could improve my application performance by managing multiple textures in the same ofTexture. I would change the following line in ofTexture, and then loading several textures in the same ofTexture.

  
  
glGenTextures(1, (GLuint *)texData.textureName);   // could be more then one, but for now, just one  
  

Any thoughts about that ?

Thanks,

Hugues.

that should not change anything :slight_smile:

Hey hey,

sorry, I completely missed this - but one obvious way to speed things up considerably is to use DXT compression.
It uses compressed images (in .dds format) instead of TGAs (which are loaded into memory uncompressed!) and the compression quality is hardly noticeable. There’s lot of info on http://developer.nvidia.com .
I haven’t played around with it myself yet though, but I know it will make things way faster. And to make things worse, I can’t seem to find a reasonable link anywhere right now…
But it’s a direction worth checking out.

Edit: here’s a link:

http://www.gamasutra.com/view/feature/2-…-s-and-.php

f

Thanks for the info about the DDS textures, I then was able found two threads about that - here and here. The available sources in the second one are really useful.

I for sure gained some fps. I’m around 330fps now [with 400 DDS textures of 512x512].

So far for my tests I downloaded those DDS textures from nvidia - here.
I was not able to find a DDS converter for Mac. Would you know about one ?

hi, you can find a neat dds-converter for osx here:

http://dwj.freeshell.org/celestia/

just drag a bunch of images onto it and it will batch convert them. mipmaps are also supported. i have not used it with of, so post, if it’s worth it… :smiley:

jens;

Hi, are you talking about Celestia or Squish ? I had found this page, but the link to Squish is broken.

Edit: I found it here though. Thanks for putting me back on that track :wink:

I tried Squish but was not able to generate DDS that work.
I then found Aorta, and was able to produce usable DDS.

Original JPG

DDS from Squish

DDS from Aorta

The thing is that Squish seems more advanced. It offers more settings, etc… but I was not able to use it correctly.

there’s also nvidia texture tools:

http://code.google.com/p/nvidia-texture-tools/