vpShadeTable(3) | Library Functions Manual | vpShadeTable(3) |
vpShadeTable - compute the contents of the shading lookup table
#include <volpack.h>
vpResult
vpShadeTable(vpc)
vpShadeTable computes the contents of the shading lookup table previously specified with vpLookupShader. For each entry in the table, the Phong shading equation is evaluated using the current lighting properties (as specified with vpSetLight), material properties (as specified with vpSetMaterial), and viewing parameters (as specified with the view transformation commands). See vpSetMaterial(3) for a description of the shading calculation.
This function should be called before rendering a volume if any of the lighting or material properties have changed or if the viewpoint has changed since the last call to vpShadeTable. It should not be called if shading is performed using a callback function or if the shading lookup tables are initialized by a user-defined routine.
There is one state variable that affects the operation of vpShadeTable. If VP_CLAMP_SHADE_TABLE is enabled (see vpEnable(3)), then values are clamped to the range 0.0-255.0 before they are stored in the table. If this option is not enabled then no clamping is performed. Clamping is enabled by default, but can be turned off to achieve special effects. For example, if all of the voxels in a data set have very low opacity then the rendered image may be very dark. To brighten it, multiply all of the material parameter coefficients by a constant, possibly making the values exceed 1.0, and turn off clamping.
The normal return value is VP_OK. The following error return values are possible:
VolPack(3), vpCreateContext(3), vpCurrentMatrix(3), vpSetLookupShader(3), vpSetLight(3), vpSetMaterial(3)
VolPack |