Water

Heya. I’ve got a Daylight Water prefab with a cube mesh, and it looks pretty good. However, when the FPS Controller (which happens to be what I’m using) falls into the water (which happens to be deeper than it), the water dissappears completely. Shouldn’t it be thick and not just bordering the outsides. Basically, how do I get it to look like water even from under the surface? Thanks!

Ah, now you get to discover the joys of surface normals. :slight_smile: As I recall you’re working with Blender…if you go into edit mode and turn on “Draw Normals,” you get little lines showing the direction of surface normals. These tell Unity what the outsides of objects are. Because all 3D objects are really just infinitely thin skins, none are “solid.” From the other side opposite the surface normal of polygons, typically they will be invisible, depending on the shader. (This is even useful…imagine a 3D game where you have a map view. You see the ceiling of rooms from the 3D view because the surface normal points down, but the map view from above the ceiling would see right through it.)

So, from the inside of your cube mesh, the surface normals are pointing away from the camera, and invisible. To create the illusion of “thickness,” you could make a cube in Blender, then select all the vertices, duplicate them, and flip the normals (Mesh → Normals → Flip). That way you have normals pointing away from the surface on both sides. To quickly UV map it, go into UV map mode and map it as Reset 1/1. Then you can import that into Unity and give it the water texture.

To further create the illusion of being in water, you could make the cube a trigger, with a script attached that does something like increase the fog significantly when the FPS controller is inside and put it back to normal when outside.

Alternately, if you wanted to get fancy, you could make a small flat plane that’s a child of the FPS controller and have it positioned right in front of the player’s view, so it’s always “in your face”. Make it have alpha transparency and put a wavy texture on it, which you then animate by cycling through the texture offset. This would be deactivated normally, but entering the water trigger would activate it so you get that wavy, underwatery look.

–Eric

Wow! I had no idea. Thanks for the grat ideas. I’ll try stuff out until I get the effect I’m looking for. Thanks! :slight_smile: