G3dShade.mesa
Copyright Ó 1985, 1989 by Xerox Corporation. All rights reserved.
Bloomenthal, May 17, 1989 6:47:24 pm PDT
Crow, May 16, 1989 2:59:13 pm PDT
DIRECTORY G3dBasic, G3dLight, G3dRender, G3dShape;
G3dShade: CEDAR DEFINITIONS
~ BEGIN
Types
RGB:      TYPE ~ G3dRender.RGB;
Pair:      TYPE ~ G3dBasic.Pair;
Triple:     TYPE ~ G3dBasic.Triple;
Light:      TYPE ~ G3dLight.Light;
LightSequence:   TYPE ~ G3dLight.LightSequence;
CtlPtToRealSeqProc:  TYPE ~ G3dRender.CtlPtToRealSeqProc;
CtlPtInfoProc:   TYPE ~ G3dRender.CtlPtInfoProc;
SpotProc:     TYPE ~ G3dRender.SpotProc;
Context:     TYPE ~ G3dRender.Context;
ShadingClass:   TYPE ~ G3dRender.ShadingClass;
Shape:     TYPE ~ G3dShape.Shape;
Classes Registration
RegisterShadingClass: PROC [class: ShadingClass, type: ATOM];
Add class to list of registered ShadingClasses, for fancy texturing procs, etc.
GetShadingClass: PROC [type: ATOM] RETURNS [class: ShadingClass];
Retrieve registered class for use or modification.
LoadShadingClass: PUBLIC PROC [shape: Shape, type: ATOM ← $Default];
Put ShadingClass in shape record.
Ambient Light
Ambient: PROC [normal: Triple, data: REFNIL] 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.
Vertex Shading
ShadeVtx: G3dRender.CtlPtInfoProc;
Calculate shade at vertices of polygon.
NoShadeVtx: G3dRender.CtlPtInfoProc;
PROC [context: Context, vtx: VertexInfo, data: REF ANYNIL ] RETURNS[VertexInfo]
Calculate shade at vertices of polygon.
END.