Water shader?

Is there a way to use OpenGL in Blender’s game engine to use a water shader with reflections?

I’m completely new to this, but I’d like to keep it in mind as I learn python and Blender.

Hmm yes with python, there are some scripts about for such things on this forum. Perhaps a search for water shader animated etc might give some results?

if you want a shader that reflects/refracts, you can’t yet in blender (you don’t get full glsl access, I believe). there’s a method to fake refraction involving taking a screenshot every frame (so it puts a bit of load on the system) or you could just distort a texture (like in hl or quake) or move the water’s vertices. search a bit, you’ll prolly run into all these methods on this forum

The answer is an env cube or refl map. You can in fact do this without shaders just add a texture of an image of an enviroment similar to yours to a material (make sure you enable use blender materials) and set its mapping to “refl”. Set the face to alpha and material to Z-Transp and adjust the alpha setting of your water to your liking. The reflection texture can be set to “multiply” mixing mode so you can have lighting on your water. Unfortunately to get really good ripple effects you gotta use shaders, because there is no bump mapping or animated textures support in the standard material but an alternative is to use an array of bones under the water plane to deform it to look like waves.

Sry for the information overload!

True reflections require complex multi-pass shaders in which the GE cannot handle at the moment (as far as i know)

Do a search, there are about 3 shaders here, an ocean, a tune, and I forget what the other one is.

Umm… there’s an ocean shader by 3D-Penguin… You can find it here http://blenderartists.org/forum/showthread.php?t=94922&highlight=water

Jason Lin

you should use the wrapped texture shader of dman pretty easy to use and don’t slow down the game

I know its totally off topic and not blender but I’ve just seen the water shader in the latest version of neoaxis and its rather special… see the crane demo in the 0.53 release http://www.neoaxisgroup.com/

In that thread it says it is an adapted version of the ogre demo’s shader. That is a good shader, it’s basically like what you see in modern games.


Do you know how to set the same shader as in the reflexions-refractions.rfx example from RenderMonkey in Blender Game Engine ?




Read the last line of post #4 to understand why it is not possible.