Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!apple!voder!pyramid!prls!philabs!micomvax!ncc!alberta!calgary!cpsc!paquette From: paquette@cpsc.ucalgary.ca (Trevor Paquette) Newsgroups: comp.sys.sgi Subject: Re: (none) Keywords: SGI Message-ID: <603@cs-spool.calgary.UUCP> Date: 27 Jan 89 00:54:59 GMT References: <27497@bu-cs.BU.EDU> Sender: news@calgary.UUCP Lines: 42 In article <27497@bu-cs.BU.EDU>, tjh@bu-cs.BU.EDU (Tim Hall) writes: > We recently got a (Demo model) Personal Iris 4D that has a 32 bit frame > buffer and a Z-buffer. I would like to create a 3-D surface mesh that > has a different color at each vertex and is shaded by some lighting model > I've defined using lmdef. > > I've been able to get my colored surface using the bgntmesh, v, cpack and > endtmesh commands but it is not shaded by my defined lighting model. If > I bind a material when rendering the surface it renders as that material > (Not multi-colored) but it is shaded by my bound lighting model. > > So is it the case that interpolation of color and shading are mutually > exclusive? > > Thanks > Tim Hall > Please reply to > tjh@dolphin.bu.edu You got it.. I had the same problem as well. I was working on a renderer using the 4D/20 hardware z buffer.. I got it all going great using the colors stored at each vertex of a polygon.. but without a lighting model you basically get pictures in which you cannot tell depth.. So I threw in the default lighting model.. everything turned white,, but it was all shaded. You must come up with a different material defination for each polygon. However you can only define one material and change it on the fly for each polygon as well (don't forget to redefine and rebind (lmdef, lmbind). Because of this there is now no such thing a 'colorful polygons' where each polygon has a different color at each vertex.. I just average the colors of all and use the resulting color. Hint.. if your polygons have rgb values you must have some way to define a material using those values.. set the diffuse rgb of the material to the rgb of the polygon (make sure each rgb is between 0.0 and 1.0). Question.. does anyone know af a hardware routine that given a polygon will tell you if it is backfacing or not? I could write a routine for it, but hardware is sooo much faster. ============================================================================== Trevor Paquette/GraphicsLand, Calgary, Alberta UUCP: uunet!{ubc-cs,utai,alberta}!calgary!paquette ICBM:51 03 N/114 05 W Luminous beings we are, not this crude matter