[info-performer] help needed on sorting gset

Date view Thread view Subject view Author view

From: stephane capo (stephane.capo++at++oktal.fr)
Date: 11/25/2004 01:11:55


Hi all,

   I'm trying to understand how the cull process sorts gset in bins. I have
3
objects (pfGeode) each with one pfGeoSet in my scenegraph, they are
added in this order in the scenegraph:

    - object1 has GState 1
    - object2 has GState 2
    - object3 has GState 1

    GState 1 is really the same (same pointer is applied) on object 1 and 3.

    I'm using this init for the channel:

 chan->setTravMode(PFTRAV_CULL, PFCULL_VIEW | PFCULL_GSET | PFCULL_SORT);

 uint64_t sort[]={PFSORT_STATE_BGN,
                       PFSTATE_TEXTURE, PFSTATE_FRONTMTL,
                       PFSORT_STATE_END, PFSORT_END};

 chan->setBinSort(PFSORT_OPAQUE_BIN, PFSORT_BY_STATE, sort);
// problem is the same with chan->setBinSort(PFSORT_OPAQUE_BIN,
PFSORT_BY_STATE, NULL);
 chan->setBinSort(PFSORT_TRANSP_BIN, PFSORT_BACK_TO_FRONT, NULL);

    There's no transparency so everything should go to OPAQUE_BIN.

    and the statistics say:

    gstate = 3
    texture = 3

    So now I change the order of my objects in the scene graph and add
them this order :

    - object1 has GState 1
    - object3 has GState 1
    - object2 has GState 2

    with the same init for pfChannel the statistics say:

    gstate = 2
    texture = 2

    So my questions are :
    - Are the gset sorted for the full scene or just inside each geoset ?
    - Is there something I'm missing to ask the cull process to "really"
sort all gset before sending them to the draw process and so avoid the
state swapping ?
    - Does using pfDCS and/or pfLOD affects the sorting.

    thanks

        Stephane


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Nov 25 2004 - 01:12:09 PST