Deforming mesh water around the hull of a ship, how possible is this?

I was tasked with modelling a ship for a game my friend is developing, and part of the ship’s model will be below the water line. What options do we have for making water not appear below decks?
We obviously cannot use terrain water for this, and planned on making custom water anyways.

This boat is a vehicle, and it will move and is drivable by players, so this deformation has to be done live

I suggested using bones to deform water around the hull of the ship, but the scripter says this will create too much lag, but we haven’t tried it yet because they are unwilling to do it because they believe it will just cause lag. Does anyone have experience with this? Would it actually cause this much lag?

Another idea I had is making a custom water part that is pre-deformed in blender around the hull of the ship, it would still be animated like regular water, and the actual ocean water mesh would only deform in a large rectangle around the ship, but the custom ship water mesh would create a seamless blend between the two, covering the hole. Would it cause less lag by only making the water deform in a basic rectangle like this?

We could also only make these calculations happen for players below deck, and only for people who are close enough to actually see it. For example, if you are on ship A and see ship B in the distance, players on ship A do not need to have ship B’s water deformation calculated. They can’t even see it, so what’s the point?

Someone suggested we use terrain deformation and just make water deform or replace into air inside the hitbox of the ship’s hull which could work but it might also cause a significant amount of lag, according to the scripter

We also cannot use the glass method to make water not render below decks, it would interfere with particle effects.

Perhaps there is a method to use a mesh without deforming at all, and just making it not render in some clever way when you are below decks, but without using glass. Maybe with an alpha texture?

One scripter is saying that smartbones is optimized enough that basic deformation should work and not be super laggy

Does anyone have experience with mesh deformation? How viable would this method be?

Thanks
-Falling

1 Like

Calculating and moving every bone down to not clip into the ship would probably be costly yes.

It might be better to somehow hide the specific vertexes involved or simply have another heavy-handed trick to hide the water inside the ship, whether using the trick where slightly transparent objects cant be seen through glass and or just making the water invisible when players are below deck.

If the water is semi transparent you could just stick a big peice of glass in it

1 Like

but then if the water is swimmable u would swim in it

Does the place have Mesh APIs enabled?

1 Like

The only thing coming to mind is removing and re-adding vertexes to an editable mesh ocean, or as @plootus mentioned, a glass block in the ship and in the swimming code you check if the player is inside the ship or something and don’t allow them to swim
(sounds like the simplest solution)

1 Like