Bitmapped Fonts + Opengl Fragment Program
Is there any way to get bitmapped fonts [Lesson 13] to play nicely with vertex and fragment programs?
Or is it best to disable them, draw the text, then enable them again?
bitmapped fonts should work just fine with shaders, but perhaps only if you use another way of doing it than nehe does.
Since there is no real reason of using shaders on text, it would be better to just turn them of while rendering text.
Since there is no real reason of using shaders on text, it would be better to just turn them of while rendering text.
www.flashbang.se | www.thegeekstate.com | nehe.gamedev.net | glAux fix for lesson 6 | [twitter]thegeekstate[/twitter]
I would think so too, but the mere act of adding
glEnable(GL_VERTEX_PROGRAM);
glEnable(GL_FRAGENT_PROGRAM);
to the InitGL function in lesson 13 turned the output into a blank screen.
glEnable(GL_VERTEX_PROGRAM);
glEnable(GL_FRAGENT_PROGRAM);
to the InitGL function in lesson 13 turned the output into a blank screen.
What you do then, in the drawing function, when you go to render your text, you should disable vertex and fragment programs. Then, after you're finished rendering your text (if there's more stuff to render that requires v/f programs, you re-enable them.
OR
At the beginning of drawing your objects that require vertex and fragment programs, you could enable them there, and disable them once you're finished drawing the objects and are about to render the text.
OR
At the beginning of drawing your objects that require vertex and fragment programs, you could enable them there, and disable them once you're finished drawing the objects and are about to render the text.
Or you could load a VP/FP combo wich does simple vertex transform and basic texture lookup, thus getting the text just as you would. This is a more generic approach.
I realize however you may mean "bitmapped text" referring to the text done using DrawPixels and the stuff, in this case I guess this would not work.
If you're using quads textured with a bitmap, sure it will work because it's what I do.
Good luck!
I realize however you may mean "bitmapped text" referring to the text done using DrawPixels and the stuff, in this case I guess this would not work.
If you're using quads textured with a bitmap, sure it will work because it's what I do.
Good luck!
Previously "Krohm"
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement