RE: Poor Alpha Blending

New Message Reply Date view Thread view Subject view Author view

From: Colin Middleton (colin++at++sgi.com)
Date: 05/30/2001 05:49:45


This is an artefact of multisample transparency. This is the fastest way of
doing transparency on InfiniteReality and Reality graphics. It uses the
multisamples that are used by the anti-aliasing to generate a partially
transparent pixel. The advantage is that it means that no depth sorting
needs to be done but at the expense of transparency levels. With a 8 sample
visual you will get 7 levels of transparency ( + totally opaque and totally
transparent ). This is why you get the banding.

However you can stop this behaviour by changing the value of the
pfTransparency to PFTR_HIGH_QUALITY or PFTR_BLEND_ALPHA . ( The default is
PFTR_FAST ) . You can apply this globally by using this :-

pfTransparency ( PFTR_HIGH_QUALITY ) ;
pfOverride ( PFSTATE_TRANSPARENCY , PF_ON ) ;

A better solution is to actually change your Geostates for the objects that
look bad. Assuming the geostate is called gs :-

gs->setMode ( PFSTATE_TRANSPARENCY , PFTR_HIGH_QUALITY ) ;

However if you are loading geometry with the loaders ( as most pfusers do )
this will mean you have to traverse the tree and apply this to all the
appropriate geosets.

Colin Middleton

> -----Original Message-----
> From: Uwe Woessner COVISE Development [mailto:uw_te++at++blubber.de]
> Sent: 30 May 2001 13:20
> To: Hui Li
> Cc: info-performer++at++sgi.com
> Subject: Re: Poor Alpha Blending
>
>
> Hi Hui,
>
>
> > I have Onyx2 Reality workstation, when rendering a face
> with alpha texture to
> > simulate a shade, I find that at the place where alpha
> number gradually transfer
> > from 255 to 0, I got a stair like result, not smooth at
> all. it seems that
> > the alpha value have very limited choice, are there any
> configuration in performer
> > to correct this?
>
> I have the same problem on my Onyx2 IR2: here is the code
> that generates
> the texture
>
>
> // create texture object
> tex = new pfTexture;
> tex->setFilter(PFTEX_MINFILTER, PFTEX_POINT);
> tex->setFilter(PFTEX_MAGFILTER, PFTEX_POINT);
> tex->setRepeat(PFTEX_WRAP,PFTEX_CLAMP);
>
>
> tex->setFormat(PFTEX_EXTERNAL_FORMAT,PFTEX_PACK_8);
> tex->setFormat(PFTEX_IMAGE_FORMAT,PFTEX_RGBA);
> //tex->setFormat(PFTEX_INTERNAL_FORMAT,PFTEX_RGBA_8);
> tex->setFormat(PFTEX_INTERNAL_FORMAT,GL_RGBA);
> textureData= (unsigned char*) new(2*4*256) pfMemory;
> myTransFunc->makeColorBar(256, textureData);
> tex->setImage((uint*) textureData, 4, 256, 2, 1);
>
>
> This is the visual that I am using:
> 0x6f, RGBA 12/12/12/12, db, stereo, Z 23, S 1, samples 4
> What I get is smooth color shades, but 6 steps in the alpha blended
> region of the texture.
>
> It has to be somehow related to antialiasing, as if I turn of
> antialiasing, it looks correct.
> Can anybody explain why this is happening or what I am doing wrong?
>
> Regards,
> Uwe
> --------------------------------------------------------------
> ---------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>

___________________________________________
Colin Middleton,
SGI Professional Services,
email: colin++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed May 30 2001 - 05:50:00 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.