rwengine / openrw

OpenRW "Open ReWrite" is an un-official open source recreation of the classic Grand Theft Auto III game executable

Home Page:http://openrw.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Water is not rendered left and right when looking down

madebr opened this issue · comments

When looking down to the water, there is no water rendered at the left and right sides.

screenshot from 2018-09-01 02-47-58

I guess it's culling problem.

Looks like frustum has one axis?

commented

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:
image