I've got a question about deforming a plane using a vertex shader. I'm trying to create a reflective ocean surface using a cube map as the reflection texture. I start with a subdivided plane and then I deform its surface according to this equation:
VSIn.Position.y += 0.1f*sin(5*VSIn.Position.x - f_ElapsedTime)*sin(5*VSIn.Position.z - f_ElapsedTime);
where VSIn.Position is the raw position data taken into the vertex shader. This is the first line in the vertex shader. This seems to work in that I get my desired rolling wave effect on the plane, but my cube map reflections don't work properly because the normals still seem to be pointing in the straight up direction when ideally they should follow the curvature of the plane as it deforms.
Do I need to manually recalculate the directions of the normals, or is there an easy way to get them to follow the plane's curvature? How would you solve this problem?