Hi All
Had to have another go at improving my river setup and thought I'd give Matt's suggestion as it seemed to be the most suitable (not really a surprise there though)
Quote from: Matt on December 05, 2007, 10:03:13 AM
The Lake object should do the trick. This is a separate object, so when transparency is supported you will get the results you want. You can use the Lake object as a water table because you can displace its surface however you want. (I even considered calling the Lake object "Water Table".) If you input a heightfield shader to the water shader then you will get the topography you need.
I think that to make it more intuitive we might want to add a separate shader channel to the Lake object which can be used for defining the water table (rather than chaining the heightfield with the water surface shader as we do now).
EDIT: it would also be good if this can be done without the node network.
Matt
The tricky part was going to be fitting it in with my tiled terrains and image maps. Testing with a single terrain first.
To create the river bed I added a displacement shader after the terrain using the river image map as the displacement function, dropping the terrain 3m. Antialiasing should make the slope of the bed reasonably smooth.
For the water table I created another heightfield node using the existing load terrain node, and inserted a heightfield adjust vertical node in between to drop the heightfield 0.75m This will create a more realistic river bank where the image map doesn't exactly follow the path of the real river (e.g. if the terrain is flat)
To avoid negative displacements in other parts of the terrain showing water I masked the water table heightfield using an adjusted version of the river image map (white level = 0.05). This drops the terrain that is not river down to 0, and ensures that the river extends beneath the displaced river bank leaving no gaps. The heightfield node is then connected to the water shader of the lake, with a surface shader added after the water shader to change the water colour.
For my tiled terrains it's going to mean a parallel set of heightfield nodes with blending shaders consisting of each heightfield's blending mask (retain the tiling) multiplied by the river mask.
Works a hell of a lot better than my previous river masking and has a lot of other advantages like having a rocky river bed with partly submerged rocks.