Archived

This topic is now archived and is closed to further replies.

Biberpelztrompete

Textures with other size than 64x64 / 128x128

Recommended Posts

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);

Share this post


Link to post
Share on other sites
zedzeek    528
or use texsubimage
create texture of a size 128x64
then use texsubimage to replace 96x64 part of it

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
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 ???

Share this post


Link to post
Share on other sites
nullguid    122
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.

Share this post


Link to post
Share on other sites
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 ??

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Umm,
in the Delphi conversion it isn''t. Only in version 1.2 or sth. like that.

Share this post


Link to post
Share on other sites
DeschutesCore    122
Biberpelztrompete,
You will have to make the external function call yourself in the declarations portion of your unit. If you look at several of NeHe''s tuts you will notice he makes calls like this:

procedure glBindTexture(target: GLenum; texture: GLuint); stdcall; external ''OpenGL32.dll'';

You can do this yourself because the function is inside the opengl32.dll, it''s just not declared in the Delphi header conversion. You can download Mike-Liscke''s opengl12.pas if you want a current header, but declaring the function yourself is easy.

procedure glTexSubImage2D(target: GLEnum; level, xoffset, yoffset: GLint; width, height: GLsizei; format, atype: GLEnum; pixels: Pointer); stdcall; external ''OpenGL32.dll'';

Jason

Share this post


Link to post
Share on other sites
eng3d    91
quote:
Original post by Biberpelztrompete

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 ??


mipmap is a collection of bitmap. bitmap is a simple 2d-imagen without nothing more that colors and in some cases a alpha component.

mipmap is used to draw a diferent bitmap in some cases.. In fact, you can draw a 256x256 bitmaps when the object is near to camera, or use a 16x16 bitmaps when the object is far to camera.

If you let, that opengl transform you bitmaps from non-power-2 to power-2, then you lost some performance.. is better that transform before to power-2


Share this post


Link to post
Share on other sites