Skip to main content
GameDev.net gamedev.net
🔒 Locked

Problem with mipmaping

Started by moore52 Jul 31, 2002 at 9:42 AM 9 replies 850+ views
Original Post
moore52
moore52
I have problem: When I load texture as mipmap, and when i draw it i can exacly see when starts next level mipmap. (its much blured) Is there any way to tell OpenGL from with range it should starts drawing next level mipam? Or can i use other filters? LINEAR and NEAREST are not good for fpp.
Fluid FX
Fluid FX
please tell us what kind of code you are using for example to mipmap i use this:

glGenTextures(1,§or1.texture[0]);

glBindTexture(GL_TEXTURE_2D, sector1.texture[0]);

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);

gluBuild2DMipmaps(GL_TEXTURE_2D,3,TextureImage[0]->sizeX, TextureImage[0]->sizeY,GL_RGB,GL_UNSIGNED_BYTE,TextureImage[0]->data);

tho that now it does not work anymore, it looks great on my pc..? and it doesn't bug my fps down...

the only "bad" thing is that it requires more memory(i think)

Greetz

[edited by - Fluid FX on July 31, 2002 11:05:54 AM]
moore52
moore52
something like this:


glGenTextures(1,&texture);

glBindTexture(GL_TEXTURE_2D, texture);



glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
gluBuild2DMipmaps(GL_TEXTURE_2D,4,bmpI->sizeX,bmpI->sizeY,GL_RGBA,GL_UNSIGNED_BYTE,bmpI->data);


but this is not a problem with TexParameteri (i tryed various combinations of filters)
moore52
moore52
P.S. :
Mipmaping needs more memory:
x=texture size
100%x - level 0 mipmap
+50% * 50% x - level 1 mipmap (4 times smaler)
+25% * 50% * 50% x - level 2 mipmap (16 times smaler than orginal)
+25% * 25% * 50% * 50% x - level 3 mipmap
=
circa 133% x, that makes about 1/3 additional memory
Fluid FX
Fluid FX
Fluid FX
/*wrote:

tho that now it does not work anymore, it looks great on my pc..? and it doesn''t bug my fps down...

the only "bad" thing is that it requires more memory(i think)

*/

;-)
moore52
moore52
fpp - first person perspective,
sorry by mistake, not fps
python_regious
python_regious
Enable Anisotropic texture filtering, that helps the "blurryness" you see with oblique surfaces.

Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.
python_regious
python_regious
I just read your original post again, and if you are seeing the actual boundries of your mip levels, use the LINEAR_MIPMAP_LINEAR texture minification filter. ( This combined with anisotropic texture filtering looks great ).

Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.
moore52
moore52
Anisotropic?
What is it and how can enable it?
python_regious
python_regious
Anisotropic texture filtering helps reduce the blurryness that you see on oblique ( surfaces that are at a small angle to the view ) surfaces. Goto the nVidia developers site, they have an example on anisotropic texture filtering ( as well as screenshots of standard isotropic and anisotropic texture filtering next to each other, so you can see the difference ). It explains the term aswell.

Look up the GL_EXT_texture_filter_anisotropic extension. It's extreamly easy to use.

Death of one is a tragedy, death of a million is just a statistic.

[edited by - python_regious on August 9, 2002 9:24:34 AM]
If at first you don't succeed, redefine success.
moore52
moore52
Thx!!!!

This works.
Using GL_LINEAR,GL_LINEAR_MIPMAP_LINEAR does great!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.