Jean-Luc Dery (dery++at++cae.ca)
Thu, 5 Oct 1995 16:06:03 -0400
This is a GL related question.
What I'm trying to do might seen weird to you, but it's what seems to be a
solution for the project I'm working on.
My problem comes from the fact that I want to copy the z buffer content into
the normal buffer using the rectcopy function.
I want to isolate 8 bits in the z buffer by setting the shift value of pixmode
and copy them to the alpha value of the normal buffer. I'm using a RGBwritemask
to protect the color values. It works pretty fine if I'm writing to one of the
RGB bits but I can't get it to write to the alpha bits. Since I know it's
possible to write the z buffer to the normal planes, this should be possible.
When I'm reading the zbuffer, the followings are set:
pfAntialias( PFAA_OFF ); is called before pfDraw();
pixmode( PM_SIZE, 32 );
pixmode( PM_INPUT_TYPE, PM_UNSIGNED_BYTE );
pixmode( PM_INPUT_FORMAT, PM_RGBA );
pixmode( PM_OUTPUT_TYPE, PM_UNSIGNED_BYTE );
pixmode( PM_OUTPUT_FORMAT, PM_RGBA );
pixmode( PM_SHIFT, 8 );
zbuffer( TRUE );
zdraw( FALSE );
readsource( SRC_ZBUFFER );
RGBWritemask( 0x00, 0x00, 0x00 );
rectcopy( ... );
RGBwritemask( 0xFF, 0xFF, 0xFF );
The results I get is like
RRGGBBAA ZBUF RRGGBBAA
0x------FF 0x------00 => 0x------FF
I think I remember seeing that the alpha is not activated when multisample is
disabled, ... but it has to be disabled in order to read the z buffer.
Help !!!
Thank in advance for any hints.
--
___________________________________________________________________
____ ___ __
Jean-Luc Dery / \ /_ /__) \__/
System engineer __/___/ /___ / \ /
CAE Electronics Ltd.
GRAPHICS SOFTWARE TECHNOLOGY Phone: (514)341-6780 x2275
e-mail: dery++at++cae.ca FAX: (514)340-5496
___________________________________________________________________
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:56 PDT