displacement question

Started by Kevin F, January 18, 2010, 05:45:11 AM

Previous topic - Next topic

Kevin F

When applying displacement to a surface layer that "requires computed normal", where do you put it? as a displacement function or as an input to the surface or after the surface ? I thought I had this figured out but it ain't doin' what I thought it should.

Hetzen

Compute Normal should be placed before you apply your lateral displacement node, ie giving any previous displacement a x,y,z positional reference, rather than just a visual displacement (think bump map here). I've often been tripped up with the slope constraint looking at the "final normal" rather than "terrain normal", could this be the problem?

Kevin F

Quote from: Hetzen on January 18, 2010, 06:41:03 AM
Compute Normal should be placed before you apply your lateral displacement node,

O.K. but where? do you just plug it into the input of the layer?


I've often been tripped up with the slope constraint looking at the "final normal" rather than "terrain normal", could this be the problem?

No slope contraints in use.


Thanks for your help Hetzen.

domdib

Mmm... So to take an example I'm currently working with, three power fractals going into a redirect shader, which is part of the normal input-output network,  does that mean that if I wanted to apply their displacements "normalised", I would have to place a Compute Normal before each single power fractal?

FrankB

#4
there just has to be a computed normal in the node chain above. That's all.
For example, you can't apply lateral displacements in the terrain tab above the compute terrain, that's because at this point in the chain TG2 think the world is a perfect sphere. So what you do is add a compute normal above your lateral displacement somewhere, and then the lateral displacement will work.


Frank

domdib


FrankB

a little bit more on that here: http://www.nwdanet.com/terragen-tutorials/34-redirectandlateral.html

It's from a post from Matt in this forum, but it's easier for me to find it on my website. I deemed this post very important and put it up in the tutorial section.

Cheers,
Frank

Kevin F

Quote from: Kevin F on January 18, 2010, 08:07:22 AM
Quote from: Hetzen on January 18, 2010, 06:41:03 AM
Compute Normal should be placed before you apply your lateral displacement node,

O.K. but where? do you just plug it into the input of the layer??????????






Hetzen

Your terrain should flow along a chain into the planet input. Starting at the top, everything before the default compute terrain has no actual x,y,z position data, compute terrain adds that, so the next displacement has all the information it needs to push the geometry around. But the next displacement after that in the chain won't know where the actual new positions of each triangle pushed with the previous displacement are. Which often won't matter, because most things after the initial compute terrain should be asthetic texturing, and won't need to know where it actually is on the geometry. But anything that does, you then have to add a compute normal which will then calculate new positions of the previous displacement, for you to exploit in the next.

A long way of saying, compute terrain - displacement - compute normal - displacment (eg lateral) , all via input/outputs.

Kevin F


Tangled-Universe

You need compute normals for displacements and compute terrain for computing displacements + texture coordinates.
The texture coordinates allow for accurate slope and height/constrictions set in the surfacelayer.

In generally you could say:

Use compute normals in your displacement-part of the node-network and just before the first "esthetic"/texturing/surface layer nodes use a compute terrain.

Jon is right about the order of work.

Martin


dandelO

As an extra little tip here, too, using a redirect shader doesn't require a compute normal node, you can plug this in before the CN node and the displacement will still be calculated along the selected axis.