Are the water seams supposed to work as intended?

I've got the regular water rendering properly at this point, but there's overlap with the alpha as well as the seams still being present in it which is making the final result look wrong 🙁

I've checked the source code of drawSceneGlassSeams and drawSceneGlass and their code lines up with one another, which makes me think that the water seam generation isn't going smoothly? Any way we can fix this?

0 0
Is this water using vertex animation? The gaps in your picture appear to come from vertex displacement. Any animation you apply to vertices must use world coordinates, so the same point in space will see the same displacement. If this is in mesh space, you will have the same vert in world coordinates in adjacent cells displaced by a different amount, creating gaps like the ones seen in your image. 
0 0
You're right, it is indeed the vertex animation. The odd thing is however, that if I display the world position in the color, it looks like it's smooth.
I've also found a bug in the water triangle generation, but I'll get to that after this has been fixed.

This is the calculation of the vertex animation. If I remove the pos.x and pos.z the seams are gone, but then so is the animation. Is this the correct way of calculating the world position? If so, then how can it be that it's not working?
vec4 glVertex;// = vertexPos;
glVertex.x = vertexPos.x;
glVertex.y = vertexPos.y;
glVertex.z = vertexPos.z;
glVertex.w = vertexPos.w;
glVertex.x = (2.0*glVertex.x)/32766.0 - 0.5;
glVertex.y = (2.0*glVertex.y)/32766.0 - 0.5;
glVertex.z = (2.0*glVertex.z)/32766.0 - 0.5;
float matType = glVertex.w;
vertexType = (2.0*matType)/32767.0 - 0.5;
glVertex.w = 1.0;

vec4 pos = vec4(cellSize,cellSize,cellSize,1)*glVertex + vec4(offset, 0.0);
glVertex.y -=
0.015*(2.0 + sin(0.007*pos.x + 0.0025*time) + cos(0.0072*pos.z + 0.0021*time))/pow(2.0, LOD) +
0.002*(2.0 + sin(0.3*pos.x + 0.02*time) + cos(0.3*pos.z + 0.015*time))/pow(2.0, LOD);

0 0