Hi!
I just recently started working w/ vertex & fragment programs for Per-pixel lighting, and have come across a curious problem: When using a cube map to normalize the vertex to light and vertex to eye vectors, the results I get are VERY wrong; however, when using math to normalize these vectors, the results are correct (and look a lot better, if I do say so myself ).
Anyways, after doing the texture lookup for the normal map and the cube map, I scale both by 2 and add -1. I’ve tried not doing one, or the other, or both, with worse results, hoping that incorrect math was my problem, though w/o success.
Any help or insights is greatly appreaciated!
Thanks,
Mike