Hi!
I am trying to fix some issues with my projected grid ocean.
One big issue is the waves near the camera creates holes when the edge-vertice closest to the camera moves into the frustrum.
I would like to move the grid back abit, “behind the camera”, along the xz-axis to solve this, something like:
gl_Position.xz -= 5.0 * viewMatrix.xz
I see that my question is not very well formulated, it’s partly because of lack of understanding of the code I am using and partly beacuse of lack of terms.
By xz-axis I should probly say along the xz-plane.
I only want it to move “backwards” according to cameras rotation on that same plane, and ignore the cameras “pitch” since I want the water plane to stay on Y = 0.
The viewMatrix comes from the OpenGL tools I am using, so I have no idea how it is created.
It may be I need to manipulate the z-vector of the water plane before I perform these? gl_Position = gl_ProjectionMatrix * viewMatrix * myWaterPlane;