DrawBin, still a problem

New Message Reply Date view Thread view Subject view Author view

Klaus Otto (kotto++at++cae-gmbh.de)
Sat, 22 Nov 1997 15:40:31 +0100


Hi,

First, thanks to all who anwered my last mail.

But...this light and binning thing slowly drives me crazy.
I still get nothing displayed without calling pfDraw.

What is it that pfDraw does more than pfDrawBin(1)..(2)..(3).
It must be something terribly obvious (it's not gflush et.al.).

After I applied the bin markers to all the GSets I checked in a
separate traversal that they were correct. I also checked for
GeoStates not to be used in more than 1 bin.

So, here is what I do at the moment:
At init:
       static int binsort[] = {PFSORT_STATE_BGN, PFSTATE_LIGHTS,
                             PFSTATE_TEXTURE, PFSTATE_FRONTMTL,
                             PFSORT_STATE_END, PFSORT_END};
       pfChanBinOrder(chan, DRAW_BIN_GLOBAL_OPAQUE, DRAW_BIN_GLOBAL_OPAQUE);
       pfChanBinOrder(chan, DRAW_BIN_GLOBAL_TRANSP, DRAW_BIN_GLOBAL_TRANSP);
       pfChanBinOrder(chan, DRAW_BIN_LOCAL_OPAQUE, DRAW_BIN_LOCAL_OPAQUE);
       pfChanBinOrder(chan, DRAW_BIN_LOCAL_TRANSP, DRAW_BIN_LOCAL_TRANSP);

       pfChanBinSort(chan, DRAW_BIN_GLOBAL_OPAQUE, PFSORT_BY_STATE, binsort);
       pfChanBinSort(chan, DRAW_BIN_LOCAL_OPAQUE, PFSORT_BY_STATE, binsort);
       pfChanBinSort(chan, DRAW_BIN_GLOBAL_TRANSP, PFSORT_BY_STATE, binsort);
       pfChanBinSort(chan, DRAW_BIN_LOCAL_TRANSP, PFSORT_BY_STATE, binsort);

In a scene trav:
       if ((pfGetGStateMode(pCurrentGState, PFSTATE_TRANSPARENCY) != 0)){
  pfGSetDrawBin(pGeoSet, DrawBin + 1);
       }else{
  pfGSetDrawBin(pGeoSet, DrawBin);
       }
... with DrawBin either DRAW_BIN_GLOBAL_OPAQUE or DRAW_BIN_LOCAL_OPAQUE.

And in the DrawCallback:

      pfLightOff(ViewState->Candle); pfLightOn(ViewState->Sun);
      pfOverride(PFSTATE_LIGHTS, PF_ON);
      pfDrawBin(DRAW_BIN_LOCAL_OPAQUE);
      pfDrawBin(DRAW_BIN_LOCAL_TRANSP);
      pfOverride(PFSTATE_LIGHTS, PF_OFF);

      pfLightOff(ViewState->Sun); pfLightOn(ViewState->Candle);
      pfOverride(PFSTATE_LIGHTS, PF_ON);
      pfDrawBin(DRAW_BIN_GLOBAL_OPAQUE);
      pfDrawBin(DRAW_BIN_GLOBAL_TRANSP);
      pfOverride(PFSTATE_LIGHTS, PF_OFF);

When I call just pfDraw I still have the impression that there were too many
lights switched. With the above scheme I would expect 4 at the maximum. But The
stats show more that 25. Is this ok?

Does somebody see what I'm doing wrong here?

Thanks in advance,

   Klaus

 ------------------------------------------------------
| Klaus Otto | |
| CAE Elektronik GmbH | Email: kotto++at++cae-gmbh.de |
| Abt. Systemtechnik | |
| Steinfurt 11 | Tel. : +49-2402-106-456 |
| D-52222 Stolberg | Fax : +49-2402-106-270 |
| Germany | |
 ------------------------------------------------------

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:56:14 PDT

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