Re-sending since the the original mail did not seem to make it through...
-- John
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
--- Begin Message ---
Hi Robert,
I made it work! However, to make the example work I had to a new
statistics counter to DatabasePager. I added the method the DatabasePager:
/** Get number of fileRequest that are currently being processed in
DatabaseThreads */
int getRequestsInProgress() const { return _requestsInProgress; }
The member _requestsInProgress is intialized to zero in the
DatabasePager c'tors, increased by one in
DatabasePager::requestNodeFile(), and decreased by one in
DatabasePager::addLoadedDataToSceneGraph();
This counter in the DatabasePager allows me to use the following
algorithm in the custom viewer class:
...
// Initiate the first PagedLOD request
frame();
// Keep rendering until full level of detail is reached
while(!done() && getDatabasePager()->getRequestsInProgress())
{
updateTraversal();
renderingTraversals();
}
// Add the WindowCaptureCallback now that we have full resolution
getCamera()->setFinalDrawCallback(new
WindowCaptureCallback(GL_BACK, _fileName));
renderingTraversals();
// Automatically close after capture
close();
...
Although this works, it takes a looong time for the program to capture
the full-res image. I'll send the example and DatabasePager mods to
osg-submissions, and I hope the community can find a better / faster way
to implement this example.
I think such a solution is needed for OSG to support auto rendering jobs
(command line / cronjob), whether the output is in form of images or
movies. One usage example is to render the same animation path each day
over a terrain, but with different data overlays (e.g. weather,
pollution, traffic, etc.) And you want your movies / images to be crisp;)
Best regards,
John
John Vidar Larring wrote:
Hi Robert,
> Are you planning to submit this example for inclusion with the OSG
> example set? If so then I could integrate then I and others could
> tweak it so it works.
Yes, that was basically the plan, only that I originally wanted to
submit a working example;)
The reason for putting together this example in the first place was to
create an application scenario that could make it interesting for others
to solve this particular DatabasePager problem as well.
I'll try out a few more hunches before cleaning up and submitting the
example, working or not working.
Best regards,
John
--
Best regards,
John
WeatherOne
--- End Message ---
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org