Home

River via Image Map Shader

Wednesday, April 23rd, 2008 | Author:

TG2 can do rather a lot, but some things are a long time coming. Among them is transparent water and, of course, water flowing downwards. I set about looking for a plausible simulation.

For a river, you first need a sample determining where the river should flow. Later the terrain will be displaced slightly downwards and a Water Shader will be laid over the thus created river bed. You should start by rendering a pre-sample and by converting the Heightmap to a Bitmap, respectively. The pre-sample should display the form of the terrain well and contain a lot of details. I simply started with a bitmap I had painted in Photoshop and later adapted the terrain to it. Generally, it’s completely up to you how you get the sample. I personally have found an alternative solution:

You first create a terrain, a surface, etc. and lay a completely white Distribution Shader on top of that. Afterwards you create a black one having the height of the terrain as the Maximum Altitude and the difference to the lowest point as the Fuzzy Zone. You need a little instinct to adjust the whole thing in a way that we have as many shades of grey as possible in the area in which the river ought to be. Just try it!

Via an orthogonal render, I then made a top view of the area where the river shall be seen. I let the sun shine from directly above and adjusted the brightness so that I could see as much as possible in the picture. I then created a sample with Photoshop.

Here are some examples:

Worldmachine Output

Orthogonal Render

River drawn in on the Orthogonal Render

Finished Mask, that’s our sample.

We load the sample via Image Map Shader and project it onto the terrain not through the camera but through plan Y. We simply need to adjust its size and position so that the mask fits into the terrain. We then connect the Image Map Shader to a Color Adjust and use this as a Blending Shader of a Power Fractal. Via the Color Adjust we can control the river width and the sharpness of edges a little later on. First, however, we slightly displace the Fractal downwards and colour it in sandy hues. After adjusting the edges, the river bed is finished.

The next step requires a little instinct. We need a Surface Layer with a Water Shader as a child; the Surface Layer is blended by the Image Map Shader. For that, we first create the Layer and a Color Adjust placed between the Image Map Shader and the Breakup Input of the Surface Layer. We then set the Surface Layer Coverage to 0.9 and crank up the Breakup so that we only see colour where the river ought to be (I took 10). We can play with the Color Adjust again . The Water Shader should only be visible where the terrain is somewhat level even after the Displacement; in order to see only the Water Shader (and no colours), we set the colour to black.

Now that the river is finished, all we need is transparency. Thus we create a Distance Shader and connect it with a Merge Shader set between the Color Adjust and the Breakup Input of the Layer. We set the Mode of Merge Colour to Multiply and Mix to A to 1. We can now adjust the transparency using the Distance Shader by changing the Far Distance and the Near Colour. It’s not quite simple to obtain satisfying results, so keep trying. Coverage and Breakup also have an influence on it.

This is the Node Network:

That’s it! Here’s an example rendered using this method:

Tags »

Trackback: Trackback-URL | Comments Feed: RSS 2.0
Category: Advanced, How to..

You can leave a response.

2 Responses

  1. 1
    Ed 

    It would be so much easier if you use the river tool in geo control 2 where rivers are realistically simulated to more realized flows. It’s sad that people always assume world machine as the only application for advanced heighfield editing and seem to forget geo control entirely where as these two apps can work side by side. Another huge advantage for geo control is that it has at least a dozen types of erosion with more on the way. What can be done is import a world machine terrain into geo control and add a river network then save out as a .ter file. It would probably look gorgeous.

  2. 2
    Nikita 

    Hi Ed,

    First: Both me and Goms are fans of World Machine and own a license each, so we’re using what we already have.
    Second: There are certain things about GeoControl I really don’t like. Sure it has some nice features but IMO it’s not the “revolution” it claims to be. The painting tool is cool though.
    And finally: I’m an alpha tester for World Machine.

    So don’t expect recommendations for GeoControl from us. ;)
    For fairness’s sake, I’m trying not to put too much emphasis on World Machine.

Leave a Reply