From: Sylvain Faisan (sylvain.faisan++at++imag.fr)
Date: 04/27/2001 05:05:15
Hi,
I want to blend a transparent texture with the background. I use so
this part of code :
gstateTexture->setMode(PFSTATE_TRANSPARENCY,
PFTR_BLEND_ALPHA|PFTR_NO_OCCLUDE);
It s working very well. But for many reasons, i don't want to use the
PFTR_NO_OCCLUDE option.
In my scene, I have only one object which is transparent (it's the
texture) and it s on the foreground of the scene.
So the solution is to sort the scene (from back to front). I use so this
part of code :
chan->setTravMode(PFTRAV_CULL , PFCULL_VIEW | PFCULL_SORT) ;
chan->setBinSort(PFSORT_OPAQUE_BIN, PFSORT_BACK_TO_FRONT, NULL) ;
chan->setBinSort(PFSORT_TRANSP_BIN, PFSORT_BACK_TO_FRONT, NULL) ;
//Without the PFTR_NO_OCCLUDE option.
gstateTexture->setMode(PFSTATE_TRANSPARENCY, PFTR_BLEND_ALPHA) ;
As i sort the scene, i have no draw callbacks for the channel but only a
pre and post draw callback for the pfDCS
which contains the texture (in order to load it).
The problem is that the blending doesn't work anymore!
If anyone has an idea, i will be very happy. Must i use pfDrawBin but
where ?
Thanks by advance.
Faisan Sylvain
This archive was generated by hypermail 2b29 : Fri Apr 27 2001 - 05:05:25 PDT