​Making a 3D Ocean / Underwater Space with Extremely Limited Time and Resources in Unity


Making an Ocean/Underwater Space with Extremely Limited Time and Resources in Unity

Making a little Subnautica-like space in a very short amount of time is really hard, and it takes a lot of shortcuts just to make a space that even makes you feel like you're underwater.

  • Make the Water Unclear

If you turn on Camera Fog in the Window->Rendering->Lighting Settings and increase the strength and change the color to some shade of blue, you can help hide things off in the distance, or rather things that are not off in the distance. (This is gonna take a lot of time as is.) It at least leaves things to the imagination. In addition, set the camera background to the same shade of blue to make it more effective. The downside is making things pop out at a distance through the fog is difficult. One of the ways to work around this is to use shaders that disable fog, and implement a script that changes the alpha of an object at a distance. By adjusting the alpha on a No-Fog material, you can make things come into view from farther away, but still have them disappear at a distance.  Another way to work around it is to use lights, which create a slight light circle in the distance to help guide the player. 



  • Scrap Together a Sea-Floor and Waves-Ceiling

I made the waves-ceiling first in my approach. I used Krita to paint the waves, (because it's free), but you can use any painting tool with wrap-around mode if you want. I used the Legend of Zelda: Windwaker waves as a reference, because they're so simple and yet effective at conveying waves. I then put them on a plane that was sub-divided a bunch, and used a tree wind shader I found online to make the water appear to move in a waves-like fashion, except it looked a little glitchy. I also had to modify it to turn off the fog covering it up (which took a long time to do, because I have not taken the time to learn how to write and work them yet).  Don't forget to turn off Casting Shadows in the object's renderer settings. I spent wayyy too long painting the sand in a similar way as the waves. I then used an online Normal-Map generator to give the sand material some more realism. I just threw all that onto a Terrain and painted the height for a bit to create peaks and valleys. Remember to put the Sea-Floor and Waves-Ceiling close enough together in order to create a visual sense of scale, but far away enough from each other to leave room to play and move the camera around in.

Wind Shader : https://github.com/RenanBomtempo/polygon-wind


  • Water Particles and Sun Rays

It's hard to describe in words exactly what I did to make the Particles, but I set them parented to the Player Character, and only parented the X and Z positions for the Sun Rays, using the Parent Component. The Water Particles are pretty much spawning dots randomly around the player, and the Sun Rays are pretty much elongated particles that are clustered together using the burst tool.



  • Create Shadows Cast Down from Waves onto the Sea-Floor Using Light Cookies

Make another gray-scale version of your Waves texture. Change its settings in Unity so it's marked and setup as a cookie with gray-scale for the alpha.  Put this cookie onto the directional light that lights the scene. Write a quick and simple script that makes the directional light move along the X and Z axis, so that it shifts the directional light and the cookie light along with it. This will cast onto everything in the ocean, and really help take the ocean feel to the next level.

  • Add Some Fish and Sea Life

I was starting to feel the time running out at this point, and needed to move a little faster. To add fish, I just used the Boids project from Coding Adventure by Sebastian Lague. 

I did however design my own really basic looking fish in Blender for my project to add a little personality.

The next thing I want to do to bring the ocean to life is add rocks and sea plants. 

Files

TurtleTeam-WebGL-Build.zip 11 MB
Apr 20, 2020
TurtleTeam-WindowsBuild.zip 21 MB
Apr 20, 2020
[Turtle Team Unity Project Source Code] 302 MB
Apr 20, 2020

Get Turtle Team

Leave a comment

Log in with itch.io to leave a comment.