home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sys.sgi.bugs:87 comp.sys.sgi.graphics:104
- Newsgroups: comp.sys.sgi.bugs,comp.sys.sgi.graphics
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!rpi!think.com!ames!eos!aio!norm!goza
- From: goza@norm.JSC.NASA.GOV (Mike Goza)
- Subject: Potential bug in dither() on PIs
- Message-ID: <1993Jan7.140545.22218@aio.jsc.nasa.gov>
- Sender: goza@norm (Mike Goza)
- Organization: IGOAL
- Date: Thu, 7 Jan 1993 14:05:45 GMT
- Lines: 51
-
- I recently posted in comp.sys.sgi.graphics a question concerning
- dithering on PIs. I wished to turn it off. I received some
- replies which suggested using dither(DT_OFF). This had no effect
- on the PI. The PI still did some form of dithering. I have found
- a solution though. The following snippet of code will produce the
- solid color polygon without dithering.
-
- unsigned long colid;
- int MLV_colorHL_id;
- shademodel(FLAT);
- MLV_colorHL_id = 10; /* range of numbers 0<colid<4096 */
- colid = (( (MLV_colorHL_id & 0xF00)<<12 ) |
- ( (MLV_colorHL_id & 0x0F0)<< 8 ) |
- ( (MLV_colorHL_id & 0x00F)<< 4 );
- cpack(colid);
- bgnpolygon();
- v3f(pnt1);
- v3f(pnt2);
- ...
- endpolygon();
-
-
- The following code DID NOT work properly. Dithering still took place...
-
- unsigned long colid;
- shademodel(GOURAUD);
- dither(DT_OFF);
- colid = 10; /* range of numbers 0<colid<4096 */
- cpack(colid);
- bgnpolygon();
- v3f(pnt1);
- v3f(pnt2);
- ...
- endpolygon();
-
-
- Turning shademodel(FLAT) automatically turns off dithering and packing
- the higher order bits of the color id took care of the colors not changing
- like I though they would. It seems that cpack only looks at the higher order
- bits when it has less than 24 bit planes. A nuisance, but something I can
- work around. The dither(DT_OFF) code should have worked just the same as
- the shademodel(FLAT) code except for maybe incorrect colors, but it didn't.
- It just kept on dithering. Any clues anyone?
-
- If it is truely a bug, then I will report it. If it is my fault, I would
- like to know what I did wrong.
-
- Thanks,
- Mike Goza
- goza@cheers.jsc.nasa.gov
-
-