Sign in to follow this  

Dual paraboloid mapping math question

This topic is 3295 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm currently perusing GameDev's article on dual paraboloid mapping for a point light shadow map solution I'm developing, which seems pretty straightforward, but I'm running into a conceptual problem with the reflection of vectors, as described here: Now that we have both the incident vector and the reflected vector, we can calculate the normal vector that caused the reflection. The sum of the incident and reflected vectors should have the same direction as the normal vector, although with a different magnitude (assuming the vectors are the same length!). http://www.gamedev.net/columns/hardcore/dualparaboloid/page2.asp Maybe I'm thinking about this completely wrong, but wouldn't adding the incident vector and the reflected vector result in a vector perpendicular to the normal? I'm visualizing the problem as in this picture, where the incident vector points at the vertex, and the reflected vector points away from it: http://escience.anu.edu.au/lecture/cg/GlobalIllumination/Image/reflectedRay.png I can see how subtracting the vectors (like in the image) would give this result, or if both the incident vector and reflected vector had their tails together and pointed away from the vertex that their addition would result in a vector with the same direction as the normal, but you would have to change the direction of the incident vector to make it consistent with the reflection formula, and there's no mention of this in any article I've found on the subject. Additionally, in the case that the incident vector is opposite to the normal (so that the dot product is -1 and the reflected vector is in the same direction as the normal), adding the vectors would result in a vector of (0, 0, 0). So this isn't making much sense to me. The solution that I can think of is that the author is really referring to the vector from the point P to the vertex, but he consistently describes it as the vector from the vertex to P; this is corroborated by the picture of the first page that shows vectors coming from a variety of points aimed toward the origin (P) and being reflected, rather than a variety of points emanating from the origin. [Edited by - DRowe on December 3, 2008 3:55:00 PM]

Share this post


Link to post
Share on other sites
Hello,

You are correct, if the incident vector is pointing to the middle of the paraboloid, then you would need to subtract the vectors. However, in the discussion, derivation, and implementation the incident vector is found as the vector from the center of the paraboloid to the vertex that is being convertered to paraboloid space.

So it is just a nomenclature issue - in hindsight I probably should have called it something else, but as they say: hindsight is 20/20... This should also eliminate your issue with a zero magnitude vector - any object that is on the wrong side of the paraboloid dividing plane gets clipped in the pixel shader, so there should never be a mismatch leading to a zero vector.

I hope you are getting some enjoyment out of the article!

Share this post


Link to post
Share on other sites

This topic is 3295 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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