1vpShadeTable(3)            Library Functions Manual            vpShadeTable(3)
2
3
4

NAME

6       vpShadeTable - compute the contents of the shading lookup table
7

SYNOPSIS

9       #include <volpack.h>
10
11       vpResult
12       vpShadeTable(vpc)
13           vpContext *vpc;
14

ARGUMENTS

16       vpc    VolPack context from vpCreateContext.
17

DESCRIPTION

19       vpShadeTable  computes  the contents of the shading lookup table previ‐
20       ously specified with vpLookupShader.  For each entry in the table,  the
21       Phong  shading equation is evaluated using the current lighting proper‐
22       ties (as specified with vpSetLight), material properties (as  specified
23       with vpSetMaterial), and viewing parameters (as specified with the view
24       transformation commands).  See vpSetMaterial(3) for  a  description  of
25       the shading calculation.
26
27       This  function should be called before rendering a volume if any of the
28       lighting or material properties have changed or if  the  viewpoint  has
29       changed  since  the last call to vpShadeTable.  It should not be called
30       if shading is performed using a callback function  or  if  the  shading
31       lookup tables are initialized by a user-defined routine.
32
33       There is one state variable that affects the operation of vpShadeTable.
34       If VP_CLAMP_SHADE_TABLE is enabled (see vpEnable(3)), then  values  are
35       clamped to the range 0.0-255.0 before they are stored in the table.  If
36       this option is not enabled then no clamping is performed.  Clamping  is
37       enabled  by  default, but can be turned off to achieve special effects.
38       For example, if all of the voxels in a data set have very  low  opacity
39       then the rendered image may be very dark.  To brighten it, multiply all
40       of the material parameter coefficients by a constant,  possibly  making
41       the values exceed 1.0, and turn off clamping.
42

ERRORS

44       The  normal  return  value is VP_OK.  The following error return values
45       are possible:
46
47       VPERROR_SINGULAR
48              One of the current view transformation matrices is singular.
49
50       VPERROR_BAD_SHADER
51              The shading lookup tables are sized incorrectly, or one  of  the
52              voxel  fields used to index the tables is invalid, or the number
53              of material types is invalid.
54
55       VPERROR_BAD_SHADOW
56              The angle between the shadow light vector and the viewing direc‐
57              tion is too large (must be less than 45 degrees).  Either change
58              the light direction or disable shadows  (see  vpSetShadowLookup‐
59              Shader).
60

SEE ALSO

62       VolPack(3),    vpCreateContext(3),   vpCurrentMatrix(3),   vpSetLookup‐
63       Shader(3), vpSetLight(3), vpSetMaterial(3)
64
65
66
67VolPack                                                        vpShadeTable(3)
Impressum