Texture Width/Height

Blitz3D Forums/Blitz3D Programming/Texture Width/Height

Nack(Posted 2008) [#1]
I am not sure if this is a bug or not, want to confirm this first.

My simple code:

Graphics3D 800,600,0,2

img = LoadTexture("size.png",1+2)

Print TextureWidth(img) + " " + TextureHeight(img)
WaitKey()

my image( it is clearly 100x100) but for some oddreason, its saying its 128x128



jfk EO-11110(Posted 2008) [#2]
Sizes are automaticly scaled up to the next power-of-two number: 32,64,128,256... So you should use them in the first place. The reason why is some graphics cards require these sizes. Tho, it has not to be square, for example 128*1024 is perfect possible.


John Blackledge(Posted 2008) [#3]
Try LoadImage() and ImageWidth().


bytecode77(Posted 2008) [#4]
and when you have to use textures, try these sizes:
1x1
2x2
4x4
8x8
16x16
32x32
64x64
128x128
256x256
512x512
1024x1024
otherwise, you will get dirty looking effects such as the texture beeing pixelated


Gabriel(Posted 2008) [#5]
and when you have to use textures, try these sizes:

As JFK already said, they don't have to be square, just powers of 2 in each dimension. 512x256, 128x1024 and all the other combinations would be equally suitable.


Nack(Posted 2008) [#6]
oh i just tried it.
it works. no more pixelated! thanks all. its beautiful *tears*