Speeding up the rendering of water.

Started by mhaze, August 22, 2014, 06:08:41 AM

Previous topic - Next topic

mhaze

I've just discovered how  to speed up the rendering of water in some situations.  I have not tried this solution for oceans and lakes and for these I would probably stick with the default.

For streams and fast moving rivers though this new (to me at least) method achieves considerable speed increases. 

1) Use a default shader with input connected to comp terrain.
2)Use the output from the warp shader of your SSS or painted shader connected to the opacity function input of the default shader. This provides a river mask.
3) Add any surface displacement for your water to the displacement function of the default shader.
4) Connect the output  of the default shader to a surface shader.
5) Add a water shader and refletion shader to the child input of the surface shader.
IMPORTANT: In the waves tab: turn roughnes to ZERO.
In the reflection tab: turn reflections to ZERO do not turn off Index of reflection.
Adjust everything else to taste.
6) Connect another surface shader.
7) Add your foam power fractal to the colour, displacement and mask inputs of the surface shader.

Using this setup my torrent render went down from 10 hours to 3 hrs 15 mins!!!!!!!

Mick



Dune

Some additions:
The default shader's color should be set to black!
And you can use a color adjust to manipulate the whiteness (=edge) of the water that you want rendered.
If you use the displacement of the default shader you must use a color input and watch it's roughness!

But why do you add a reflective shader, if reflection is zero?

DannyG

#2
dandelO was messing with similar methods some time ago. Some useful info in this thread
http://www.planetside.co.uk/forums/index.php/topic,8793.msg94236.html#msg94236
New World Digital Art
NwdaGroup.com
Media: facebook|Twitter|Instagram

mhaze

Because I find that water shader reflection is slower than adding the reflective shader.  Yes dandelO came up with the masking method, a brilliant idea that saves a lot of time.  I suspect Dune came up with this faster way of rendering water long before I did.  But I was astonished how much difference turning off the watershaders roughness made.

bigben

Will have to try this reflection tweak in my old river model for DEMs. By coincidence I'm back on the same subject as my early river model (also with input from DandelO) http://www.planetside.co.uk/forums/index.php/topic,4746.msg49925.html#msg49925

Tangled-Universe

Yes briefly summarized there are 4 things you can do best to minimize water rendering times, here in descending order:

1) DandelO's mask trick
2) Disabling raytraced reflections
3) Disabling transparency
4) Reducing wave roughness or even disable it

Dune

You won't have much 'water' left though, if you apply all. What is also not very handy is to have 2 layers where RT reflection is being calculated (like plane/lake + ground), that's awfully slow.

mhaze

#7
I found in my tests that disabling roughness in the water shader was out and out the biggest time saver(after DandelO's mask trick of course), however, I haven't tested this for lakes or oceans.  You can add water displacement separately and for streams this provides some interesting possibilities.  Adding a reflection shader is faster than the inbuilt one though not by much.(1 sec in my tests).