I attempted to use the algorithm described at OpenGL - How to calculate normals in a terrain height grid?. I popped it in my vertex shader and using some perlin noise functions to test it, and it worked like a charm, however when I ported it to Java, it didn't work so well.
float nx = 0;
float ny = 0;
float nz = 0;
Vector3 P = new Vector3(vpx,vpy,vpz);
Vector3 off = new Vector3(1,1,0);
float hL = tryGetHeight(_mempoints2,P.x - off.x,P.z - off.z);
float hR = tryGetHeight(_mempoints2,P.x + off.x,P.z + off.z);
float hD = tryGetHeight(_mempoints2,P.x - off.z,P.z - off.y);
float hU = tryGetHeight(_mempoints2,P.x + off.z,P.z + off.y);
nx = hL - hR;
ny = hD - hU;
nz = 2.0f;
Vector3 v = new Vector3(nx,ny,nz);
v = v.nor();
nx = v.x;
ny = v.y;
nz = v.z;
The results with the algorithm in the vertex shader:
The results with the algorithm in my buffer setup:
(Sorry about the blur, I was testing some depth of field stuff when I snapped these.)