Confused with Textures

Blitz3D Forums/Blitz3D Programming/Confused with Textures

TeraBit(Posted 2004) [#1]
Hi all,

Perhaps someone can shed some light on this for me.

When I try to create a texture of arbitrary size, if it cannot be created at exactly that size what happens?

Does Blitz make a bigger texture and scale the texture?

I'm getting weird UV problems appearing on different PCs using dynamically created textures where the textures appear bigger or smaller than they do on my own machine.

Any ideas what can be causing this?


Shambler(Posted 2004) [#2]
I'd imagine if it is too small it makes it larger and if it is too large it makes it smaller.

I try to stick to powers of 2 though for obvious reasons.


Beaker(Posted 2004) [#3]
I always thought it would just scale down, but, its more complicated than that, according to Rob. Don't take my word for it, tho.

Mark will know. :)


BlitzSupport(Posted 2004) [#4]
If you create a texture, always check its size with TextureWidth/Height. I believe Blitz uses whatever the nearest power-of-2 size is if the card can't handle it, but you'd have to ask Mark directly for the specifics! One thing's for sure, though: you should never assume you're going to get what you asked for.


Gabriel(Posted 2004) [#5]
My testing indicates it uses the next highest power of 2 always. So if you create a texture of 127x127, it will create a texture that's 128x128. But if you create a texture that's 129x129 it will create a texture that's 256x256. That's only from testing, but it's always behaved that way on multiple videocards.


Floyd(Posted 2004) [#6]
That's been my experience too.

The only exception is trying to create a texture larger than 2048 x 2048.


TeraBit(Posted 2004) [#7]
Ok, thanks all.