Re: [osg-users] Qt + non-continuous draw + pagedLOD: Random loss of detail??

2008-08-04 Thread Robert Osfield
Thanks for the additions Maciej,  the changes have missed the
OpenSceneGraph-2.6 branch/feature freeze so will have to be merged
once 2.6 is out.

On Mon, Aug 4, 2008 at 1:51 PM, Maciej Krol [EMAIL PROTECTED] wrote:
 Hi all,

 I have implement frame based expiration of PagedLOD children. I will send it
 to osg-submissions as well.

 New attribute DatabasePager::_expiryFrames sets number of frames a PagedLOD
 child is kept in memory. The attribute is set with
 DatabasePager::setExpiryFrames method or OSG_EXPIRY_FRAMES environmental
 variable.

 New attribute PagedLOD::PerRangeData::_frameNumber contains frame number of
 last cull traversal.

 Children of PagedLOD are expired when time _AND_ number of frames since last
 cull traversal exceed OSG_EXPIRY_DELAY _AND_ OSG_EXPIRY_FRAMES respectively.
 By default OSG_EXPIRY_FRAMES = 1 which means that nodes from last
 cull/rendering
 traversal will not be expired even if last cull time exceeds
 OSG_EXPIRY_DELAY. Setting OSG_EXPIRY_FRAMES = 0 revokes previous behaviour
 of PagedLOD.

 Setting OSG_EXPIRY_FRAMES  0 fixes problems of children reloading in lazy
 rendering applications. Required behaviour is achieved by manipulating
 OSG_EXPIRY_DELAY and OSG_EXPIRY_FRAMES together.

 Two interface changes are made:

 DatabasePager::updateSceneGraph(double currentFrameTime) is replaced by
 DatabasePager::updateSceneGraph(const osg::FrameStamp frameStamp). The
 previous method is in #if 0 clause in the header file. Robert, decide if You
 want to include it.

 PagedLOD::removeExpiredChildren(double expiryTime, NodeList
 removedChildren) is deprecated (warning is printed), when subclassing use
 PagedLOD::removeExpiredChildren(double expiryTime, int expiryFrame, NodeList
 removedChildren) instead.

 Regards,
  Maciej Krol


 2008/8/3 Robert Osfield [EMAIL PROTECTED]

 Hi John,

 As others have pointed out, what you are seeing is the removal of
 expired subgraphs.  The DatabasePager is built around continuous
 update of the scene graph - both for loading of new subgraphs,
 compiling of subgraphs, merging of subgraphs and removal of expired
 subgraphs.   As such paging databases aren't appropriate to non
 continuous updated apps, you could fudge things by upping the expiry
 delay on the DatabasePager.  Doing periodic renders of the scene would
 also allow things to tick along.

 Robert.

 On Wed, Jul 30, 2008 at 1:39 PM, John Vidar Larring
 [EMAIL PROTECTED] wrote:
  Hi all,
 
  Background:
  ---
  In our application the user can set up scenes ( or sequences as we call
  them) for playback on a timeline (e.g. seq.1 - transition - seg.2 -
  transition ... seq.N). Some scenes are too complex to render real-time
  and
  are recorded to movies before playback. Hence, when scenes are edited by
  the
  user all scenes are redrawn as needed rather than continuously to avoid
  sluggish GUI response.
 
  Problem:
  
  _Sometimes_ when the scene is redrawn in edit mode (i.e. redraw only if
  needed), the pagedLOD DB (osgTerrain) drops to the lowest detail level
  (Ref.
  osg_original.jpg and osg_problem.jpg). This behavior seems to appear at
  randomly. In playback mode (i.e. when frame rate is constant) the
  problem
  never occurs.
 
  Reproduce / Code example:
  --
  The problem has been reproduces in a small test program
  (osgtest_source_code.tgz) derived from the osgviewerQT example (since we
  are
  using Qt 4.x in our application). To reproduce: run the compiled
  application: 'osgtest -t your osgTerrain db' . To trigger refreshes,
  occlude parts of the window with another window. The problem typically
  reveals itself when at a redraw or when the window looses focus (be
  patient,
  since this happens randomly it may take some time before the problem
  occurs).
 
  Since I'm still quite new to OSG, I'm not sure where to look for a
  solution.
  Hopefully someone will spot the obvious error in the sample code. Any
  advice
  is highly appreciated.
 
  Versions:
  -
  OSG svn rev 8700
  Qt 4.2.3
 
  Best regards,
  John Larring
 
  --
  This message has been scanned for viruses and
  dangerous content by MailScanner, and is
  believed to be clean.
 
 
  ___
  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



 --
 Regards,
 Maciej Krol

 ___
 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] Qt + non-continuous draw + pagedLOD: Random loss of detail??

