# Dual paraboloid mapping math question

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

## 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 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!

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 15
• 9
• 11
• 9
• 9
• ### Forum Statistics

• Total Topics
634134
• Total Posts
3015751
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!