From: Yair Kurzion (yair++at++polygon.engr.sgi.com)
Date: 01/11/2000 15:41:19
Hello Steve !
Say you put a DRAW callback on a node A, and node A has children B, C, D, E.
Performer will make sure that this callback is called before drawing ANY of the
children of this node. If Performer decided to draw some children interleaved
with other geometry (e.g. B, C, g1, D, E where g1 is some other geometry), it
will call the draw callback multiple times - once for each time its starts
drawing some children of A (In the example, the DRAW callback gets called
before drawing B and before drawing D).
Here are cases when Performer decides to interleave the drawing of some
children of a node with other geometry:
1. The children of a node contain transparent and opaque geometry. Performer
always starts by drawing ALL the opaque geometry and then draws the
transparent geometry. This is true on low end machines where
multi-sample-alpha is not available, or on high-end machines when you
request alpha-blended transparent geometry.
2. If some of the children of a node are light sources. Performer traverses
the light sources separately and calls the relevant draw callbacks on
each visible light source.
In the case of 'perfly -m 0 enterprise.flt', the pfScene node is a parent of
the model enterprise.flt and of a light source. I think enterprise.flt has no
transparent geometry so if you place the DRAW callback on sceneGroup, it will
be called only once.
-yair
> I've been on a "tangent of understanding" for the past several hours
> after noticing (from printf statements) that my (pfChanTravFrunc'd)
> DRAW callbacks are being called twice per frame - even though I'm
> using only one channel, there's only one parent, etc. I'd like to
> know what's going on.
>
> Trying to whittle the problem down to it's simplest form, I registered
> DRAW callbacks with the pfScene itself using vanilla perfly (C
> version). I added to perfly.c:initSceneGraph() the following:
>
> pfNodeTravFuncs( scene, PFTRAV_DRAW, scenePreDraw, scenePostDraw);
>
> and then created the functions scenePreDraw, scenePostDraw with
> diagnostic output. For example, scenePreDraw contains the following:
>
> printf("scenePreDraw - %d (node=%p,chan=%p)\n", pfGetFrameCount(),
> pfGetTravChan(trav), pfGetTravNode(trav));
>
> return PFTRAV_CONT;
>
>
> When run (e.g., perfly -m 0 enterprise.flt) the printf is executed
> twice per frame - with identical node and channel pointers. E.g.,
>
> scenePreDraw - 61 (node=401dfdcb00,chan=401dd46990)
> scenePostDraw - 61
> scenePreDraw - 61 (node=401dfdcb00,chan=401dd46990)
> scenePostDraw - 61
>
> This is identical to what is happening with my nodes deeper in the
> scene graph.
>
> One glimmer of hope was thinking that one iteration was during display
> list compilation and the other during display list execution, but I
> believe -m 0 eliminates display list generation (I also tried
> CULLoDRAW).
>
> I'm pretty sure my scene isn't being drawn twice ;), but I'm a little
> concerned the code in my drawbacks is being executed twice.
>
>
> (pf 2.2.3, 6.5.5m)
>
> There must be a logical explanation for this ..
>
> Any takers?
>
> Steve
> --
> stephen.maher++at++gsfc.nasa.gov (301) 286-3368 fax:(301) 286-1776
> http://holodeck.gsfc.nasa.gov/vr/vr.html
> http://svs.gsfc.nasa.gov http://www.digitalearth.gov
> NASA Goddard Space Flight Center
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>
--
\_________ \_____ \__ \__ \_____ Yair Kurzion
\_________ \_____ \__ \__ \_____ yair++at++sgi.com
\__ \__ \____\__ \__ http://reality.sgi.com/yair
\__ \__ \__ Work: (650) 933-6502
\__ \__ \__ Home: (408) 226-9771
\__ \__ \__
This archive was generated by hypermail 2b29 : Tue Jan 11 2000 - 15:41:23 PST