fixed regression in the way bump mapping is computed, and refactored the code.