Sign in to follow this  
Powerino73

Singularity Sphere Mapping and tangent space

Recommended Posts

Hi i have a big problem. My rendering engine use the deferred light system. To beginning i started with a sphere mesh mapped using sphere mapping public static Vector2 SphereMap(Vector3 vec) { float len; Vector2 retV1 = Vector2.Empty; len = (float)Math.Sqrt(vec.X * vec.X + vec.Y * vec.Y + vec.Z * vec.Z); if (len > 0.0f) { if (vec.X == 0.0f && vec.Y == 0.0f) retV1.X = 0.0f; else retV1.X = (float)((1.0f - (float)Math.Atan2(vec.X, vec.Y)/Math.PI)/ 2.0f); vec.Z /= len; retV1.Y = 1.0f - (float)saacos(vec.Z) / (float)Math.PI; } else { retV1.X = retV1.Y = 0.0f; } return retV1; } But when i use the phong light system the specular component creates a lot of noise in the singularity point. Any suggestion? something wrong? [Edited by - Powerino73 on November 10, 2009 2:08:30 PM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this