PDA

View Full Version : Calculating the Normal of a pixel



Moetman
06-26-2010, 05:48 PM
Can someone provide some insight into this problem? If I have a R,G,B value - How do I calculate the normal? Do I take the normalized value of the surrounding pixel values?

Regards

ZbuffeR
06-27-2010, 04:17 AM
Do you know what is a surface normal ? It is a vector that perpendicular to the local surface, and points outside.

This has nothing to do with color, but with geometry.
You can "fake" it by using the color texture as displacement map, so interpret luminosity difference as depth difference, and infer local plane to build normal vector. Something like a low pass filter can give results.