Thread View: comp.sys.sgi.bugs
1 messages
1 total messages
Started by Mike Goza
Thu, 07 Jan 1993 14:05
Potential bug in dither() on PIs
Author: 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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads