Order of the Butterfly
Posts: 444 from 2003/7/26
I also just noticed that if I enable the FPS counter, the FPS counter misrenders the same way the report screen does.
Yes, FPS counter uses the same GUI-view and font.Quote:
If you have any suggestions as to what might be causing the misrendering, I'd be happy to hear! Here's a screenshot of the problem.
The end scroller and the settings GUI both seem to render correctly as far as I can tell, it's really only this results screen that's giving a problem.
Characters in each string (also wrapped) are created as one vertex array with proper coords, texcoords and (in case of a font with gradient) vertex colors. The vertex array is kept in string view and is recreated only if this is necessary (e.g.: the view is resized, the string is modified, color of the text is changed). Font uses texture in grayscale as alpha for flat (or gradient) faces:
This allows you to easily change the color of fonts because I use this:
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
Problem visible on your screenshot can concerns the texture. I use mipmapping… Maybe in case of grayscale textures there is a problem with generating mipmaps?
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_ALPHA, width, height, GL_ALPHA, GL_UNSIGNED_BYTE, data);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
However… I don't think so because I use grayscale textures in GL_LUMINANCE and GL_ALPHA format very often on 3D objects and we see that everything looks correctly.
Only differece between rendering font mesh and object mesh is:
before rendering a font I use this:
glOrtho(0, viewport.getWidth(), 0, viewport.getHeight(), -1, 1);
before rendering a 3D mesh I use this:
gluPerspective(fovY, aspect, nearZ, farZ);
The report is rendered with disabled depth buffer testing
disabled polygon culling:
and with alpha blending:
But these functions:
are not used in case rendering of only 2D layer. On end scroller and in launcher before rendering 2D layer is rendered a 3D scene.
I will look for potential reason of the problem. Maybe I will detect more differences between rendering 3D+2D and only 2D...[ Edited by MDW 12.07.2023 - 14:38 ]