Calculates the gradient a specific volume primitive. The gradient is a
vector pointing in the direction of increasing volume values. Returns 0
primnum is out of range, the
filename is invalid, or the given
primitive is not a volume primitive.
The length is calculated by measuring the slope of increasing values. For example, if temperature rises faster over a shorter distance, it will create a bigger gradient. If temperature is a height field, then gradient length is how steep the hill is.
If you create an SDF of an object, the gradient VOP will show the direction to the surface from any point inside the SDF.
For example, create a sphere and a point (with the help of the Add SOP). Connect the sphere to the IsoOffset SOP and change it to SDF. Next, connect the point and IsoOffset to the VOP SOP. In the VOP SOP, connect
P in Globals to the
N output using the Volume Gradient. In the viewport, the point normals will show you the direction. For it to work, the point must be located within the limits of the SDF field. Because the output yields the normalized data, it shows only the direction.