September 13, 2013

water/underwater & sky shader update #02

I published this quite a while ago, but found some time to post it here just now.

This is an update video to one of my oldest projects in the making.
nothing much has changed since the last video, I just have a better computer now and I recorded it in a higher quality and framerate.

The water shader is based on my own observations.
it features:
- reflection with accurate fresnel refectance model
- refraction with chromatic aberration
- projected caustics on geometry from the water surface based on normals
- seamless transition to underwater (no fake fog added)
- accurate water volume with light scattering
- view and light ray color extinction based on water color and sunlight
- simple coastline detection based on terrain`s height-map

does not yet feature:
- displaced water geometry
- underwater particles
- underwater light rays from caustics
- shoreline behaviors

Sky model is based on Preetham, but implementation is from Simon Wallner, with a significant (artistic) changes done by myself.

I have also included an overly exaggerated experimental glitter shader and a completely procedural "water droplets on lens" shader.

YES the underwater distortion is completely unrealistic and will be removed once I add underwater particles that will wobble similarly.

download blend:

sound files from


  1. thanks for all the effort, this combination of shaders, like your other demos, is the best thing I've seen since a while in BGE. kkep it up and a very big THANKS!


    ps: any progress or plans with the RGP? Just curious!

    1. thanks,

      I will try to work on RGP in the next days. I have a huge amount of inspiration and energy to do that.

  2. Great stuff as always, making the BGE really shine!

    Will you revisit any of your older shaders? There are some (like the ZX spectrum shaders from the old HDR 2.0 blend collection) I would love to have rendered per camera rather than the whole scene.

    And for me too, any news on the RGP?

  3. thanks :)
    Well about the old stuff.. I might revisit it, but not in the near future, maybe as a new shader pack or a BGE graphics demo or something like that.

    1. Hi! I wanted to ask if oyu have looked at my reports of problem in 0.99 and 0.95 water shaders;)
      Sveiks! Es vēlējos pavaicāt, vai esi paskatījies uz manu problēmu 0.99 un 0.95 ūdens šeideros;)

    2. chau, jaa, bet nevaru īsti saprast kur ir problēma. Kāda ir tava datora videokarte un operētājsistēma?

  4. Wow this looks fantastic! Any chance you could show how to recreate this effect in Cycles?

  5. Hi Martin, I am creating a large MMO scale game that will be based on the ocean. We are looking to really sing Blender's praises on the game and what can be achieved. Would you be interested in working on this project? It would be paid work :)

  6. You can contact me: or on Skype: steve.konka

    I've also PM'd you on Blender Artist as you came very highly recommended for our project. Thanks :)

  7. This is one of the most beautiful effects I have seen. I can't imagine how much work you put into this.

  8. Wow!! i am very impressed with your lovely post.. I am so glad to left comment on this..This has been a so interesting read, would love to read more here….
    Buy Laptops

  9. I get a blue buffer, no reflections, no refraction...:/

  10. This game is amazing really enjoyable.I love it .If you want more interesting game get it here.Interesting Game

  11. Are we allowed to use any of your water projects in games ? They are amazing and could really improve a game greatly.

  12. Im sorry, I am disabled and waiting for my disability, or I would donate as much as I could, I will donate in the future when it is possible for me to do so. I appreciate talented people like yourself, I believe in donations as well. Great work and than you Martin!!

  13. Always thought this shader was amazing, great work! I recently ported it to Unity: I was wondering if it would be ok with you if I released the source code?