Terrain Detail Culling Setup

Started by WAS, October 16, 2020, 06:38:40 PM

Previous topic - Next topic

WAS

This was just a test to see if it would help render time, and it does to a slight degree. Just experimenting. Use as you'd like.

This project on my system renders at 56 seconds with just the power fractal as the terrain shader, or 52 seconds with the distance culling (with same power fractal plugged into the Input Shaders null).

Usage:
  • Plug your shaders into the Input Terrain Shaders main input.
  • Make sure all shaders you want smoothed have "Obey downstream smoothing filters" checked.
  • Connect Shader Detail Culling Surface into your node network through its main input, usually at the end of the Shaders group. 
  • Connect your render camera to the Camera input of the Distance Shader. 

Information:
This setup will only work on shaders that respond to smoothing filters. Power fractals, and Cloud density fractals for example. Additionally, shaders in World Space or Final Position will not be affected either. If you want to smooth shader details but preserve masks and boundaries uncheck "Obey downstream smoothing filters" in your masks

Dune

I occasionally use a method like this (either masking out displacement or smoothing) to smooth water displacement in the distance, as water with rough displacement tends to need more time to render due to all reflections and transparency. So it's handy to have at hand for certain occasions.

WAS

Quote from: Dune on October 17, 2020, 02:46:04 AMI occasionally use a method like this (either masking out displacement or smoothing) to smooth water displacement in the distance, as water with rough displacement tends to need more time to render due to all reflections and transparency. So it's handy to have at hand for certain occasions.
I didn't full displacement for this setup but that is a good idea for micro disp terrains where in the distance they tend to get rough noise if AA isn't high, or even sand dunes where those black triangles show up in the horizon (also happen I foreground but as AA/MPD go up they get pushed out further).

You could easier do this with this setup and get best of both words and simply apply a Clamp 0 1 Colour (quick way to get a snapshot of colour from displaced stuff) after the smoothing shader, or a surface layer with smoothing shader plugged to colour input. I'm sure with disp culled as well even more time could be shaved.

Dune

I'll have a look at what you set up. Of course there's a balance, because more shaders means longer render time as well. I don't know how 'costly' smoothing out displacement is, for instance, against not displacing (masking out) in the first place. And if it's 1% gain, it won't be interesting, not meaning to deprecate a more comprehensive setup, of course.

WAS

Quote from: Dune on October 18, 2020, 01:51:39 AMI'll have a look at what you set up. Of course there's a balance, because more shaders means longer render time as well. I don't know how 'costly' smoothing out displacement is, for instance, against not displacing (masking out) in the first place. And if it's 1% gain, it won't be interesting, not meaning to deprecate a more comprehensive setup, of course.
From my understanding the smoothing shader is lowering octaves, which raises min scale and other scales for a smooth effect, this happens before render time so it's like the original PF was always at those settings, as I believe what the smoothing shader does is modulating settings of those shaders. That being said it should continue to work down the line speeding up even my dog-slow shaders. I tried it with my badlands shader which is a mix of 3 surfaces, brown and grey dirt and rocks, and sand with soft perlin disp for its disp. It renders at 36 minutes as is at AA6 MPD 0.6, with this setup I got 32 minutes, so it "seems" to scale up even with my ridiculous low scale detailed setups.