(none)

Gary Tarolli tarolli at dragon.SGI.COM
Tue Feb 7 01:26:40 AEST 1989


In article <27497 at bu-cs.BU.EDU>, tjh at 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 at dolphin.bu.edu

there is currently 2 wasy to do this , performance being the difference.
The basic idiea is that you must change the material for every polygon.
There are 2 wasy to do this, you can define many materials and then
switch materials using lmbind (which is fairly fast for a small set of 
materials - but it uses a hash table lookup so for many many materials
it may be slower) , or 2) you can change the current material using
lmdef for each polygon.

In a future release a new command will be added to exactly solve this
problem.  It will allow you to very quickly change one of the color
properties of the current material (eg. AMBIENT, DIFFUSE, SPECULAR)
without really changing the material, ie it changes only a working copy
of the material).  The new command is lmcolor and you can expect it
in the 3.2 release.  So in the meantime, just use one of the other methods.
They are slower, but not that slow.



More information about the Comp.sys.sgi mailing list