gradient3d VEX function

Returns the gradient of a single channel texture image at the position specified by P.

Contexts: image3d, chop, cop, pop, sop, surface, displace, fog, light, shadow, photon, cvex

  1. vector gradient3d(string filename, string channel, vector P)

Returns the gradient of a single channel texture image at the position specified by P. If P is outside of the bounding box of the image, the value returned will be 0. If the channel specified contains more values than the return type (i.e. a vector channel when a float return type is desired), the gradient of the first component of the vector will be returned.

You can pass additional arguments to control the evaluation (see colormap):

Keyword Value

filter

Specifies the filter for evaluation.

width

Specifies the filter width for evaluation.