thanks too! Definitively those functions go to my shader function library grin

The blue channel of a normalmap can be easily computed based in the relation between sine and cosine or Pythagorean trigonometric identity:

Originally Posted By: Pythagoras

pow ( sin A, 2 ) + pow ( cos A, 2 ) == 1
sin A == sqrt ( 1 - pow ( cos A, 2 ) )
cos A == sqrt ( 1 - pow ( sin A, 2 ) )

Code:
normal.b = sqrt ( 1 - ( normal.r * normal.r ) - ( normal.g * normal.g ) );



Of course, it will be always positive.