Need to implement light beams under water

Dear all!

I am really lost looking for an idea how I can implement the effect similar to one shown on this snapshot:
- here light spots on the sea surface are not needed, the scene should look light the result of sunlight penetrating through water.
You can also google for “light beams under water” to see other sample images that explains the task.

The result scene should have the following features:

  1. Several light beams (the number of beams probably to be defined externally)
  2. Some areas on the seabed lit as shown on the image above
  3. Light beams should not penetrate through other 3D objects that can appear in the scene. A “3D objects” is a regular shaded or textured 3D mesh.

So far I have understood that there is some technique called “god rays” - but not really sure it is applicable in my case. It seems I need also some approach to simulate the lit areas on the seabed, not sure if it is the same algo that renders the beams.

So thanks a lot in advance for any hints or advices, recommended readings, etc.!


Yes, it is the same thing as “god rays” except that “god rays” are seen in the sky, coming down from between clouds.

The simplest way to simulate them is to render a quad that always faces you (look up billboarding) and apply an appropriate texture and apply blending.

Thanks a lot, it sounds as a reasonable rough approximation!

But this approach is not really 3D and it does not deal with opaque 3D objects under water that the rays should normally penetrate through…seems like something similar to shadows, but how can I calculate and render the proper volume using GL?

Meanwhile, I have found some example: Hydrax plug-in for OGRE3D
But it also does not handle opaque objects intersecting the rays properly…

Handling that is really nothing more than a projective textured light.

Thanks for the hint, I’ll try to find out more about this topic.

Sorry, of course I meant “should NOT normally penetrate through”!