2008-08-03 Thread Robert Osfield
Hi John,

As others have pointed out, what you are seeing is the removal of
expired subgraphs.  The DatabasePager is built around continuous
update of the scene graph - both for loading of new subgraphs,
compiling of subgraphs, merging of subgraphs and removal of expired
subgraphs.   As such paging databases aren't appropriate to non
continuous updated apps, you could fudge things by upping the expiry
delay on the DatabasePager.  Doing periodic renders of the scene would
also allow things to tick along.

Robert.

On Wed, Jul 30, 2008 at 1:39 PM, John Vidar Larring
[EMAIL PROTECTED] wrote:
 Hi all,

 Background:
 ---
 In our application the user can set up scenes ( or sequences as we call
 them) for playback on a timeline (e.g. seq.1 - transition - seg.2 -
 transition ... seq.N). Some scenes are too complex to render real-time and
 are recorded to movies before playback. Hence, when scenes are edited by the
 user all scenes are redrawn as needed rather than continuously to avoid
 sluggish GUI response.

 Problem:
 
 _Sometimes_ when the scene is redrawn in edit mode (i.e. redraw only if
 needed), the pagedLOD DB (osgTerrain) drops to the lowest detail level (Ref.
 osg_original.jpg and osg_problem.jpg). This behavior seems to appear at
 randomly. In playback mode (i.e. when frame rate is constant) the problem
 never occurs.

 Reproduce / Code example:
 --
 The problem has been reproduces in a small test program
 (osgtest_source_code.tgz) derived from the osgviewerQT example (since we are
 using Qt 4.x in our application). To reproduce: run the compiled
 application: 'osgtest -t your osgTerrain db' . To trigger refreshes,
 occlude parts of the window with another window. The problem typically
 reveals itself when at a redraw or when the window looses focus (be patient,
 since this happens randomly it may take some time before the problem
 occurs).

 Since I'm still quite new to OSG, I'm not sure where to look for a solution.
 Hopefully someone will spot the obvious error in the sample code. Any advice
 is highly appreciated.

 Versions:
 -
 OSG svn rev 8700
 Qt 4.2.3

 Best regards,
 John Larring

 --
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.


 ___
 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] Qt + non-continuous draw + pagedLOD: Random loss of detail??

2008-08-02 Thread Maciej Krol
Hi all,

I have the same problem in our digital content creation tool. IMHO the
plausible solution would be to expire the nodes after certain number of
frames rather than period of time. This would require changes in the
database pager. It shall be possible to select expiration mode - time based
or frame based (i.e. osgDB::setExpiryMode). I will think about
implementation details this weekend.

Regards,
 Maciej Krol

