
Bitmap Fonts dont work with Mipmapping
Hi, I have a problem with Bitmapfonts.
I built my program on Nehe´s lesson 13.
I´m using 2 Textures with Linear Filtering and everything works as it should, BUT as soon as i´m loading a single texture with Mipmap-filtering, the text becomes invisible.
Some Code:
the call to glPrint:
glLoadIdentity();
glTranslatef(0.0f,0.0f,-1.0f);
glDisable(GL_TEXTURE_2D);
glDisable(GL_DEPTH_TEST);
glColor3f(1.0f,0.0f,0.0f);
glRasterPos2f(-0.53f, 0.4f);
glPrint("test");
glEnable(GL_TEXTURE_2D);
glEnable(GL_DEPTH_TEST);
and the texture loading:
glBindTexture(GL_TEXTURE_2D, Texture[2]);
gluBuild2DMipmaps(GL_TEXTURE_2D, 3,
TextureImage[2]->sizeX,
TextureImage[2]->sizeY,
GL_RGB, GL_UNSIGNED_BYTE,
TextureImage[2]->data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri (GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR_MIPMAP_LINEAR);
...
This last line of code causes the trouble.
If I delete it, everything works fine, if I use GL_LINEAR for the last parameter everything works fine as well.
But with mipmapping the text won´t show.
Disabling Texturing doesn´t help either
The texture is 256*256*24 BTW.
Thx for any help

Mipmapping has no meaning for magnificience.
"Mag" is when one texel projects on more than one pixel, "Min" is when one pixel corresponds to more than one texel.
Mimapping is only useful for minificience.
So, you have to write that instead :
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri (GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
Hope this helps. Hope you understood too.
Edited by - vincoof on January 28, 2002 9:58:06 AM
"Mag" is when one texel projects on more than one pixel, "Min" is when one pixel corresponds to more than one texel.
Mimapping is only useful for minificience.
So, you have to write that instead :
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri (GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
Hope this helps. Hope you understood too.
Edited by - vincoof on January 28, 2002 9:58:06 AM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement