PDA

View Full Version : Texture: Power of 2 work around



malakh
04-24-2002, 06:07 AM
Hi all,
Is there any work around for the power of 2 texture dimensions restriction?

thanks,

Malakh.

Deiussum
04-24-2002, 06:15 AM
Look into the extension NV_texture_rectangle.
http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_texture_rectangle.txt

Gavin
04-24-2002, 07:11 AM
Pad a non 2^n texture with zeros, then ratio accordingly when you attach the texture to your poly. Works fine, but can waste a fair bit of mem as in 1025 would have to be padded to 2048 and so on....

V-man
04-24-2002, 07:24 AM
The easiest is gluBuild2DMipmaps which scales the image and creates mipmaps at the same time. Otherwise, use gluScaleImage but you need to figure out the widthout heightout values yourself. I personallly scale up:

example:
widthin=500
heightin=200

becomes

widthout=512
heightout=256

V-man