PDA

View Full Version : Antialiasing for texte



04-20-2004, 11:13 PM
Hello I want to use the antialiasing for a texte
but I know that for the polygon, point or line
So How can I use the antialiasing for a texte 3D in openGL with VISUALBasic V6?

zeckensack
04-20-2004, 11:58 PM
If you use textures as glyphs, the texture filter will take care of aliasing. The "best" texture filter for this purpose is the trilinear filter (GL_LINEAR_MIPMAP_LINEAR for minification, GL_LINEAR for magnification).

Note that this requires having mipmaps. It may be easier (and more readable in the end) to just enforce a certain minimum screen size for glyphs, so that they are never minified.

High quality text rendering can get complicated. If you're comfortable with using libraries, I'd recommend FreeType (http://www.freetype.org/) .

04-23-2004, 03:46 AM
I m french and novice in opengl and your function dont work in my program or I dont use it. But I look for in internet and i find


glshademodel glsmooth
glcleardepth
glenable gldepthtest
gldepthfunc Leaqual
glHint
and this dont work too Why ?I put this before my programm which draw.

ZbuffeR
04-23-2004, 06:20 AM
begin simplified french translation of what zeckensack said...

Si tu utilises une texture pour chaque lettre, l'antialiasing est fait automatiquement par la filtrage de texture avec les paramètres de texture suivants :
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTE R,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTE R,GL_LINEAR_MIPMAP_LINEAR);

Noter que cela nécessite des mipmaps (changer le MIN_FILTER à GL_LINEAR dans le cas contraire).

Le rendu de texte de haute qualité devient rapidement compliqué.
zeckensack conseille la lib suivante : http://www.freetype.org/
END simplified french translation of was zeckensack said.

Note de moi: la partie sur "texture mapped fonts" semble interessante :
http://sjbaker.org/steve/omniv/opengl_text.html

Good luck.