DrawBin problem

New Message Reply Date view Thread view Subject view Author view

Klaus Otto (kotto++at++cae-gmbh.de)
Thu, 20 Nov 1997 18:32:12 +0100


Hi all,

I need an extra lesson in using bins in perf2.0.4 under 6.2
on an ONYX RE2Station.

Backgrnd:
I want to render a scene with 2 lighing models.
The geom is devided into 2 parts lit by one lmodel each

To achieve this i traversed the 2 branches and attached
the appropriate lights to the gsets.
I ended up with too many lightstate changes (i think) and
tried to
       static int binsort[] = {PFSORT_STATE_BGN, PFSTATE_LIGHTS,
                                                 ^^^^^^^^^^^^^^
                             PFSTATE_TEXTURE, PFSTATE_FRONTMTL,
                            PFSORT_STATE_END, PFSORT_END};
       pfChanBinSort(chan, PFSORT_OPAQUE_BIN, PFSORT_BY_STATE, binsort);
       pfChanBinSort(chan, PFSORT_TRANSP_BIN, PFSORT_BY_STATE, binsort);

.. but this didn't help due to some SCS/DCS in the scene.

Then I traversed the scene to do :

   pfGSetDrawBin(pGeoSet, 2); /* for opaque globally lit */
   pfGSetDrawBin(pGeoSet, 3); /* for transp globally lit */
   pfGSetDrawBin(pGeoSet, 4); /* for opaque locally lit */
   pfGSetDrawBin(pGeoSet, 5); /* for transp locally lit */

and wanted to render in a draw callback with something like:

      pfLightOn(ViewState->Candle);
      pfLightOff(ViewState->Sun);
      pfOverride(PFSTATE_LIGHTS, PF_ON);

      pfDrawBin(DRAW_BIN_GLOBAL_OPAQUE); /* 2 */
      pfDrawBin(DRAW_BIN_GLOBAL_TRANSP); /* 3 */

      pfOverride(PFSTATE_LIGHTS, PF_OFF);

      pfLightOff(ViewState->Candle);
      pfLightOn(ViewState->Sun);
      pfOverride(PFSTATE_LIGHTS, PF_ON);

      pfDrawBin(DRAW_BIN_LOCAL_OPAQUE); /* 4 */
      pfDrawBin(DRAW_BIN_LOCAL_TRANSP); /* 5 */

      pfOverride(PFSTATE_LIGHTS, PF_OFF);

Can somebody show me what's wrong with this? Perhaps a function like
pfGetChanFreeBin() as in perf2.2, but i didn't find any.

I will attach a stats dump from the application.

Thanks for any help 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 | |
 ------------------------------------------------------

*------------------------------------------------------------------------------*
***
*** Average Frame Stats:
*** ---------------------
Num Frames: 51, update period: 2.000000 secs
GSet Stats:
        gsets=455 flat=0 transp=0, highlighted=0, pvcolor=10 pvnormal=251 texcoord=0
Geometry Stats:
        GL Primitives: total=4179 tris=4169 lines=0 points=10
        primsPerGSet=9.18 primsPerGState=10.14 gsetsPerGState=1.10
        Attrs: verts=6975 colors=455 normals=5857 texcoords=5327 bytes=297824
Tris: avg tris per strip = 4.71
        Number of tris in strips of length:
                length 1: 31 length 2: 2074 length 3: 102 length 4: 356 length 5: 10
                length 6: 762 length 7: 0 length 8: 16 length 9: 0 length 10: 610
                length 11: 0 length 12: 144 length 13: 0 length 14+: 64
Mode Change Stats:
        Enables: lighting=0 texturing=106 fog=0 ctab=0 wireframe=0 hlight=0
        shade=102 cullface=24 afunction=76 aa=0 transp=76 decal=0
        textures=298 (detailed=0, sharpened=37) detailTextures=0 texLoads=0 texBytes=0 texEnv=53
        materials=32 lights=32 (inf=28, local=2) lmodels=3 (twoSided=0, localViewer=1
        fog=0 (ramps=0) ctabs=0 hlights=0
Mode Call Stats:
        Enables: lighting=4 texturing=110 fog=1 ctab=4 wireframe=0 hlight=0
        shade=103 cullface=28 afunction=100 aa=0 transp=79 decal=0
        textures=327 (detailed=0, sharpened=0) detailTextures=0 texLoads=0 texBytes=0 texEnv=57
        materials=35 lights=412 (inf=0, local=0) lmodels=3 (twoSided=0, localViewer=0
        fog=0 (ramps=0) ctabs=0 hlights=0
State Stats:
        gstates=412 gsindexes=0 push=2 pop=2 flush=2 basic=0
Transform Stats:
        pushmat=20 popmat=20 loadmat=0 multmat=20
        translate=0 rotate=1 scale=0
Frame times (msecs):
        total=98.8 app=0.9 cull=4.5 draw=26.7 isect=0.0
Frame counts: total=51 app=51 cull=51 draw=51 isect=0
Frames=51 Misses: total=51 app+cull=23 draw=0
Database Stats:
        Visible nodes=490 groups=135 geodes=272 bboards=0
                switches=22 LODs=13 (fade=0)
                SCSs=18 DCSs=21
                layers=0 texts=0 sequences=8 lsources=1
        Evaluated App nodes=0 groups=0 geodes=0 bboards=0
                switches=0 LODs=0 (fade=0)
                SCSs=0 DCSs=0
                layers=0 texts=0 sequences=8 lsources=0
        Evaluated Cull nodes=54 groups=0 geodes=0 bboards=0
                switches=22 LODs=19 (fade=13)
                SCSs=0 DCSs=0
                layers=0 texts=0 sequences=0 lsources=0
Cull Hierarchy Stats:
        Cull traversed nodes=0 groups=138 geodes=272 bboards=0
                switches=22 LODs=19 (fade=0)
                SCSs=18 DCSs=21
                layers=0 texts=0 sequences=8 lsources=1
Cull Result Stats:
        Nodes: total traversed=499 test=27 accept=482 reject=3 non-trivial=14
        GSets: total=455 test=0 accept=455 reject=0 non-trivial=0 sorted=0

=======================================================================
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:13 PDT

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