GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
vpShadeTable(3) FreeBSD Library Functions Manual vpShadeTable(3)

vpShadeTable - compute the contents of the shading lookup table

#include <volpack.h>
vpResult
vpShadeTable(vpc)
vpContext *vpc;

vpc
VolPack context from vpCreateContext.

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:
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 material 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).

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

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.