Re: [osg-users] PagedLOD experts?

2009-11-02 Thread Jean-Sébastien Guay

Hi Chris,


  It does raise another question -- is this a common practice and is there 
anywhere else
in OSG where node name has a special meaning during specific phases of 
operation?


I tend to think that any use of user-settable properties, such as node 
name, callbacks, user data, etc. inside OSG is potentially dangerous. 
Any app could potentially change the node's name, remove/replace a 
callback or user data and that would break the library's behavior, and 
the only way to know why it's broken is to go delve into OSG's source.


For callbacks, it's pretty easy to instead derive a node type and 
override the traverse() method. That way it's much harder for the user 
to break expected behavior of the node (they would need to derive from 
this node type, override traverse() and forget to call the base class 
version). For name and user data, I don't see an easy way to avoid using 
them if OSG already uses them in some cases... But in any case, 
identifying nodes by name always strikes me as unsafe.


Since we use visitors so often in OSG coding, OSG itself can't assume 
that any node is hidden from the user, and so can't assume that 
user-settable properties won't be changed by the user...


This doesn't really help you, but I wanted to be more detailed than just 
saying "I agree".


J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] PagedLOD experts?

2009-11-01 Thread Wang Rui
Hi Chris,

2009/11/2 Chris 'Xenon' Hanson xe...@alphapixel.com

>
> This visitor, when applied, goes through the _inactivePagedLODList, and
> renames a
> certain number of the contents to "NeedToRemove". Later, if you are NOT
> using the
> _deleteRemovedSubgraphsInDatabaseThread option, it removes PagedLOD nodes
> that have this name.
>
>
Yes, it does. In my opinion, PagedLODs are seldom named "NeedToRemove"
because they are created by VPB automatically, or created by some
user-defined LOD generating tools, which may easily avoid this problem. So I
just ignore it while coding. But as you say, it is potentially dangerous.


> It does raise another question -- is this a common practice and is there
> anywhere else
> in OSG where node name has a special meaning during specific phases of
> operation?
>

I think so. There are some other special uses of setName(),
setUpdateCallback() and etc. in core osg libraries. For example,
osgAnimation::MorphGeometry applies setUpdateCallback() to itself
automatically, which may be invalid if a innocent developer set a customized
udpate callback to it again. Usage of ImageSequence::UpdateCallback in
osg::Texture classes may also have the same trouble.


>  And finally, is there a better extensible way to go about marking
> arbitrary nodes for
> later processing (while potentially still in the scenegraph, even though
> this case has
> them removed from the scenegraph by this point)? Any fast boolean flag will
> be immediately
> overwhelmed because everyone will want to use it and they'll collide. But
> any extensible
> method would seem to involve allocating and attaching some sort of dynamic
> marker, which
> is not especially efficient.
>
>  Any thoughts?
>
>


I don't think OSG can solve all those problems by itself. IMHO, the best way
is to write and improve documents and reference manuals, and try to tell
these exceptions and notes to developers all over the world: Don't rename
"unrenamable" nodes, and don't disturb self-propelled objects. :D


Wang Rui
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] PagedLOD experts?

2009-11-01 Thread Tim Moore
On 11/01/2009 10:42 PM, Chris 'Xenon' Hanson wrote:
>   I'm just wondering -- other than myself, are there any others (excluding 
> Robert,
> obviously) who have delved into the code for PagedLOD and DatabasePager and 
> actually done
> any coding in there?
> 
I've stared at the DatabasePager code a lot and made some contributions, but 
mostly in
order to do paging without using PagedLOD.

Tim

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] PagedLOD experts?

2009-11-01 Thread Chris 'Xenon' Hanson
Chris 'Xenon' Hanson wrote:
>   I'm just wondering -- other than myself, are there any others (excluding 
> Robert,
> obviously) who have delved into the code for PagedLOD and DatabasePager and 
> actually done
> any coding in there?


  I'll throw out an item that I think should be discussed from my recent work:

DatabasePager.cpp, capped_removeExpiredSubgraphs() has a line of coding that 
says:

MarkPagedLODsVisitor markerVistor("NeedToRemove");

  This visitor, when applied, goes through the _inactivePagedLODList, and 
renames a
certain number of the contents to "NeedToRemove". Later, if you are NOT using 
the
_deleteRemovedSubgraphsInDatabaseThread option, it removes PagedLOD nodes that 
have this name.

  This seems to me to be a dangerous usage of the node name. Granted, it's very 
unlikely
that you'd have a node named "NeedToRemove", but it underscores that the 
practice of
assigning special meaning to the node name isn't especially safe. I think it 
would be wise
to clean the node names as the nodes are added to the _inactivePagedLODList so 
that none
of them could ever possibly enter into the list already bearing the name 
"NeedToRemove".
What I haven't figured out is if there's ever a situation where a node _leaves_ 
the
inactive list and returns to the active scenegraph without being deleted. In 
this case,
any tampering of the node name would have undesirable results.

  It does raise another question -- is this a common practice and is there 
