River/Lake model revisited (solved)

Started by bigben, September 01, 2008, 05:39:58 PM

Previous topic - Next topic

rcallicotte

I love this, Ben.  It's like watching over your shoulder and I can come back any time I need / want to.  Thank you.
So this is Disney World.  Can we live here?

dandelO

#31
This isn't exactly what you're trying to do because it relies on an image map to distribute the water.
To keep it all TG, you could still use a black/white displacement function to apply the same terrain displacement/river opacity effect but I don't know how to make a river from functions...

[attachimg=#]
The river is a TG plane object with shadow casting disabled.
The water renders only where the riverbed is(and will always intersect the shore if the water plane is set to a lower 'Y' altitude than the top 'Y' altitude of the riverbanks).

This is the river with the planet surface disabled, that's just the atmosphere behind it...
[attachimg=#]


Sadly, it doesn't rely on any complex functions or technical terrain mapping to course a river like your terrain method but it will serve as an easy way to put water only where it's wanted, with no sub-terranean render time. And, as it's just a plane, there are absolutely no vertical faces. The water-level will always just be a case of changing the 'Y' altitude in the river-plane to a point between the highest/lowest 'Y' displacements of the banks.

River tgd.RAR attatched. All you need to look at are the terrain and water groups for the general idea, the rest is just cosmetic.


bigben

Actually I do use an image to distribute the water  ;) You could connect any terrain into my clip file, replacing the vertical adjust node on the water terrain with a displacement node for fractal terrains.

There are several possible ways to use an object as the surface of water. The key to avoiding the vertical faces is not to have anything connecting to the water shader's input, so one you do that there are then other things to consider.

The main limitation I found with using a plane is that it's not very practical for very large terrains due to the curvature of the planet.

While a plane doesn't appear to involve any rendering calculations where it goes below the terrain, when it is above the terrain you have to wait for the terrain to render first before the water.

With the lake object, areas below the terrain surface are rendered as well, but masking can be used to minimise this. When the water is above the terrain, the terrain is not rendered, only the water. Whether there is any difference in the overall render speed between these two methods may be worth testing.

Using the masked lake/duplicate terrain, you don't have to calculate the placement of the water. It's all taken care of by simply displacing the river bed more than the water surface, giving you precise control over the entire terrain, but if using a plane renders faster it may be more practical for more localised scenes.

max_thehitman



WOW! I am amazed!  8) Great posts!

Thanks for all the valuable information! I will give this a try soon!
Cheers
MAX