Skip site navigation (1)Skip section navigation (2)

  
 
  

home | help
vpShadeTable(3) 	    Library Functions Manual		 vpShadeTable(3)

NAME
     vpShadeTable - compute the contents of the shading lookup table

SYNOPSIS
     #include <volpack.h>

     vpResult
     vpShadeTable(vpc)
	 vpContext *vpc;

ARGUMENTS
     vpc    VolPack context from vpCreateContext.

DESCRIPTION
     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 vpSetMa-
     terial), and viewing parameters (as specified with the view  transformation
     commands).   See vpSetMaterial(3) for a description of the shading calcula-
     tion.

     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 ta-
     bles 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  de-
     fault,  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 im-
     age may be very dark.  To brighten it, multiply all of the material parame-
     ter coefficients by a constant, possibly making the values exceed 1.0,  and
     turn off clamping.

ERRORS
     The  normal  return  value is VP_OK.  The following error return values are
     possible:

     VPERROR_SINGULAR
	    One of the current view transformation matrices is singular.

     VPERROR_BAD_SHADER
	    The shading lookup tables are sized incorrectly, or one of the voxel
	    fields used to index the tables is invalid, or the number of  mater-
	    ial types is invalid.

     VPERROR_BAD_SHADOW
	    The  angle between the shadow light vector and the viewing direction
	    is too large (must be less than  45  degrees).   Either  change  the
	    light direction or disable shadows (see vpSetShadowLookupShader).

SEE ALSO
     VolPack(3),  vpCreateContext(3),  vpCurrentMatrix(3), vpSetLookupShader(3),
     vpSetLight(3), vpSetMaterial(3)

VolPack 							 vpShadeTable(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=volpack-ShadeTable&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help