DIRECTORY G3dBasic, G3dLight, G3dRender, G3dShape; G3dShade: CEDAR DEFINITIONS ~ BEGIN 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; RegisterShadingClass: PROC [class: ShadingClass, type: ATOM]; GetShadingClass: PROC [type: ATOM] RETURNS [class: ShadingClass]; LoadShadingClass: PUBLIC PROC [shape: Shape, type: ATOM _ $Default]; Ambient: PROC [normal: Triple, data: REF _ NIL] RETURNS [ambient: RGB]; TotalSurfaceIntensity: PROC [ normal, eyeView: Triple, lights: LightSequence, portionSpecular: REAL] RETURNS [REAL]; SurfaceIntensity: PUBLIC PROC [light: Light, normal, eyeView: Triple, portionSpecular: REAL] RETURNS [REAL]; SpecularIntensity: PROC [light: Light, normal, eyeView: Triple] RETURNS [REAL]; DiffuseIntensity: PROC [light: Light, normal: Triple] RETURNS [REAL]; ShadeVtx: G3dRender.CtlPtInfoProc; NoShadeVtx: G3dRender.CtlPtInfoProc; END. ~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 Types Classes Registration Add class to list of registered ShadingClasses, for fancy texturing procs, etc. Retrieve registered class for use or modification. Put ShadingClass in shape record. Ambient Light Return the ambient light given the surface normal. Who knows what data means? Shading Compute the surface intensity (summed over all the lights) given the surface normal. Does not test for the surface being in shadow. Return the surface intensity. Compute the intensity of the specular component. Compute the intensity of the diffuse component. Vertex Shading Calculate shade at vertices of polygon. PROC [context: Context, vtx: VertexInfo, data: REF ANY _ NIL ] RETURNS[VertexInfo] Calculate shade at vertices of polygon. สZ˜™ J™BJšœ(™(Icodešœ!™!J˜Jšฯk œ)˜2J˜—šัblnœœ ˜Jšœ˜—headšฯl™Jšœœ œ˜Jšœ œ˜ Jšœ œ˜#Jšœœ˜"Jšœœ˜/Jšœœ ˜9Jšœœ˜0Jšœœ˜(Jšœ œ˜&Jšœœ˜/Jšœ œ˜!—šะbl™šฯnœœœ˜=J™P—šกœœœœ˜AJ™3—šกœœœœ ˜DJ™!——šŸ ™ š กœœœœœ œ˜GJ™N——šŸ™šกœœ˜JšœAœ˜FJšœœ˜J™TJ™.J˜—šกœœœ:œ˜\Jšœœ˜J™J˜—šกœœ(œœ˜OJ™0J˜—šกœœœœ˜EJ™/——š ™defaultšกœ˜"Ia™'M˜—šก œ˜$Mš œ+œœœœ ™RN™'——J˜šœ˜J˜—J˜J˜—…—๚ า