Jump to content
  • Advertisement
Sign in to follow this  
aaron_ds

Bitmapped Fonts + Opengl Fragment Program

This topic is 4846 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!