Before or after compute terrrain, Before or after base colours?

Started by james adamson, January 20, 2020, 05:48:49 AM

Previous topic - Next topic

james adamson

Another very basic question.

Could someone briefly explain the way a scene should normally be built in regards to the compute terrain node and the base colours node.
I.e when and what nodes generally go before or after both of these nodes because at the moment and from watching numerous videos it just seems you can put what you like where you like but with greatly differing results. As I understand compute terrain is it like a Terragen precomp? All geometry up to that node is evaluated and combined into a single model with all its x y and z normals etc? Should all nodes that require surface data (say I am building a road) go after compute Terrain? Should all shading be done after base colours? (I know its laid out like that but there seems a lot of scope for freestyling.) And here is what I am seeing just know. I have put a surface layer just before compute terrain. I displaced it based on a simple mask. All makes sense. I then moved these nodes to after compute terrain and the displacement result is vastly different. The height is correct but the deformation on the surface is crazy as opposed to totally flat as it was in the previous instance. Is that because I am now displacing up on (baked, wrong term I know but I think it kinda makes sense.) surface as opposed to before compute terrain.
Sorry for the long and frequent posts just trying to find my way here.
Cheers.
James.

Tangled-Universe

#1
Hi James,

Freestyling, yes absolutely there's is room for freestyling, so you may expect different answers here.

Officially, as far as I know, the intended modus operandi is this:
displacing shaders -> compute terrain -> non-displacing layers -> planet

So yes you are right, all shading should be done after the compute terrain. Base colours is merely there as a place holder to show you the intention of the workflow.
Some advanced users, me included, do some degree of freestyling, although admittedly I try to adhere to it as much as possible to keep things predictable.
Some even ignore parts of this "official"workflow, but they know what they are doing and how far they can push it. Usually.

If you stick to this consensus then your shaders should align nicely with the displacements and altitude/slope restrictions should work as expected.

Of course you can use more than 1 compute terrain node and there are cases where you'd want to.
For example, adding fake stones to an already displaced terrain works best if you add those fake stones as a child of smoothed surface layer.
The smoothing uses the latest compute terrain, so you'd need one to have it work predictably. Something like this:
displacement -> compute terrain -> smoothed surface layer for fake stones -> rock colours -> grass colours
In this case the rock and grass colours do not align anymore with the fake stones, since that is displacement after the last compute terrain.
displacement -> compute terrain -> smoothed surface layer for fake stones -> compute terrain -> rock colours -> grass colours
Adding another compute terrain node will make sure rock and grass colours align nicely and respect the altitude/slope of the stones as well.
This will also allow for effects like intersect underlying to respect the stones, for nice "filling" of the gaps between the stones.

Of course some will say "but you can also do this and that"...and they are likely right in some cases, but to understand TG's workflow you would need to start with the intended workflow and learn from there.
I know a lot of those tricks -perhaps almost all, though no one beats Dune lol-, but I'd never recommend you to start learning TG and use tricks/cheats from scratch.

There's a nice topic going on at the moment on terrain computation and one post contains a goldmine of info from Matt, which touches on explaining this workflow.
I'll modify this post with the link.

Edit: this link is a must read:
https://planetside.co.uk/forums/index.php/topic,1249.msg12539.html#msg12539

james adamson

Thanks so much that is great.
And yes I intend to remain on piste until I have a good grasp of the fundamentals.
Thanks again.
James.

WAS

I usually look at it like this

Main Displacement Geometry -> Compute Terrain -> Lateral Displacement (Optional) -> Texture Coordinates (Optional) -> Microdisplacement (like fake stones rough ground) And Colour Shaders -> Planet

james adamson

Thanks. That is kind of how I am working good to know.