Open alandtse opened 1 month ago
The issue seems to be the underwater mesh is not a flat plane but two triangles that are not perfectly flat. The issue is that because of the fact there are only 6 vertexes, the triangle gets culled and results in a the break in the mask.
One alternative may be to build the mask with the depth buffer. During partially submerged scenes, the water line looks to be where the depth goes near 0 (but not 0). The air and water below and above quickly increase in depth. It may be possible to use that depth stencil to decide the water line. We could then put a mask below that water line (of course their is a question of determining up vs down but we can probably assume down is underwater).
In one example, the gradient waterline pixel is depth 0.00258
, and immediately below it in the water, the depth goes to .994262
.
This is a vanilla bug. As demonstrated by this picture, there is a mask that is being rendered that is incorrect in two ways.
This is the mask generated by
ISUnderwaterMask
viawater.hlsl
.I have confirmed that this is only generated with partial submersion. Full submersion uses a different effect without a mask.
Here are the vertex meshes for the mask in Flat:
and in VR