home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / sgi / bugs / 87 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  2.0 KB

  1. Xref: sparky comp.sys.sgi.bugs:87 comp.sys.sgi.graphics:104
  2. Newsgroups: comp.sys.sgi.bugs,comp.sys.sgi.graphics
  3. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!rpi!think.com!ames!eos!aio!norm!goza
  4. From: goza@norm.JSC.NASA.GOV (Mike Goza)
  5. Subject: Potential bug in dither() on PIs
  6. Message-ID: <1993Jan7.140545.22218@aio.jsc.nasa.gov>
  7. Sender: goza@norm (Mike Goza)
  8. Organization: IGOAL
  9. Date: Thu, 7 Jan 1993 14:05:45 GMT
  10. Lines: 51
  11.  
  12. I recently posted in comp.sys.sgi.graphics a question concerning 
  13. dithering on PIs.  I wished to turn it off.  I received some 
  14. replies which suggested using dither(DT_OFF).  This had no effect
  15. on the PI.  The PI still did some form of dithering.  I have found
  16. a solution though.  The following snippet of code will produce the
  17. solid color polygon without dithering.
  18.  
  19. unsigned long colid;
  20. int MLV_colorHL_id;
  21. shademodel(FLAT);
  22. MLV_colorHL_id = 10;   /*  range of numbers 0<colid<4096  */
  23. colid = (( (MLV_colorHL_id & 0xF00)<<12 ) |
  24.          ( (MLV_colorHL_id & 0x0F0)<< 8 ) |
  25.          ( (MLV_colorHL_id & 0x00F)<< 4 );
  26. cpack(colid);
  27. bgnpolygon();
  28. v3f(pnt1);
  29. v3f(pnt2);
  30. ...
  31. endpolygon();
  32.  
  33.  
  34. The following code DID NOT work properly.  Dithering still took place...
  35.  
  36. unsigned long colid;
  37. shademodel(GOURAUD);
  38. dither(DT_OFF);
  39. colid = 10;     /*  range of numbers 0<colid<4096  */
  40. cpack(colid);
  41. bgnpolygon();
  42. v3f(pnt1);
  43. v3f(pnt2);
  44. ...
  45. endpolygon();
  46.  
  47.  
  48. Turning shademodel(FLAT) automatically turns off dithering and packing 
  49. the higher order bits of the color id took care of the colors not changing
  50. like I though they would.  It seems that cpack only looks at the higher order 
  51. bits when it has less than 24 bit planes.  A nuisance, but something I can
  52. work around.  The dither(DT_OFF) code should have worked just the same as
  53. the shademodel(FLAT) code except for maybe incorrect colors, but it didn't.
  54. It just kept on dithering.  Any clues anyone?
  55.  
  56. If it is truely a bug, then I will report it.  If it is my fault, I would
  57. like to know what I did wrong.
  58.  
  59. Thanks,
  60. Mike Goza
  61. goza@cheers.jsc.nasa.gov
  62.  
  63.