Re: [Plib-users] Pre/Post draw callbacks on ssgBranches.
Brought to you by:
sjbaker
|
From: Steve B. <sjb...@ai...> - 2000-09-19 01:30:48
|
Jon Anderson wrote:
> I've been working on a really simple implementation of ROAM to work with
> SSG.
Very cool!
> 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?
> After all have been tessellated, it then renders them. It
> tessellates them all at once so that it can match edges, and avoid cracks
> in the terrain.
I get it.
> I've implemented the terrain class as an ssgBranch class, and the patches.
> But any pre or post callbacks don't get called on branches.
That's true - because of the sorting of transparency issues we discussed
about a week ago.
However, in your case, you know that all your daughter nodes have the
same ssgState (presumably) - so they'll either all be translucent - or
none of them - so it ought to be safe to use pre-/post- callbacks.
> 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.
> 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.
> Does anybody have any suggestions on how to go about this?
I think you just need to go a little deeper into the code - you can
(in principal) do the same things that an ssgLeaf does inside an ssgBranch
or vice-versa.
> Also, has
> anybody every tried to integrate any higherlevel organization like
> quadtrees or octrees into SSG?
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.
--
Steve Baker HomeEmail: <sjb...@ai...>
WorkEmail: <sj...@li...>
HomePage : http://web2.airmail.net/sjbaker1
Projects : http://plib.sourceforge.net
http://tuxaqfh.sourceforge.net
http://tuxkart.sourceforge.net
http://prettypoly.sourceforge.net
|