Realistic Water Environment Tutorial (Updated)

Hello! Someone requested I do a tutorial on creating realistic water in the game engine. It took me all day, but I finally have it all done. It’s a bit long, has a few pics to help you through it and includes a finished blend so you can see what you should get at the end of the tutorial (more or less). This tutorial isn’t for complete noobs, but most people should be able to follow it.

Please tell me if it doesn’t actually work. I may have missed a step or explained something poorly. All files needed to follow the tutorial are included.

The tutorial comes in PDF, DOC and DOCX format. All pictures of the steps are included too, in case they aren’t high enough resolution in the actual tutorial.

Download (now fixed, so the blend’s files are packed): Linky

Have fun and tell me what you think! :slight_smile:


well, the tutorial looks quite clear and “correct”…I just did a fast read…
But the images will not show up, because you did not pack the file, and the “path’s” to image files, are “absolute” ones.
Thank you anyway!

Ohh oops :slight_smile: This is my first ever tutorial, so something was bound to go wrong. I’ll re upload it with the images and everything packed.

EDIT: Okay, I packed the files so the blend can be used anywhere.I should also point out some things in this tutorial will not work with ATI graphics cards, such as the underwater fog. The mouselook script doesn’t function correctly on Macs either. One more thing: I forgot to include the wavy distortion 2d filter as an underwater effect. I’m hoping people can do this themselves. You can find the distortion filter in my other water demos, which can be found here: Linky

And get the new tutorial here (the first post has also been updated)

Have fun!

Sweet. Thank you so much for the tut. I can really use this.

Thank you for taking the time to do this. It will help alot…

Not working on ATI? Dang,

Awesome work. Looks great! Didn’t understand that it was an underwater thing at first. You did a great job with this, Will definitely become a standard underwater for me =D

Everything works on ATI apart from the underwater fog. You can fake the fog with nodes for every material that’s under the water or a screen overlay (easier solution). Check the links bellow for examples of each effect:

Hope these help :slight_smile:

Thanks everyone for the comments.

Has noone yet tried to implement this?:

				Originally Posted by <b>Rorkimaru</b> 					[![](]( 				
			<i>As part of their  [I]<i>[Nocturnal Initiative](</i></i> Insomniac games have released the amazing tech used to create the stunning water effects in Resistance 2 on the PS3 as open source.

I’m just posting this here in the hope anyone on the BGE team or those from Twilight 22 may find the information useful and implement this or a similar technology into the game engine.…tech-for-devs/

This is just some interesting free technology and I’m not saying that the BGE is useless without it. I just figured people may not have heard about it since I only picked up on it as part of an aside during an interview about the new Ratchet and Clank[/I]

Thanks so much for this! I struggled with it for a few hours (not your fault, just me approaching material beyond me at first) and finally got it working perfectly, and it’s incredible. It’s taught me a lot and given me a lot to play with; hopefully I’ll be able to adapt it for use soon but in the meantime, I’ve got a small world that I can play around with that has fantastic-looking water :smiley:

I can’t download the file due to some connection problems on this computer, so would anyone post some screenshots of their results due to this tutorial?

Here are my results:

I’d like to see what other people have got too :slight_smile:

The fog GLSL code can be fixed for ATI by changing:

Line 7:

const float far = 3;


Line 7:

const float far = 3.0;

Neat tutorial!

Thanks for sharing, I’m definitely bookmarking this… :slight_smile:

I have just noticed one annoying limitation of the example - BGE render to texture clips object 100 units above the mirror plane. So if I make skydome bigger several times (because for my flight sim I’d like to use all 5000 units camera range) , the water does not reflect it anymore.

I am wondering, is it possible to have 2 reflection textures mixed, I mean that the skydome could be applied as a reflection texture in materials directly ( this is how I do to make my water but meanwhile render to texture reflection is mixed with it, so all near water object are reflected properly?

That should be achievable with a couple of diffuse layers or with nodes.

Hello, I need to increase texture clipping above mirror plane too. How can I do this?
Here’s my game. It’s just don’t look right.


Hate to bump and old thread. But does anyone know a way to get around the 100 unit limit with regard to rendering to texture?

Does the shaders have to be supported by the driver to make that cool reflection?
cuz when i press “Blender GLSL materials” in “Game” menu it tells me that the shaders are not supported by driver.

You can put several planes together every 100 units and it should work. Each plane will need to have a different reflection texture applied to it. It’s probably the easiest and most straight forward answer. It also means you can have higher resolution reflections, as they seem to be capped at 1024x1024, even if you tell them to go higher.

Hope that helps.