Displacement to Vector Question

Started by treddie, September 20, 2017, 12:45:04 PM

Previous topic - Next topic

treddie

Hi again.

I have a question about the Displacement Shader to Vector node.  In the attached image, you see some terrain, and a preview from the attached DStoV node.
Now, as I understand it, this node takes the displacement info from the terrain and turns it into a simple vector quantity at each point in the preview.  If so, I would expect a multicolor preview, not a 2-color preview.  In other words, a preview that resembles a normal-map, where vector direction and intensity are depicted as a specific pixel color at each pixel.

I am confused as to exactly what I am seeing.  What does the green and black represent?  It seems the preview is showing where the mountains (raised area) meet the floor at roughly -80m, and everything that is green is above that -80m floor altitude.

Whaaaaat?  ???[attach=1]

Tangled-Universe

The preview is basically a camera looking down along the Y-axis, which is the green vector in TG.
So my immediate thoughts are that you are simply looking at the upfacing vectors.
Added to that, by the looks of your preview, you are displacing the surface only upwards, thus a vector generated from this situation would only give a green colour anyway.

treddie

But not all vectors are pointing directly upwards...Even the tops of the mountains are pointing in varying directions that are only roughly pointing straight upwards.  If instead, I use the Displacement Shader to Scalar function, then the green is replaced with white.


Tangled-Universe

Quote from: treddie on September 20, 2017, 02:53:04 PM
But not all vectors are pointing directly upwards...Even the tops of the mountains are pointing in varying directions that are only roughly pointing straight upwards.  If instead, I use the Displacement Shader to Scalar function, then the green is replaced with white.

I can't see all your nodes, but I think it's an illusion. What I see on the preview is that all surfaces are upwards displaced surfaces from the base planet. Without a compute terrain/normal node and a displacing shader following it you can not create lateral features, unless you use a redirect shader before the compute terrain/normal. That's pretty much the rule of thumb and is not what I'm seeing here.

Displacement shader to scalar converts the vector of each point to a single scalar value, thus it loses its colour information, simply because it's not a vector anymore, "just" a value.

treddie

#4
I am assuming my choice of "Along normal" should work.

[attach=1]

But now that I read your post more carefully, It seems that you can't ADD lateral features without the displacement shader after the compute normal.  Which makes sense because the green is pointing normal to the planet surface, which is a big sphere, which at the given camera distance might as well be all straight up, because the area visible in the scene is so small relative to the planet diameter?

digitalguru

#5
You're looking at those displacement values through the wrong node.

You can sample the terrain as vector displacement but it needs to get the value of the displacement against an undisplaced point, that point being a Terragen planet which has no displacement.

So you would pipe the terrain at any point the graph into a displacemet to vector shader then into the luminosity function of default shader (with diffuse and spec turned down) we just want the pure color, then plug this into the surface shader of a duplicate of the Planet node. Then just render the duplicate planet. The reason for using a planet is that it will then account for the curvature of the planet.

I made a tutorial that goes through all the steps a while ago:

https://www.youtube.com/watch?v=bTKfAeEPDhY

and an example file:
https://www.dropbox.com/s/abl0ypy311q7ner/terragen_vector_tutorial_end.tgd?dl=0

render the Render Bake Vector node.

EDIT; Just seen your latest post - you can use any type of displacement - lateral works just as well.

With the displacement to vector node you can plug this in anywhere, before or after the compute terrain.


treddie

digitalguru >  Am absorbing your info.  Been very busy, so getting my mind all the way around it is taking longer than I would like.

digitalguru