Canvas troubleshooting: Difference between revisions

Jump to navigation Jump to search
m
→‎Hooking up Canvas to the Osg Stats: intro from: http://markmail.org/message/tc4lgn6qvj5f5bf6
m (→‎Background: de-quote a bit to keep fellow wiki admins happy ...)
m (→‎Hooking up Canvas to the Osg Stats: intro from: http://markmail.org/message/tc4lgn6qvj5f5bf6)
Line 658: Line 658:
For the [[FGCanvas]] mode, this just means that sky/sunlight and PUI rendering can be completely disabled for even better performance/appearance, i.e. Nasal/Canvas are up and running in under 5 seconds here normally. Likewise, this is a good thing for debugging and regression testing, i.e. to keep certain rendering features completely disabled - for example so that only Canvas related OSG/OpenGL calls show up in the gDebugger profile, i.e. much more fine-grained info, without having to patch FG.
For the [[FGCanvas]] mode, this just means that sky/sunlight and PUI rendering can be completely disabled for even better performance/appearance, i.e. Nasal/Canvas are up and running in under 5 seconds here normally. Likewise, this is a good thing for debugging and regression testing, i.e. to keep certain rendering features completely disabled - for example so that only Canvas related OSG/OpenGL calls show up in the gDebugger profile, i.e. much more fine-grained info, without having to patch FG.


=== Hooking up Canvas to the Osg Stats ===
=== Hooking up Canvas and Osg Stats ===
There are three parts to stats - the stats storage, gathering and the stats display.
 
The osg::Stats class is a thread safe container for storing collected stats data, and various OSG classes can have Stats objects attached to them, such as osg::Camera and osg::View.
 
The various traversals then fill the above Stats obects with data, in particular it's the Viewer/CompositeViewer/Renderer that do most of'the stats collection.
 
Then we have the [http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00804.html StatsHandler] that switches on the stats collect so the above start collecting and storing stats, and then displays the results.
 
To add custom stats you'll just need to add your own stats collection, and you may be able to simply reuse one of the exiting osg::Stats object as a place to dump this data, then subclass from osgViewer::StatsHandler or simply derive your own for the display of your stats.
 
The following patches are based on the [http://trac.openscenegraph.org/projects/osg//browser/OpenSceneGraph/trunk/examples/osguserstats/osguserstats.cpp osguserstats.cpp] example:
<syntaxhighlight lang="diff">
<syntaxhighlight lang="diff">
</syntaxhighlight>
</syntaxhighlight>


=== Experimenting with Osg::Simplifier  ===
=== Experimenting with Osg::Simplifier  ===

Navigation menu