Sign in to follow this  
sirob

Reflection Matrices

Recommended Posts

sirob    1181
Alright, so I've got a water plane. I'm calling D3DXPlaneFromPointNormal to get it in an ABCD format (just picking a point on the plane). Then, I call D3DXMatrixReflect with that plane. I add it before the world matrix to my transformations (Reflect * World * View * Proj), but it's not working. This renders nothing in my water. I'd be getting sky if I had any. I've disabled all culling. If I don't use a reflection matrix, my water is simply see through, and shows exactly what's under it. So, I know my other code is working, I'm just not getting anything projected. Any suggestions? I don't really know where to start looking.

Share this post


Link to post
Share on other sites
Lestat3D    122
First you have to texturize the water plane.
Second you have to render the world in two stages
1. Render the world to the water plane texture using the reflected matrix as the view matrix.
2. Render the world to the back buffer using the original view matrix.
And that's it. You'll must see a plane with the world reflected in it.
This technique is called Environment Mapping.

Share this post


Link to post
Share on other sites
sirob    1181
Forgot to mention, I'm using stencil buffering. Not rendering to a texture at all. It seems that the reflection matrix is off, but I'm not sure how to even start check if it's correct.

Any info on that?

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