Jump to content
  • Advertisement
Sign in to follow this  
Saranya

Best way to emboss text?

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

Advertisement
I've done it in real-time before using HLSL, but I'd say the best way would be to use Photoshop, or Paintshop, or even the free Paint.NET can probably do it for you.

Share this post


Link to post
Share on other sites
Quote:
Original post by Hodgman
I've done it in real-time before using HLSL


What do you mean by real time? Please clarify.

Share this post


Link to post
Share on other sites
I meant that when drawing fancy text you have two options:
- Production-time: Get an artist to use Photoshop/etc to add effects to the text
- Real-time: Get a graphics programmer to use pixel-shaders/etc to add effects to the text

If you're going to do it in real-time, it is really helpful if your bitmap data contains an alpha channel (so in your pixel shaders you can use the alpha values to detect the edges of the letters).

This site has a HLSL example of image processing. Their shader samples a grid of pixels and compares them to see if there is a sudden change in colour (i.e. an edge).
Once you understand how to generate a new pixel from sampling it's neighbours then it's easy to modify their shader it into an embossing filter.

To write an embossing filter, sample the alpha values of the current pixel, the three pixels above and left, and the 3 pixels below and right.
Add the first 4 samples together, and subtract the last 3 samples. The result of this is the amount of highlight/shadow you should add to the center pixel.
            [+1,+1, 0]
highlight = [+1,+1,-1]
[ 0,-1,-1]

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!