Reflection Matrices
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement