I've implemented a SW equation solver and everything seems to be working OK, except for the normals. Here's what I mean: http://postimg.org/image/d3kah7ow5/
Here's how I'm calculating the normals in the vertex shader:
float3 tangent = float3(1.0f, (r - l) / (2.0f * dx), 0.0f); float3 bitangent = float3(0.0f, (t - b) / (2.0f * dx), 1.0f); float3 normal = cross(bitangent, tangent); normal = normalize(normal);
r/l/t/b are left/right/top/bottom neighbours.
I can fake the normal upwards by scaling the xz components but that doesn't seem like the most optimum way of doing it. Surely there's a better way?
Thanks in advance!