How can I make this depth water effect?

Hello Everyone!

Im currently making a project on aquatic life and seas and I’ve done a pretty good job so far!
However I once played a game that has a incredible graphics and I like to make a water like this

image
If you see the image, you’ll notice that the water and a sand will affect the color based on their depths. The more its deeper the more blue it would be.


I tried to replicate it as much as I can. But the best i can do is change the ocean floor color and the island sand color to make it match as the picture i have given you.

I wonder if theres any Roblox Technology that exist to make that kinds of water?
Thanks!

I’ve been doing a lot of searching regarding your question, it’s pretty interesting, and after my deep dive, I think I have something for you.

Material variants would be a good bet, but there’s plenty of issues; e.g: Roblox doesn’t support Material Variants with Water, nor do they allow the use of multiple material variants in terrain; Even if you were willing to use multiple terrain material overrides to create your different shades of blue, making these terrain materials non-collideable would be a nightmare; All Terrain Voxels use the same collision group, so you’d either have to bypass Roblox’s collisions to allow players to pass through water Without using a collision group, or you’d need to disable Terrain Collisions, and come up with your own Collision Code to re-enable Collisions on Land Material. So… You there’s no practical way of colouring Terrain Water with Terrain Water alone.

There’s a couple possible solutions to your problem, except they come with the caveat of having your customisation in Roblox’s terrain system.

Solution 1: You could create an Animated Water Material, like in this post, and combine it with one of various methods to allow swimming inside of parts. I’ve seen plenty of posts about swimmable parts, here’s two posts I just found, one explaining a method of doing this, and the other being a Free Model.

When experimenting with CollisionGroups and Water in Studio, I found that when not colliding with Water, your Character will still swim, yet won’t have any Buoyancy. The code to get your Character Swimming doesn’t account for that, the Model does account for the need of buoyancy, but also seems (from a quick look at the code) to be pretty bloated with Modules, and also doesn’t account for Part Buoyancy Physics, only the Player’s Ability to Swim.

For the Functionality of the Water, I’d recommend you code something else up yourself. potentially using Fb=-pgV, although I’m unsure of how Volume be calculated with Conjoining Parts (I’m not too good with physics).

Solution 2 (that I find a bit more confusing): You could Generate Skinned Meshes for the colourable wave surface of the water, (like in this showcase I found), being able to choose the Material of each Wave Mesh, while using either using a Terrain or Part Water Method for Depth. Although (I have no idea how you’d go about this) I’d argue you should Bake your Waves, since your game presumably doesn’t heavily focus on water.

This is my first time replying to a Question on the forum, I hope you find this helpful, and that you can figure it out with this info!

4 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.