Check out Amazon.com!

BlitzCoder Code Archives PageMain Codes Page
"Real-Time Emboss", by onion
Similar in a way to Photoshop's emboss filter.

It takes a pixel value, and a value from one of the 8 next to it, and combined the two in a clever way to do an emboss effect. Currently loops round the 8 'compass directions' to give a funky effect.

Just wrote it in response to a forum post. Probably won't ever be updated. You'll need a suitable 'image.bmp' file, anything should be fine.

Version 0.1: Ok, its got a bug, it turns everything blue. I suspect I've mucked up the binary shifting..

Suggested improvements:

Fix the bug. :)

Remove the n and m matrices and replace with a smooth sin curve for a lovely lighting effect.

Remove half the readpixelfast statements. At the moment every pixel is read twice. This is quite mad. Fling the values into a 2d array. Much faster.

Animate the matrices.. imagine it.. an emboss text scroller.. cool..

Whatever else.. go play.

NOTE:

Updated. I fixed the bug. All my binary shifts were flippin' back-to-front. Doh!
Code
Copyright(c) 2000-2004, BlitzCoder. All Rights Reserved.

Code software created by Krylar's Kreations