#how do i keep the water from clipping through my boat model

4 messages · Page 1 of 1 (latest)

scarlet portal
#

i have this issue basically i have two objects the water which is a plane with shader material that i created and the boat which is a glb model created in blender and all i want is for the water not to be able to clip through the boat if anyone knows how to achieve this it will be much appreciated

#

i tried doing this and it works but the boat becomes transparent and you can see through it

faint terrace
# scarlet portal i have this issue basically i have two objects the water which is a plane with s...

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.