Sign in to follow this  

Reverse normal in ray-plane intersection

This topic is 1115 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

Hello, I am trying to do ray-plane intersection based on this siggraph material: http://www.siggraph.org/education/materials/HyperGraph/raytrace/rayplane_intersection.htm and there the tutorial says that if the dot product between the ray direction and the plane normal is greater than zero then it usually should be reversed.

Why? Since I don't know yet the reason, I also don't know if I can reverse it soon after the first intersection test for the first pixel and then forget about it, or if I can reverse it once only for the intersection rays (I am using orthographic projection, so the ray's direction is always 0,0,1) and then for reflection/refraction rays should I do the dot product test everytime?

Someone could do the favor of clarify that out for me? 

Share this post


Link to post
Share on other sites

If the dot product between the ray direction and the plane normal is greater than zero then it indicates that if you're going to collide with the plane at all, you'll be hitting the back of it.

 

Exactly what behaviour you want to take when a ray hits a back face is up to you. By reversing it, you're essentially making your plane double sided, which might be desirable, it probably depends on your usage case. You might want to be able to see through the back faces, or to ignore them because you have another plane at the same location but pointing the other way with different material properties.

 

Taking steps like precaclulating dot product results because your ray's direction is always 0,0,1 sounds like it might be a premature optimization at this stage. I would get stuff working before you put in special optimizations that take advantage of your ortho projection.

Edited by C0lumbo

Share this post


Link to post
Share on other sites

 You might want to be able to see through the back faces, or to ignore them because you have another plane at the same location but pointing the other way with different material properties.

 

 

Well, in my case I am just concerned about using planes to represent things like ground or sky, at least for the time being. So in this case I can ignore this reverse procedure, right ?

Share this post


Link to post
Share on other sites

Yes, you should be able to ignore the reverse procedure if you don't want back faces to be visible.

 

Just remember whenever you're investigating why something isn't visible, that one of the many possible explanations is because you're looking through the back of the surface.

Share this post


Link to post
Share on other sites

This topic is 1115 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