G3dShade.mesa
Copyright Ó 1985, 1989, 1992 by Xerox Corporation. All rights reserved.
Bloomenthal, July 15, 1992 10:42 pm PDT
Crow, May 16, 1989 2:59:13 pm PDT
DIRECTORY G3dBasic, G3dLight, G3dRender, G3dShape;
G3dShade: CEDAR DEFINITIONS
~ BEGIN
Types
Triple:     TYPE ~ G3dBasic.Triple;
Light:      TYPE ~ G3dLight.Light;
LightSequence:   TYPE ~ G3dLight.LightSequence;
RGB:      TYPE ~ G3dRender.RGB;
Shape:     TYPE ~ G3dShape.Shape;
Ambient Light
Ambient: PROC [normal: Triple, data: REF ¬ NIL] RETURNS [ambient: RGB];
Return the ambient light given the surface normal. Who knows what data means?
Shading
TotalSurfaceIntensity: PROC [
normal, eyeView: Triple, lights: LightSequence, portionSpecular: REAL]
RETURNS [REAL];
Compute the surface intensity (summed over all the lights) given the surface normal.
Does not test for the surface being in shadow.
SurfaceIntensity: PUBLIC PROC [light: Light, normal, eyeView: Triple, portionSpecular: REAL]
RETURNS [REAL];
Return the surface intensity.
SpecularIntensity: PROC [light: Light, normal, eyeView: Triple] RETURNS [REAL];
Compute the intensity of the specular component.
DiffuseIntensity: PROC [light: Light, normal: Triple] RETURNS [REAL];
Compute the intensity of the diffuse component.
END.