How do I create a properly lit underwater scene?

I’m trying to create an underwater scene where the lighting appears like you would expect to see underwater. An example is here:

alt text

where you can see the light hit both the objects as well as the floor. I don’t mind a repeated animation but I would really like to get the lighting effect to be fairly dynamic and give the impression the player is underwater. I suspect I need to have a transparent texture with some animated caustics which a light source must project through but I’m unsure how best to go about it.

Any pointers?

Edit: I’m not looking to show the water level on top like in the image.

Tutorial: Kostiantyn Dvornik :: Ideas: Unity world's coolest tutorial about water, girls and sky with FREE assets

  • create a directional light
  • point it downwards
  • put a cookie (directional light field) that looks like caustic water
    i.e. caustic water search on google
  • make a script to make it rotate, like

using UnityEngine;
using System.Collections;

public class caustic_movement : MonoBehaviour {

public Transform myTransform;
public float rotationSpeed = 100.0f;
public int dir = 1;

// Use this for initialization
void Start () {
myTransform = transform;

// Update is called once per frame
void Update () {
myTransform.Rotate(0, Time.deltaTime *rotationSpeed * dir, 0, Space.World);

where rotationSpeed is the rotation speed…

and dir is the direction, -1 or 1

Late answear, but for other people that bump into this question

PS: you can adicionally use “God rays” (image effects pro feature) to give the light effect comming into the water (not shown in picture)

If you want an accurate loopable caustics animation i would look at the Caustics Generator - Seamless water texture rendering

It generates a really good caustic noise (as seen it the picture in your post) and the free version allows up to 12 frames of animation and it is always loop-able. Then you only have to place it on an atlas or something and have a script scroll trough it while it is a light cookie.

I know this is a reply to a very old post, but for future readers you can check out this tutorial on how to do water caustics lighting in Unity 5.