[Plib-devel] ssg Leaf call backs
Brought to you by:
sjbaker
From: Curtis L. O. <cu...@in...> - 2000-03-12 20:32:52
|
Steve, Here's another one for you. It would be convenient to be able to attach pre/post draw call backs to branch nodes as well as leaf nodes. ssg allows me to do this now, but it never calls the functions attached to branches, only leaf nodes. Assuming you are doing a depth first traversal of the scene graph, it would be nice if the predraw callback would be called when a branch is first decended to, and the postdraw callback would be called after all the "kids" have been processed (last thing on the way back out.) The alternative is to depend on the (?non-defined?) behavior that the first kid added to a branch is the first one processed during ssgCullandDraw(). This doesn't seem very satisfying or robust... especially if I later change the leaf nodes and forget to attach the call back to the first leaf. Or we could be wasteful and attach the callback to every leaf node in a sub tree, but I'd rather not do that either, but it would be the safest I suppose. These things would also need to be considered if you ever impliment state sorting ... yuk ... the callbacks could get out of sync with the leaf nodes being drawn! Perhaps we could add some sort of marker node such that everything below a marker would be state sorted then drawn. Then you continue traversing/rendering the rest of the tree as before. Right now the things I'm interested in doing with callbacks is to set blend modes and depth testing. In some cases here it's just fine to set these on a per leaf basis, but in other cases it would be nice to be able to set these on a per-subtree basis. Regards, Curt. -- Curtis Olson University of MN, ME Dept. Flight Gear Project Twin Cities cu...@me... cu...@fl... Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org |