Inspired by the rivers posts recently I set about trying to insert some rivers into my projects, using a simlar approach to that used by others to date, but incorporating my existing masking methods.
[attachthumb=#5]
<edit>An updated test render with some very basic surfacing. Working with DEM data, you can also do lakes with this method BUT you have to be careful to only place water where it should be. In the bottom right lake you can see some glitches on the far shore where the lake surface extends up on to the bank (due to automated colour selection being too broad).
Also, by default TG2 adds fractal detail to a terrain file. This should be turned OFF for loaded TER files to keep the lakes surface flat. Fractal detail can still be added to the terrain with its distribution controlled by an inverted mask used for the rivers/lakes
</edit>The end result uses a single image map to create both the river bed and then fill it with "water". The level of control provided by the nodes used is reasonably precise, and provides better control than my previous lake model (which will now be replaced with this one).
[attachthumb=#4]
The other advantage, given that DEM data has flat lake surfaces, is that it is possible to use a single mask and lake to create all of the rivers and lakes in the entire project regardless of their altitude. This simplification means I can concentrate entirely on the mask to add as many lakes as I can find in the original satellite image without any extra work at all to add them to the TGD.
The attached TGD also has a rough fake stones shader for the river bed/bank.
[attachthumb=#2]
displaced terrain for river bed
[attachthumb=#3]
Equal reverse displacement filling river bed with water.
(Top render has a 1m drop to river)
Terrain and image not included.
Tweaks to mask edge (affects mask sharpness and steepness of river bank) are via the two colour adjust shaders, particularly the white point. It is important that white point of wide mask < white point of narrow mask.
Linking the mask to the water opacity prevents render glitches putting water in areas outside the mask.
If you make any improvements to this please let me know as well
Files:
- river_test.tgd: Single image mask used for both rivers and lakes
- lakes_and_rivers.tgd: Rivers added as above, but lakebeds added via a separate mask and then "filled" with a separate lake shader for each lake. This file is intended for terrains where the lake surface on the terrain is not actually flat. Extra info and a full demo posted in http://forums.planetside.co.uk/index.php?topic=1301.msg12986#msg12986