#how do i keep the water from clipping through my boat model
4 messages · Page 1 of 1 (latest)
i tried doing this and it works but the boat becomes transparent and you can see through it
I have no idea if this is the best way to deal with this, but you could use a directional light that is pointed upward from below the boat (with zero luminosity).
Inside the fragment shader for the water plane, you could get whether a fragment is in shadow or not and set gl_FragColor.a to 0.0 if it is. If the water is above the bottom of the hull, it will be in shadow from the perspective of the upward-pointing directional light.
Note that this method only works for hull geometries that expand as they rise above the water.