Professional Documents
Culture Documents
127x Materials Node Setup Builder domlyszBlenderGIS Wiki GitHub
127x Materials Node Setup Builder domlyszBlenderGIS Wiki GitHub
127x Materials Node Setup Builder domlyszBlenderGIS Wiki GitHub
This tool build material nodes setup for Cycles designed to help analysis hieght, slope and aspect of a
tarrain with color gradient.
Height map
This node setup is specific to the object on which the material is applied because it depends on the
bounding box of the object and currently there is no node to get bounding box attribute of an object. So,
the script add 2 Value nodes for specify zmin and zmax properties.
To get Z values of the mesh we use the Position attribute of the Geometry node, witch provide object
coordinates in world space. Separate XYZ node is used to extract Z component of the vector.
These values must be normalize between 0 and 1 before connecting the color ramp node. A node group
is used to normalize Z coordinates with the standard formula:
Slope map
Slope is the angle between face normal vector and Z axis vector. From linear algebra we know that the
dot product of 2 vectors equals to cos(alpha) where alpha is the angle between these vectors.
Slope = arccos(N.Z)
Computing the dot product between normal and z axis is equivalent to extract Z component of the
normal vector
N.Z = (x,y,z).(0,0,1) = Z
Geometry node provides normal vector in world space and Separate XYZ node is used to extract Z
component of the vector. Then we compute arc-cosine and convert radians to degrees by multiplying by
180/pi.
Angles must be normalized to get values range from 0 to 1 before connecting color ramp node. The
values returning by arc-cosine are range from 0 to 180°, but the slope of a terrain will never exceeds 90°
(vertical cliff). So it's more convenient to normalize values by 100° because in this case we can easily link a
slope value to it's color ramp position, for example a position of 0.5 in the color ramp node corresponds
to a slope of 50°.
Aspect map
Computing azimuth can be summarized to a 2D problem by taking face normal vector and project it on
XY plane.
aspect = atan(x/y)
Geometry node provides normal vector in world space and projection is obtained by setting Z component
to zero. Then we compute arc-tangent and convert radians to degrees by multiplying by 180/pi.
Azimuth angle must be corrected according to the quadrant where the tangent is computed. This
correction can be obtained by following 2 simples rules :
Finally angle must be normalized by 360° to get values range from 0 to 1 before connecting color ramp
node.
Also, flat angle is a special case that must be considered separately. Here we use a mix shader to define a
specific color to flat area.
Overlay
You can use mixRGB node to overlay aerial photography or topographic map to one of these analysis.