Quote from: Hetzen on February 16, 2010, 07:49:26 AM
Hi Mogn
Would you mind talking me through your node expression?
Start with the "Get position in geometry" this node delivers a X and Z value for each point i the landscape.
This is a global array of points, where the node network below calculates a scalar value for each of this points.
This means when the last node "Multiply scalar 02" delivers these values to the function input of the "Displacement shader 01"
this node uses the same points from the "getposition in geometry" to calculate where to apply that displacement.
The output of the "Get pos.." is fed into the input of "translate to [300, 0, 300]" this node is a renamed "Subtract vector".
Input2 of this node is fed from the output from a scalar node, TG2 expects a vector so change this to a vector [300, 300, 300]
and subtracts this from the current point from "Get pos..". UPS this is a serious error, scalar 300 should have been a vector [300, 0, 300].
In the following suppose that the output from "Get pos" is [400, 0, 400]. This notation means x=400, y=0, z=400
The output of the "translate to.." is thus [100, -300, 100]
This is then divided by 500 to give valuse so the 500m is One unit of 1/2 km. the result is [0.2, -0.6, 0.2]
This is fed into a "Clamp 01 scalar" meaning that [0.2, -0.6, 0.2] is typecasted to a scalar Length([0.2, -0.6, 0.2]) = 0.663325
This is positive and less than 1, so it passes unchanged. What happens (if I had programmed correct) is that points inside
the distance of 500 m from [300, 0, 300] is converted to a value between 0 and 1 and all distances greater than 500 is converted to 1.
This value (d) is the complemented (1 - d) by "Complement scalar 01" giving values that decreases from 1 in distance 0 to zero for distances g 500reater than 500.
Thus describing a cone with the height of 1 m and a radius of 500 m.
this is then multiplied by 10. Cone with height 10 and radius 500.
The top 9 m is the removed by the "Clamp 01 scalar 02"
The result is then multiplied by 500 to give a reasonably displacement
This finally fed into to function input of a "Dispacement" node.
It is strange that I after 48 years of programming still makes errors