Color Map

Kurt Akeley kurt at cashew.asd.sgi.com
Tue Apr 16 00:44:59 AEST 1991


In article <4206 at dciem.dciem.dnd.ca>, tans at dretor.dciem.dnd.ca (Sovannary Tan) writes:

|> 	I am a new user of the Silicon Graphics Inc.'s IRIS-4D Series
|> workstation.  I am now having a problem in my program which displays two 
|> objects with different color maps on the screen.  The two objects 
|> have to be in the same viewport.  I use the command 'setmap' before I draw
|> each of the objects.  However, probably because setmap is only available
|> in immediate mode,  the whole picture changes to the colour map that
|> has been set by the most recent 'setmap' command.

Since color maps modify pixel colors as the pixels are displayed, rather than
as they are drawn, they are associated with windows, not with geometry.  Hence
you will not be able to display two objects in the same window with different
color maps.  You can, however, partition a single color map into multiple
submaps, and assign submaps to individual objects in a scene.  This partitioning
can allocate an arbitrary number of entries to each object, so long as the
maximum number of entries available on the system is not exceeded.  (Most IRIS-4D
products support 4096 entries (12-bit map).  Some Personal Iris models support
only 256 entries in single-buffer mode, and only 16 entries in double-buffer
mode.)  For example, you could use indexes 256 through 511 of the 4096 entry
color map for one object, and indexes 512 through 767 for another.

The multi-map facility partitions the 12-bit color map into 16 8-bit color maps,
any *one* of which can be attached to a window at a time.  Thus windows can each
select a single map at a time, and a single window can sequence through different
maps over time, but no window can use more than one map at a time.

-- kurt



More information about the Comp.sys.sgi mailing list