Displacement, where?

Started by joiecito, June 26, 2009, 04:39:25 AM

Previous topic - Next topic

joiecito

Hi there;

I'm now trying out terragen (although I'm waiting for my commercial copy) and I'm wondering how and where to apply displacement.

In the shader or in the terrain?, What are the advantages and disadvantages of both methods?, why apply displacement in the shader and why in the terrain?.

Thank's in advance, I'm a bit confused.

FrankB

The thing about applying displacement in the terrain or shader part is really the question: before or after the compute normal.
As a rule of thumb apply any large scale and medium scale displacement *before* the compute normal.

If you would apply large scale displacements after the compute normal, e.g. a surface shader will assume the terain shape he's getting from the compute normal, but which is not accurate anymore because you applied additional displacement afterwards.

Does that help clarify?

Cheers,
Frank

joiecito

So, the interface has two separate tabs, one for terrains and one for shaders..., large scale displacements should go in the terrains tab and small scale displacements in the shaders tab then?, I'm still a bit confused...

dandelO

Yes, generally that's what Frank's saying.

The way I think about it is: Your terrain tab will be like your main rock/mountain structure. Once that's been run through 'compute normal' the 'shaders' have now got a baseline 'normal' to build on. You make the mud sit on top of rock, grass sit on top of mud, etc. Any displacements, negative or positive, after the compute normal node are extra, and above/below(;)) the final shape of your landscape that's specified through your terrain displacement shaders.

You wouldn't want to use the compute normal for the 'terrain' input of populations if you had extra layers in your shaders tab applying displacement.(it defaults to 'compute normal' as the population's 'terrain shader'. You need to manually change it.)
If you have 0.5 metres of displaced mud on top of your rock and you lay grass down as a pop' you'd want to use the mud layer(for example) to lay the grass on, not the terrain normal anymore(because it's now 0.5m beneath the mud).

Hope there's some sense in there, I tend to blether. ^^ :)

FrankB

Quote from: joiecito on June 26, 2009, 07:37:39 AM
So, the interface has two separate tabs, one for terrains and one for shaders..., large scale displacements should go in the terrains tab and small scale displacements in the shaders tab then?, I'm still a bit confused...

DandelO explained this more depth, but another practical example could be the following:

Large scale displacements: your mountains, strata, large outcrops of any kind... anything that is bigger than a meter
Small scale displacement: fake stones, small voronoi cracks, intersecting surfaces

Regards,
Frank

Henry Blewer

It's so nice to have this explained. Thank you.
http://flickr.com/photos/njeneb/
Forget Tuesday; It's just Monday spelled with a T

Oshyan

Another distinction is that, in the normal scene setup, displacement built in the Terrain layout/group will not apply any color to the scene, only displacement (the color is covered by the Base Colours shader). If you *only* want to add displacement, not color, it's generally best/safest to do it in the Terrain area. If you must apply displacement and color with the same shader, it usually needs to be done in the Shaders area, though again this should only be smaller scale displacements (and there are ways around that limitation of course). But again the primary rule is large and medium scale in Terrain, smaller in Shaders.

- Oshyan

Henry Blewer

Good tip. I reached the same conclusion with my stuff last week. it makes things easier.
http://flickr.com/photos/njeneb/
Forget Tuesday; It's just Monday spelled with a T

joiecito

Thank you all for your replys, now I'm less confussed ;)

So..., what if I want two fake stones layered one on top of eachother (big ones over small ones for example)?.

Thank's in advance.

Hetzen

You then have to add another compute terrain to make the first fake stones part of the geometry for the second to work out where it can populate, and depending on how big the first fake stones are, you may have to adjust the patch size in the second compute terrain to accurately represent it's size, ie less than 20m (if a single patch size equals a metre? PS?).

dandelO

You can do this with a merge shader, too.

Little stones - Bigger stones
              v
      Merge shader

Use these settings: Merge displacement, highest=raise.

This will lay the big stones on top of the small ones, without the displacements from the lower, smaller ones appearing on the surface of all the other stones above them. Do this with as many pyramids of stones and merge shaders as you like, small to the left, big to the right.

There's a clipfile in my Public Library vol.1 that uses this method to lay 8 layers of stones on top of each other... http://forums.planetside.co.uk/index.php?topic=4922.0