anywhere else
in OSG where node name has a special meaning during specific phases of 
operation? This
particular one is not documented anywhere I know of. In this case, the failure 
mode would
be pretty benign -- the DatabasePager could accidentally destroy too many 
inactive
PagedLOD nodes in one frame-idle period. Normally this is constrained by the
_targetMaximumNumberOfPageLOD. So, maybe this failure could cause the redraw to 
break
framerate. Nothing fatal.

  And finally, is there a better extensible way to go about marking arbitrary 
nodes for
later processing (while potentially still in the scenegraph, even though this 
case has
them removed from the scenegraph by this point)? Any fast boolean flag will be 
immediately
overwhelmed because everyone will want to use it and they'll collide. But any 
extensible
method would seem to involve allocating and attaching some sort of dynamic 
marker, which
is not especially efficient.

  Any thoughts?


-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"There is no Truth. There is only Perception. To Perceive is to Exist." - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] PagedLOD experts?

2009-11-01 Thread Chris 'Xenon' Hanson
sergey leontyev wrote:
> Chris,
> i dont know any, but since you are one of those few "elite" members of the 
> OSG community :-) Maybe you can help me understand what is going on:
> http://forum.openscenegraph.org/viewtopic.php?t=3782

  I can't tell you much about TXP paging or multi-camera Database paging.

  What I can tell you is you need to do some in-situ debugging. You need to 
compile with
debugging and use memory debugging tools to see what sort of objects (what size 
of
allocations) are being allocated. Add code wherever needed to count these 
allocations, and
set breakpoints to see where they're being allocated from.

  Turn on as much OSG debugging info (OSG Notify level DEBUG_INFO) and watch 
what spits
out. Usually OSG tells you what it's doing in detail if it's loading or 
allocating stuff.
Add more Notify debugging to suspicious code areas if you need to.

  I could probably help you more with this, but I've got to help my paying 
client.

> Thanks!
> Sergey

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"There is no Truth. There is only Perception. To Perceive is to Exist." - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] PagedLOD experts?

2009-11-01 Thread Paul Martz
Like Wang Rui, I have studied the code to help investigate issues with 
client databases. But I haven't done any coding there. I'm familiar with 
the environment variables that control its behavior, what operations are 
done at what phase of the frame, and am aware of how the PagedLOD class 
differs significantly from its base class.


In the vast majority of my current work, I'm not using the DatabasePager 
or PagedLOD classes at all, so am probably a bit rusty on the current 
code base.


Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ 
+1 303 859 9466

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] PagedLOD experts?

2009-11-01 Thread Wang Rui
Hi Chris,

I had done a series of tutorials a few months ago named "The longest frame",
which discussed the implementation of DatabasePager, DataThread and PagedLOD
(You may find it at osgchina.org, in CHINESE). That is to say, I've studied
into the code, too, even though I'm not expert. :)
Wang Rui

2009/11/2 Chris 'Xenon' Hanson 

>  I'm just wondering -- other than myself, are there any others (excluding
> Robert,
> obviously) who have delved into the code for PagedLOD and DatabasePager and
> actually done
> any coding in there?
>
> --
> Chris 'Xenon' Hanson, omo sanza lettere  Xenon
> AlphaPixel.com
> PixelSense Landsat processing now available!
> http://www.alphapixel.com/demos/
> "There is no Truth. There is only Perception. To Perceive is to Exist." -
> Xen
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] PagedLOD experts?

2009-11-01 Thread sergey leontyev
Chris,
i dont know any, but since you are one of those few "elite" members of the OSG 
community :-) Maybe you can help me understand what is going on:

http://forum.openscenegraph.org/viewtopic.php?t=3782

Thanks!
Sergey


Chris 'Xenon' Hanson wrote:
> I'm just wondering -- other than myself, are there any others (excluding 
> Robert,
> obviously) who have delved into the code for PagedLOD and DatabasePager and 
> actually done
> any coding in there?
> 
> -- 
> Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
> PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
> "There is no Truth. There is only Perception. To Perceive is to Exist." - Xen
> ___
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  --
> Post generated by Mail2Forum


--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=19000#19000





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] PagedLOD experts?

2009-11-01 Thread Chris 'Xenon' Hanson
  I'm just wondering -- other than myself, are there any others (excluding 
Robert,
obviously) who have delved into the code for PagedLOD and DatabasePager and 
actually done
any coding in there?

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"There is no Truth. There is only Perception. To Perceive is to Exist." - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org