Got a tricky one for ya... Maybe.

Blitz3D Forums/Blitz3D Programming/Got a tricky one for ya... Maybe.

Adam Novagen(Posted 2011) [#1]
Catch question here. Say I have a multi-frame texture. Let's say it has three frames. Does each FRAME have to be a power of 2 size? Or does the entire TEXTURE, irregardless of frames, have to be a power of 2? Or do BOTH have to be powers of 2?

This suddenly occurred to me when I had a texture with two frames, each 256x128, and went to enlarge it to add a third frame. I instinctively went to resize the 256x256 image to 256x512, then stopped, realizing that was bigger than I needed... Then entered 256x384... Then stopped... Then entered 256x512... Then stopped... Then PARADOX. :p


Yasha(Posted 2011) [#2]
Each frame. The frames go on to become separate buffers once the texture is loaded; the "complete" texture isn't preserved anywhere.


Adam Novagen(Posted 2011) [#3]
Alright, I suspected/hoped as much, but just wanted to make sure before I ended up with distorted imagery. Thanks again, Yasha!


K(Posted 2011) [#4]
Note that there is no CreateAnimImage(), LoadAnimImage() reads through the file and consolidates it to the frame layout you specify. You don't actually need a strip, in your case 256^2 at four frames (128per) would read properly.

Last edited 2011


Amanda Dearheart(Posted 2011) [#5]
Just curious guys. I've run across this problem while working with the Trorque engine as well. Why is the power of 2 so important to texture size and all.


K(Posted 2011) [#6]
This

Binary permeates all sorts of things. 1KB=1024bytes, etc. Power of two lines up with hex, which is a rephrased binary.
Think of processors WAAAAYY back, 8bit,SNES 16bit,Ps1 32bit, N64 64bit, Ps2 128 and so on.
IF everything rests on Binary, binary is the lowest level, i.e. fastest, way. That's why I use binary flags (2^x) all the time, because then I don't waste 31 bits of an integer tracking if something's on/off.
I'm not good at explaining.