PDA

View Full Version : texture map size



hoshi55
04-05-2001, 11:08 PM
iīm having a quad positioned directly in front of the camera and map an 800x300 sized cockpit texture to it. since my screen resolution is 800x600, this should guarantee pixel-perfect results as if i used glDrawPixels(). however, if i do not build mipmaps for my large texture (using gluBuild2DMipMaps), the texture isnīt displayed at all. if i do use mipmaps, openGL seems to use a much smaller version of the image which looks all blocky and is horribly blurred. iīve had a similar problem with textures as small 64x64 px, which did not work if i did not build mipmaps for them (those were not blocky and blurred if i enabled mipmaps, however).
i can think of two possible solutions:
1) split the large texture into many small 64x64 ones, mipmap them and map to smaller quads
2) build mipmaps manually, using the same image for each level (so that the texture does not actually get smaller)

has anyone a better way to do this or knows why i canīt use large textures? iīm using a voodoo2, but results on a geforce2 mx are pretty much the same.

regards, eik

john
04-06-2001, 01:58 AM
Hello,

well, for a start, you can't map a 800x600 texture, because the texture dimension is not a power of 2. Assuming you didn't know this (and you are, indeed, trying to bind a 800x600 texture) then it sounds like the texture ISN'T binding, and thus you see nothing. However, when you create mipmaps, you're implicitly creating power-of-two textures which CAN be bound, and so OpenGL is using these. (Another point might be your texture is exceeding the maximum texure dmension)

But, if you're not trying to bind a non-power-of-two texture, then this seems really, really weird.

The solution, then, is to break your bitmap up into tiled powers-of-two texture and render a tile of quads.

hope thie helps!

cheers,
John