Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How would I go about creating a river with rushing water? I can do the texture around it but I'm stuck on the actual water part. This is in Unity3D.

share|improve this question
What aspect(s) of a river with rushing water do you want to "create?" A moving semi-transparent texture? Or an actual simulation of water running across terrain? Does it need to dynamically flow? Or is it static and just needs to look convincing? – chaosTechnician Jan 17 '13 at 17:05

A) First thing you need is River bed mesh You need to create a river mesh by using 3D editing software, like Blender, Maya. If you want to do this in unity you will not get best tools but there many tools available on unity asset store, that provide creating meshes in Unity for example "Easyroads", Mesh toolkit, Prototype.

B) Second you need to create a flow map. which you can create by using free tool "Flowmap painter", Its free to use. If you are artist you can do it in Photoshop.

The purpose of this flow map is to alter the water normal map.

C) Then you need to write the shader, if you are a artist you always go and buy “Flow” on unity asset store, 20$, this will do all the programming work for you.

For programmers, we need to change water normal map, so we need to take texture coordinates of the current water pixel and offset. it using the flow vector from the flow map based on time offset.

To get real effect you need to create 2 or more waves with half time cycle offset. This will create the flowing water.

    float2 flowmap = tex2D( FlowMapFile, texFirst ).rg * 2.0f - 1.0f;

    float waveFirst = FlowMapOffsetFirst;
    float waveSecond = FlowMapOffsetSecond;
    float3 normalFirst = tex2D(WaveMapFirst, ( texFirst * TexScale ) + flowmap * waveFirst );
    float3 normalSecond = tex2D(WaveMapSecond, ( texSecond * TexScale ) + flowmap * waveSecond );
    float flowDelta = ( abs( HalfCycle - FlowMapOffsetFirst ) / HalfCycle );
    float3 offset = lerp( normalFirst, normalSecond, flowDelta );

Here is the Github source code link for learning flow shaders:

D) Last not the least you will need to add Real time refraction for that you will need Unity Pro.

For water reflection and refraction follow this:

share|improve this answer

i dont know unity, but I normally create a model of a river, unwrap it and add a texture then offset its uv coordinates within its shader.

this might help:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.