bumpmap VEX function

Bump maps will return the color gradient of the image in the du/dv parameters.

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

  1. void bumpmap(string filename, float du&, float dv&, vector uvw)

  2. void bumpmap(string filename, float du&, float dv&, float u, float v)

Bump maps will return the color gradient of the image in the du/dv parameters. There are 6 different forms of the bump map function differentiated by the trailing character of the function name. The functions will compute the gradient based on:

bumpmapR

Using the gradient in the red channel

bumpmapG

Using the gradient in the green channel

bumpmapB

Using the gradient in the blue channel

bumpmapA

Using the gradient in the alpha channel

bumpmapL

Using the gradient in the luminance channel

Bilinear interpolation is done on the raw pixel values. Though, there are versions of the above functions which do not use bilinear interpolation. These non-interpolating functions have their names prefixed with “raw”. For example:

rawbumpmapG(string filename; float &du, &dv; vector uvw);
The du/dv parameters will be in the range (-1, 1).