Article View: comp.sys.sgi.bugs
Article #64Potential bug in dither() on PIs
From: Mike Goza
Date: Thu, 07 Jan 1993 14:05
Date: Thu, 07 Jan 1993 14:05
50 lines
2022 bytes
2022 bytes
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
Technical Details
Message-ID:
<1993Jan7.140545.22218@aio.jsc.nasa.gov>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!usc!rpi!think.com!ames!eos!aio!norm!gozaShow Full Headers
Complete Article Headers
Newsgroups: comp.sys.sgi.bugs,comp.sys.sgi.graphics Path: arc1-ca.pugleaf.net!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