Re: [Plib-users] Pre/Post draw callbacks on ssgBranches.
Brought to you by:
sjbaker
From: Jon A. <jan...@on...> - 2000-09-19 15:43:56
|
> > > It's split into two parts, a terrain class, and a patch class. Each > > patch is just a subset of the terrain, to facilitate frustum culling. Each > > frame, the terrain class initializes, and then tessellates each of its > > patches. > >So a 'terrain' object *contains* the 'patch' objects? > >Is that why you need it to be an ssgBranch-derived class? Yes. > > It seems like they only get called on leafs. So I have to activate > the tessellating > > outside of the normal ssgCullAndDraw(). > >That's kindof ugly - I agree. But if you have derived your own class, why do >you need to mess with callbacks? You can draw the scene whenever you like. Well, when I first started, I attached all the Terrain and the Patches as user data on a ssgBranch and ssgVtxTable, respectively. That was okay to get it up an running, but made it clunky to use. > > This isn't so bad, except it means no culling is done prior to > tessellation. > >Yes - I think I understand. > >Can I see the code? It would be easier to discuss. I'll post it somewhere tonight. >Not that I know of...but those are pretty simple by comparison to your >efforts - all you need is alternative 'cull/hot/isect' member functions >derived from an ssgBranch node. Okay, that's what I thought. I probably need to study the code a bit more. I wasn't sure if these were implemented as member functions, or if it was an external iterator running over the tree that performed these functions. Thanks for the suggestions, Jon |