Non-squared Textures

When you store a non-square texture (i.e. 32x128), is it squared when transfered to video memory? is it a waste of video memory to use them vs squared textures?

Thank you.

I would hope it does not get squared !

It will probably be driver-dependant and I am sure some of the nVidia people we have here will answer you on this one.

Regards.

Eric

We do nonsquare textures properly in HW on TNT and up.

It’s actually a driver cheat to work around this HW limitation by making the texture square. It screws up bilinear filtering.

  • Matt

In fact, if some card does that now, it’s an absolute shame! It would not only hurt memory resources, but visual quality and performance. The most akward case you can find I would be the voodoos 1/2/3 that are limited to 256x256, but textures dont have to be square. I think the voodoo1 have some limit to the non-squareness of textures, something like it will resize 1x256 textures to 64x256 or something like that (it had a 4x maximum ratio between x and y dims). I’m not sure I’m 100% correct on these…

mcraighead:
It’s actually a driver cheat to work around this HW limitation by making the texture square. It screws up bilinear filtering.

Yep, saw it a lot on RIVA128 - it was …err… singlelinear filtering(?).

(Actually, I’ve got tired of it and have made an opengl32.dll wrapper to convert textures to square with downsampling or upsampling with bilinear filtering.)

coco:
I think the voodoo1 have some limit to the non-squareness of textures, something like it will resize 1x256 textures to 64x256 or something like that (it had a 4x maximum ratio between x and y dims).

Voodoo1…3 can do textures with max. ratio 8:1

Well, that was hardly the only image quality flaw that RIVA 128 had.

Don’t blame me… that was before my time! (I still insist, though, that it was the right chip for its time, despite its many flaws.)

Note that even if you use filtering on the scale operation, the results are still wrong. It’s an unsolvable problem.

  • Matt

> Note that even if you use filtering on the scale operation, the results are still wrong. It’s an unsolvable problem.

Results are quite acceptable - you have to take into account current texture wrapping mode (and border color).
It was easy, because Hexen2 and Quake1/2 uses only GL_REPEAT.