openrw
openrw copied to clipboard
Water is not rendered left and right when looking down
When looking down to the water, there is no water rendered at the left and right sides.
I guess it's culling problem.
Looks like frustum has one axis?
This happens because wave generation in vertex shader moves Z of water surface lower, so perspective projection makes it smaller as it now a bit more far from camera.
Line: ws.z = ws.z + (-1.0+(sin(time + (ws.x + ws.y) * waveParams.x)) * waveParams.y);
Triangles mesh after transformation: