Rendering Speeds

Blitz3D Forums/Blitz3D Beginners Area/Rendering Speeds

pc_tek(Posted 2010) [#1]
Hi folks!

nice to see the forum in ermmm...FULL use!

Question: Is it slower to paste 16 32x32 images or 1 128x128...or the same?

It's a toughy I know, but I have to ask.


puki(Posted 2010) [#2]
My vote goes to 1x 128x128 being faster.


Gabriel(Posted 2010) [#3]
It's a toughy I know

Actually, it's quite easy. It's much slower to paste 16 32x32 images than 1 128x128 image. The reason is quite straightforward. Every time you draw an image (or a 3D object texture with an image, for that matter) the videocard has to bind a new texture.

Think of it like a big ink stamp. Every time you need to change the pattern on the stamp, it takes time to change the stamp. But once that stamp is on there, you can print that same image over and over without much delay, right? Same thing with videocards, more or less. Changing textures/images is generally much more expensive than drawing them. So avoid unnecessary changes.

Of course, that doesn't mean you should use one enormous 4096x4096 texture for all drawing. At some point the size of the texture becomes disproportionate to the amount of time taken to bind it. But generally speaking, combining images up to at least 1024x1024 (but not necessarily that high, if you don't need or want to!) gives you better performance.


pc_tek(Posted 2010) [#4]
Thanks for the quick response guys!

Ok...128x128 it is. Although it is quite wasteful, as my images are 64x96. I have to round them up because of the interpolation thingy-bob. I want to retain a sharp image.


Gabriel(Posted 2010) [#5]
If your images are 64x96, then you can make use of textures with dimensions 64x128. They do need to be rounded up to powers of 2, but they don't need to be square.


pc_tek(Posted 2010) [#6]
Thanks Gabriel...good tip.


pc_tek(Posted 2010) [#7]
Hi folks!

Is it faster to draw a 2-bit image then a 24 or 32-bit one?


Yasha(Posted 2010) [#8]
All images are converted into the same internal format at load-time, so no, it shouldn't be.


pc_tek(Posted 2010) [#9]
Thanks for the reply Yasha...

What do you mean 'converted'? What to?


Ross C(Posted 2010) [#10]
I'm sure it's saves on RAM/VRAM though?


Matty(Posted 2010) [#11]
Pc_tek - what Yasha is saying (I think) is that regardless of the bit-depth of the image, the texture bit-depth is stored as either 16-bit or 32-bit depending on the texture flags used when loading/creating the texture or the bit-depth of the display mode.


pc_tek(Posted 2010) [#12]
Thanks for the info guys!

Much appreciated.


Zmatrix(Posted 2010) [#13]
I don't think it does save ram/vram as its read from the HD its stored in Vram raw 16bit or 32bit, unless using DDS compression.

but image compression, and lower color depths do save HD space.

Sam