why do textures need to be a power of 2? as far as i am awhere it is no longer a limitation of graphics hardware, and is currently becoming very annoying.
hearers the full size first level of my game(sorry if its abit big)
The level is constructed from 300*150 tiles, the hight is equal to the distance
between the floors, or 1 unit. and the width is half a unit. The tiles are added
together in gimp and exported as a single image. This image can have
potently any aspect ratio and would be imposable to make a power of 2.
the coordinate system works on floors(always an intagur) and a horizontal
location. This is intended to make positioning the sprites easy, as the location
would always be eather an intagur or .5 of one. vertical location is measured
relative to the floor, so i dont haft to worry about aligning sprites vertically.
the problem arises becouse of the power of 2 thing, the image is textured to a
plain. this plain is scaled to match the original aspect ratio, and so that the
distance between the floors is 1 irr unit. vertically this is not a problem. the
problem comes horizontally, where there are major distortions and i cannot
get the image to align with the coordinates accurately enough. with the above
level adjusting the coordinates is not too problematic becouse its small. but i
have some very big levels planed, about 8* the size of this one. I suspect that
as I add hight to the level vertical distortion will become a problem. the fixed
distance between the floors is not ajustasble, due to the way my collision
detection works
how hard would it be to remove the power of 2 thing?
why textures power of 2?
My guess is that NPOT textures are just allocated memory to the next largest POT size and are handles just like POT textures but with a large portion unused/transparent. So it would be more like, using a 300x350 is only as efficient as using a 512x512, so you might as well use a 512. That's what I think, but offcourse this kind of thing would vary across implementations.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
the texture dusnt apper to be scaling, which is good, but now i haven't got a clue where the distortion is coming from. its posable i made an error while macing the image, but it cannot be enough to cause such major difarances otherwise it would be visible on the above image.hybrid wrote:If your hardware supports NPOT, textures are not rescaled. You can simply check with getSize() and getOriginalSize() on your texture.
what can i do about hardware which dusent support npot? could I add extra white space to the image and only use part of it as the texture?
this thread should explain what im trying to achieve.
http://blenderartists.org/forum/showthread.php?t=120169
its just a ICubeSceneNode, scaled to 0 on the z acsess. x and y scales are relative to the aspect ratio, I assume the cube is just a normal 8 vert cube?
heare is one of the collision arrays, the values are pairs, the player can move freely between the first and second coordinate. element 0 is for floor 0, 1 for floor 1 etc. the coordinates are measured from the left of the image.
(there is a second array that describes where the player can move between floors, it works in the same way as this one)
if you round these values up or down to the nearest .5 then you get the intended coordinate.
i could use model files for the planes, but it seems a bit OTT as it ill only contain 2 triangles.
http://blenderartists.org/forum/showthread.php?t=120169
its just a ICubeSceneNode, scaled to 0 on the z acsess. x and y scales are relative to the aspect ratio, I assume the cube is just a normal 8 vert cube?
heare is one of the collision arrays, the values are pairs, the player can move freely between the first and second coordinate. element 0 is for floor 0, 1 for floor 1 etc. the coordinates are measured from the left of the image.
Code: Select all
{
{0.44,5.04, 6.75,8.21, 9.39,10.3, 0,0},
{1.5,2.41, 4.12,10.3, 0,0,0,0},
{-1,2.93, 4.12,5.56, 7.28,10.3, 0,0},
{2.02,10.3,0,0,0,0,0,0}
}
if you round these values up or down to the nearest .5 then you get the intended coordinate.
i could use model files for the planes, but it seems a bit OTT as it ill only contain 2 triangles.
I believe so, yes. Apparently the graphics card has to use an entirely different set of routines to perform operations on NPT textures, which are slows than the routines that POT textures are sent through.JP wrote:Are POT textures still more efficient even if the gfx card supports NPOT textures?
-wyrmmage