PDA

View Full Version : texture mapping in opengl



infinitecmdz
10-13-2005, 03:18 PM
Hey guys,

i am new in opengl and I am trying out texture mapping. I see that Opengl restricts that the texture has to be in squares like 8*8, 16*16...

Is there anyway I can map a texture without this restriction? Like 640*480 or something?

Please let me know, if this can be done.

Thank you,

regards,

Siddharth

Hlz
10-13-2005, 08:43 PM
You need to use power-of-2 (POT) dimensions, unless you use texture rect (non-normalized texcoords) or non-power-of-2 textures (NPOT) (requires newer cards).

You can always use a texture with the next POT in each dimension and adjust your texcoords accordingly.

Opengl documentation trifecta:
http://www.rush3d.com/reference/opengl-redbook-1.1/
http://www.opengl.org/documentation/spec.html
http://oss.sgi.com/projects/ogl-sample/registry/

10-14-2005, 10:29 AM
Hi !

Please try

*** Chris Leathley's *** Texture Loader
(Based on Jeff Molofee's IPicture Basecode)

Link:

http://members.iinet.net.au/~cleathley/openGL/TextureLoader.htm

http://members.iinet.net.au/%7Ecleathley/openGL/TextureLoader.zip

Have Fun !