DIRECTORY ImagerSample USING [RasterSampleMap], Rope USING [ ROPE ], G3dRender, ThreeDBasics USING [ Context, ContextProc, ImagerProc, Pair, PairSequence, Patch, PatchProc, Pixel, Quad, RealSequence, RGB, ShadingClass, SpotProc, Triple, VertexInfo ]; RenderWithPixels: CEDAR DEFINITIONS ~ BEGIN ROPE: TYPE ~ Rope.ROPE; Context: TYPE ~ G3dRender.Context; ContextProc: TYPE ~ ThreeDBasics.ContextProc; ShadingClass: TYPE ~ ThreeDBasics.ShadingClass; VertexInfo: TYPE ~ ThreeDBasics.VertexInfo; Patch: TYPE ~ ThreeDBasics.Patch; PatchProc: TYPE ~ ThreeDBasics.PatchProc; Triple: TYPE ~ ThreeDBasics.Triple; Quad: TYPE ~ ThreeDBasics.Quad; RGB: TYPE ~ ThreeDBasics.RGB; Pair: TYPE ~ ThreeDBasics.Pair; PairSequence: TYPE ~ ThreeDBasics.PairSequence; RealSequence: TYPE ~ ThreeDBasics.RealSequence; RasterSampleMapArray: TYPE ~ ARRAY [0..5) OF ImagerSample.RasterSampleMap; Pixel: TYPE ~ ThreeDBasics.Pixel; RopeDesc: TYPE ~ RECORD[rope: ROPE, position: Pair, color: Pixel, size: REAL, font: ROPE]; LerpVtx: TYPE = RECORD [ x, y: REAL, val: REF ThreeDBasics.RealSequence ]; LerpVtxSequence: TYPE ~ RECORD [ length: NAT, s: SEQUENCE maxLength: NAT OF REF LerpVtx ]; FancyPatch: TYPE = RECORD [ recurseLevel: NAT _ 0, shadingClass: REF ShadingClass, -- procs for texturing, etc. vtx: SEQUENCE length: NAT OF LerpVtx ]; AllocatePixelMemory: ContextProc; GetContext: PROC [type: ATOM, width, height: NAT] RETURNS[ctx: REF Context]; DepthBuffering: PROC[ context: Context, on: BOOLEAN _ TRUE ]; AntiAliasing: PROC[ context: Context, on: BOOLEAN _ TRUE ]; NormalBuffering: PROC[ context: Context, on: BOOLEAN _ TRUE ]; FillInBackGround: ContextProc; FillInConstantBackGround: PROC[context: Context, bkgrdClr: RGB, cvrge: BYTE _ 255]; BufferRendering: PROC[ context: Context, on: BOOLEAN _ TRUE ]; MakeFrame: ContextProc; ShadeSpot: ThreeDBasics.SpotProc; Draw2DLine: PROC[context: Context, p1, p2: Pair, color: Pixel]; Draw2DPoly: PROC[context: Context, poly: REF PairSequence, color: Pixel]; DrawRope: PROC[context: Context, rope: Rope.ROPE, position: Pair, color: Pixel _ [255,255,128,0,0] , size: REAL _ 20, font: Rope.ROPE _ NIL]; DoRope: ThreeDBasics.ImagerProc; PolygonTiler: PatchProc; FancyTiler: PROC[context: REF ThreeDBasics.Context, poly: REF Patch]; RealFancyTiler: PROC[context: REF ThreeDBasics.Context, poly: REF FancyPatch]; END. RenderWithPixels.mesa Copyright c 1984 by Xerox Corporation. All rights reserved. Last Edited by: Crow, March 14, 1989 3:58:12 pm PST Glassner, March 14, 1989 2:18:44 pm PST Types Initializing and Updating Pixel Maps Get pixel memory for things like rgb, alpha, depth, normal coding. gets a bare context for making images independent of color display Sets up or destroys depth buffer in VM for context.pixels Sets up or destroys alpha buffer in VM for context.pixels (used for antialiasing) Sets up or destroys normal vector buffer in VM for context.pixels (used for Andrew's hacks) Loads background behind current image Clears frame, use with alpha buffer to load background color behind shapes Frame Generation Renders through buffer and blits to screen when on, directly to screen (slowly) when off Makes image, clears frame, adds background, etc. Low-level drawing Send spot values through the vertex shading procedure Draw a line with integer endpoints Draw polygon avoiding floating point Put a rope in the pixels, somehow Put a rope in the pixels, using calls on the imager, rope is passed as RopeDesc in data Simple Polygon Tilers Call point for discriminating among tilers Fancy Polygon Tilers for Anti-aliasing, texture, etc. recursive implementor of tiler Κ˜Iheadšœ™šœ Οmœ1™Ošœ,žœ.™\—š‘œ˜Jš &™&—š‘œžœžœ žœ˜SJšœJ ™K—J™—šŸ™š‘œžœžœžœ˜>JšœY™Y—š‘ œ˜Jš 0™0——šŸ™š‘ œ˜!J™5—J˜š‘ œžœ/˜?J™#—š‘ œžœžœ‘˜IJ™%—š ‘œžœžœEžœžœžœ˜—J™"—š‘œ˜ PšœW™W—J™—š‘Ÿ™š‘ œ ˜J™*——š‘ Ÿ™Jš‘œ ™!š‘ œžœ žœžœ˜EJ™—Jš‘œžœ žœžœ˜OJ˜—Jšžœ˜—…— Ld