开发者

Scale Bitmapfont clearly with openGL (interpolation)?

开发者 https://www.devze.com 2023-02-03 01:56 出处:网络
I load an bitmapfont (as png image) in my openGL Application to render characters from there at a fixed size. That\'s working. But: If I want to scale some glyphs at a smaller size it doesnt look grea

I load an bitmapfont (as png image) in my openGL Application to render characters from there at a fixed size. That's working. But: If I want to scale some glyphs at a smaller size it doesnt look great. Is there a way - without using pregenerated mipmaps (I have a big bunch of several characters and need stepless sizes) to scale this more beautiful? Some way of interpolation or something?

At the moment I use something like this (C/C++ on Mac OS X):

glPopMatrix();
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBindTexture(GL_TEXTURE_2D, texture->getID());
glScalef(0.7f, 0.7f, 0); //scale here a size

{draw vert开发者_如何学JAVAexes & set texcoords}

glDisable(GL_BLEND);
glDisable(GL_TEXTURE_2D);
glPushMatrix();

Any suggestion?


Did you try using Linear filtering on your textures?:

glTexParameteri(GL_TEXTURE_2D, GL_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_MAG_FILTER, GL_LINEAR);

This after binding textures.

0

精彩评论

暂无评论...
验证码 换一张
取 消