Textures with other size than 64x64 / 128x128

Started by
12 comments, last by Biberpelztrompete 23 years, 2 months ago
Hiho, how do I map textures that DO NOT match a power of 2. So to speak 32,64,128,256 pixel ?? I have a texture sized 96x64. I load it like this : uses glaux image : PT_auxImageRec; or sth. like this glGentextures(1,dsf); image := auxDIBImageLoadA(''pic.bmp''); glBindTexture(GL_TEXTURE_2D,dsf); glTexParameteri( .... glTexImage2d(sizex,sizey,0,3,GL_RGB,GL_UNSIGNED_BYTE,imagedata);
Advertisement
Use gluBuild2DMipMaps. This function will check for power of 2 factors, then scale up or down automatically. gluBuild2DMipMaps is part of the OpenGL1.1 spec.

Jason
or use texsubimage
create texture of a size 128x64
then use texsubimage to replace 96x64 part of it

http://members.xoom.com/myBollux
Hyho,
I couldn''t find a command called glTexSubImage. Is it a GLUT command ?? Moreover where is the difference between a standard texture and a MipMap ?
I have 1 very wide with a small height bitmap. Do I really have to scale it to 1024x1024 even if its real size is 20*800 ???
Why do you need so textures? Make it in powers of 2 dimension.

And. Textures doesn''t necessarily be square on most modern hardware. So you may use 32x1024 (but some hardware have limitation on maximum aspect ratio, say voodoo2 can handle maximum ratio of 8:1, and it can''t handle textures larger than 256x256 too). Best use 128x1024. And, if you have several such textures, it will be better to pack them into one large texture.
Hiho,
I want to make a layer that is above all the game screen. This Bitmap is needed to control the game. Building houses, menu and some other buttons are on it.
So it has be as wide as the screen and about 100 pixel high.
--> 128*1024. But making 4 Quads and putting a textures with that HUGE size will slow down the game or doesn''t it ?
And where''s the difference between a MipMap and a Bitmap ??
Umm,
I did not mean to create 4 Quads, but 4 Vertices which define 1 Quad...
glTexSubImage2D(...) its not a glut command its part of standard opengl

http://members.xoom.com/myBollux
Hmm,
hi you were right. The command does really exist. BUT : not in version 1.1. And I have version 1.1. So do you happen to know where I can download a better version for DELPHI ??
it does exist in opengl version 1.1 (check the spec) perhaps theres something else at fault

http://members.xoom.com/myBollux

This topic is closed to new replies.

Advertisement