2008/7/31 Jakob Ruhe [EMAIL PROTECTED]

 Hi John!

 I also have these kind of problems when I use lazy rendering which
 is the way I want it to be done in my application.

 These methods may help you:
 osgDB::setExpiryDelay
 PagedLOD::setNumChildrenThatCannotBeExpired

 You can also override these virtual methods to fine tune what you want to
 do:
 osgDB::removeExpiredSubgraphs
 PagedLOD::removeExpiredChildren

 I hope it can help you in your case even though these are not any good
 permanent solutions for any lazy rendering app..

 /Jakob Ruhe

 2008/7/30 Glenn Waldron [EMAIL PROTECTED]:
  John,
 
  I have run into the same issue. PagedLOD children expire after a
 certain
  period of time (default is something like 5 seconds?) If a PagedLOD child
  has not been visited in the last N seconds, the pager will discard it and
  revert to a lower LOD. OSG updates the time-last-visited during the
 cull
  traversal in order to check for expiration. So, if you are not
 continuously
  running the frame loop, PagedLOD's will think their children have expired
  and will drop to the lowest LOD.
 
  I used to refer to the technique you're using as lazy rendering (i.e.
 only
  render a frame when something has changed) ... try searching the archives
  ... but at the time I never did find a good way to do this in OSG without
  confusing the pager.
 
  Glenn
 
  --
  Glenn Waldron : Pelican Mapping : http://pelicanmapping.com :
  +1.703.652.4791
 
  On Wed, Jul 30, 2008 at 8:39 AM, John Vidar Larring 
 [EMAIL PROTECTED]
  wrote:
 
  Hi all,
 
  Background:
  ---
  In our application the user can set up scenes ( or sequences as we call
  them) for playback on a timeline (e.g. seq.1 - transition - seg.2 -
  transition ... seq.N). Some scenes are too complex to render real-time
 and
  are recorded to movies before playback. Hence, when scenes are edited by
 the
  user all scenes are redrawn as needed rather than continuously to avoid
  sluggish GUI response.
 
  Problem:
  
  _Sometimes_ when the scene is redrawn in edit mode (i.e. redraw only if
  needed), the pagedLOD DB (osgTerrain) drops to the lowest detail level
 (Ref.
  osg_original.jpg and osg_problem.jpg). This behavior seems to appear at
  randomly. In playback mode (i.e. when frame rate is constant) the
 problem
  never occurs.
 
  Reproduce / Code example:
  --
  The problem has been reproduces in a small test program
  (osgtest_source_code.tgz) derived from the osgviewerQT example (since we
 are
  using Qt 4.x in our application). To reproduce: run the compiled
  application: 'osgtest -t your osgTerrain db' . To trigger refreshes,
  occlude parts of the window with another window. The problem typically
  reveals itself when at a redraw or when the window looses focus (be
 patient,
  since this happens randomly it may take some time before the problem
  occurs).
 
  Since I'm still quite new to OSG, I'm not sure where to look for a
  solution. Hopefully someone will spot the obvious error in the sample
 code.
  Any advice is highly appreciated.
 
  Versions:
  -
  OSG svn rev 8700
  Qt 4.2.3
 
  Best regards,
  John Larring
 
  --
  This message has been scanned for viruses and
  dangerous content by MailScanner, and is
  believed to be clean.
 
 
  ___
  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
 
 
 ___
 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] Qt + non-continuous draw + pagedLOD: Random loss of detail??

2008-07-31 Thread Jakob Ruhe
Hi John!

I also have these kind of problems when I use lazy rendering which
is the way I want it to be done in my application.

These methods may help you:
osgDB::setExpiryDelay
PagedLOD::setNumChildrenThatCannotBeExpired

You can also override these virtual methods to fine tune what you want to do:
osgDB::removeExpiredSubgraphs
PagedLOD::removeExpiredChildren

I hope it can help you in your case even though these are not any good
permanent solutions for any lazy rendering app..

/Jakob Ruhe

