[comp.graphics] Displaying RGB's to screen

pcb@gator.cacs.usl.edu (Peter C. Bahrs) (02/21/90)

I am working on this distributed ray tracer.  It works fine.  But
I have a little problem: Displaying the results.  The output is
rgb values 0-255 (thought of a % of 255).  I have a VGA that
can display 256 or 16 simultaneous colors.  I am sure this has been
discussed numerous times but what is the most straightforward way of
mapping %'s to colortable to pallete?


/*------------Thanks in advance...---------------------------------------+
| Peter C. Bahrs                                                         |
| The USL-NASA Project                                                   |
| Center For Advanced Computer Studies   INET  pcb@gator.cacs.sl.edu     |
| University of Southwestern Louisiana   ...!uunet!dalsqnt!gator!pcb     |
| Lafayette, LA 70504                                                    |
+-----------------------------------------------------------------------*/

cs225jt@ux1.cso.uiuc.edu (02/21/90)

You don't say what language you are working in. Most C & pascal versions
have a remappalette command or the like, because they keep a table of the
current on-screen colors in memory.  If it's assembly (likely for a ray-tracer)
then I don't really know, but I believe the VGA card has a register of color
indexes on-board.  Check you board docs.

-Chris Wilson