Angus Dorbie (dorbie++at++bitch.reading.sgi.com)
Thu, 5 Oct 1995 21:54:38 +0100
o also from the manual:
The result of rectcopy is undefined if zbuffer is TRUE, except when pixel
mode PM_ZDATA is enabled (see pixmode). This special pixel mode, in
conjunction with stencil operation, can be used to implement rectangle
copies with depth buffering.
o It's prefferable to use ABGR, it's much faster on RE.
o The manual also says that positive shifts are to the left for copy, this
suggests that your 8 bit shift to the left is leaving your low
order bits (and that's alpha in PM_RGBA) empty.
Hope this helps.
Angus.
On Oct 5, 4:06pm, Jean-Luc Dery wrote:
> Subject: zbuf read
> Hi,
>
> 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
> ___________________________________________________________________
>
>
>-- End of excerpt from Jean-Luc Dery
-- Angus Dorbie, Silicon Graphics Ltd, UK dorbie++at++reading.sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:56 PDT