2008/7/30 Glenn Waldron [EMAIL PROTECTED]:
 John,

 I have run into the same issue. PagedLOD children expire after a certain
 period of time (default is something like 5 seconds?) If a PagedLOD child
 has not been visited in the last N seconds, the pager will discard it and
 revert to a lower LOD. OSG updates the time-last-visited during the cull
 traversal in order to check for expiration. So, if you are not continuously
 running the frame loop, PagedLOD's will think their children have expired
 and will drop to the lowest LOD.

 I used to refer to the technique you're using as lazy rendering (i.e. only
 render a frame when something has changed) ... try searching the archives
 ... but at the time I never did find a good way to do this in OSG without
 confusing the pager.

 Glenn

 --
 Glenn Waldron : Pelican Mapping : http://pelicanmapping.com :
 +1.703.652.4791

 On Wed, Jul 30, 2008 at 8:39 AM, John Vidar Larring [EMAIL PROTECTED]
 wrote:

 Hi all,

 Background:
 ---
 In our application the user can set up scenes ( or sequences as we call
 them) for playback on a timeline (e.g. seq.1 - transition - seg.2 -
 transition ... seq.N). Some scenes are too complex to render real-time and
 are recorded to movies before playback. Hence, when scenes are edited by the
 user all scenes are redrawn as needed rather than continuously to avoid
 sluggish GUI response.

 Problem:
 
 _Sometimes_ when the scene is redrawn in edit mode (i.e. redraw only if
 needed), the pagedLOD DB (osgTerrain) drops to the lowest detail level (Ref.
 osg_original.jpg and osg_problem.jpg). This behavior seems to appear at
 randomly. In playback mode (i.e. when frame rate is constant) the problem
 never occurs.

 Reproduce / Code example:
 --
 The problem has been reproduces in a small test program
 (osgtest_source_code.tgz) derived from the osgviewerQT example (since we are
 using Qt 4.x in our application). To reproduce: run the compiled
 application: 'osgtest -t your osgTerrain db' . To trigger refreshes,
 occlude parts of the window with another window. The problem typically
 reveals itself when at a redraw or when the window looses focus (be patient,
 since this happens randomly it may take some time before the problem
 occurs).

 Since I'm still quite new to OSG, I'm not sure where to look for a
 solution. Hopefully someone will spot the obvious error in the sample code.
 Any advice is highly appreciated.

 Versions:
 -
 OSG svn rev 8700
 Qt 4.2.3

 Best regards,
 John Larring

 --
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.


 ___
 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


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


Re: [osg-users] Qt + non-continuous draw + pagedLOD: Random loss of detail??

2008-07-30 Thread Glenn Waldron
John,

I have run into the same issue. PagedLOD children expire after a certain
period of time (default is something like 5 seconds?) If a PagedLOD child
has not been visited in the last N seconds, the pager will discard it and
revert to a lower LOD. OSG updates the time-last-visited during the cull
traversal in order to check for expiration. So, if you are not continuously
running the frame loop, PagedLOD's will think their children have expired
and will drop to the lowest LOD.

I used to refer to the technique you're using as lazy rendering (i.e. only
render a frame when something has changed) ... try searching the archives
... but at the time I never did find a good way to do this in OSG without
confusing the pager.

Glenn

-- 
Glenn Waldron : Pelican Mapping : http://pelicanmapping.com :
+1.703.652.4791

On Wed, Jul 30, 2008 at 8:39 AM, John Vidar Larring
[EMAIL PROTECTED]wrote:

 Hi all,

 Background:
 ---
 In our application the user can set up scenes ( or sequences as we call
 them) for playback on a timeline (e.g. seq.1 - transition - seg.2 -
 transition ... seq.N). Some scenes are too complex to render real-time and
 are recorded to movies before playback. Hence, when scenes are edited by the
 user all scenes are redrawn as needed rather than continuously to avoid
 sluggish GUI response.

 Problem:
 
 _Sometimes_ when the scene is redrawn in edit mode (i.e. redraw only if
 needed), the pagedLOD DB (osgTerrain) drops to the lowest detail level (Ref.
 osg_original.jpg and osg_problem.jpg). This behavior seems to appear at
 randomly. In playback mode (i.e. when frame rate is constant) the problem
 never occurs.

 Reproduce / Code example:
 --
 The problem has been reproduces in a small test program
 (osgtest_source_code.tgz) derived from the osgviewerQT example (since we are
 using Qt 4.x in our application). To reproduce: run the compiled
 application: 'osgtest -t your osgTerrain db' . To trigger refreshes,
 occlude parts of the window with another window. The problem typically
 reveals itself when at a redraw or when the window looses focus (be patient,
 since this happens randomly it may take some time before the problem
 occurs).

 Since I'm still quite new to OSG, I'm not sure where to look for a
 solution. Hopefully someone will spot the obvious error in the sample code.
 Any advice is highly appreciated.

 Versions:
 -
 OSG svn rev 8700
 Qt 4.2.3

 Best regards,
 John Larring

 --
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.


 ___
 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