Jump to content
  • Advertisement
Sign in to follow this  
Ryan_001

Text rendering in a Pixel shader

This topic is 4399 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

The question is: How would u go about rendering text, using only a pixel shader (and associated textures), using a font that doesn't have a fixed character size? A fixed sized font seems pretty easy. Render the font to a texture, use a second texture (the displayed text), to index into the first. The thing is, with non-fixed sized characters, I'm not sure exactly how u would go about determining which pixel corresponded to which character. Also, would there be an easy way to do either fixed, or variable character sized, text rendering, if the font characters weren't first rendered into a separate texture, rather were rendered directly from the font data (though possibly that data stored in a texture). Or in other words, is it possible to do resolution independant text rendering in the pixel shader alone. I'm not really look for the 'best' or 'optimal' (ie. I wouldn't bother too much with why u would approach text rending in this method, rather focus on how), rather just opening it up for discussion. I have a few ideas, but I haven't been able to find too much on this on the web, and I'm sure there are some cool tricks/hacks out there that I haven't heard of.

Share this post


Link to post
Share on other sites
Advertisement
There are a couple of papers on rendering vectors that are stored in textures using pixel shaders. This can be used to implement infinite resolution textures - which can be used for fonts.

See Vector Texture Maps on the GPU and Beyond the pixel: towards infinite resolution textures.

Both approaches would require converting vector font data into a suitable format for the rendering algorithm and the conversion is probably the difficult bit.


dave j

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!