Hi Zach,

The pre compile exists to prevent the dropping of frames - so by dropping this you making it more likely that when a subgraph is merged that the next frame will stall while all the OpenGL objects are downloaded to the graphics pipe in time to be rendered.

W.r.t the read line causing the stalling, have you actually profiled this particular traversal?  This traversal should just collect what objects need to be compiled in the subgraph that has just been loaded, this should be a very quick traversal so I wouldn't expect it itself to cause a problem. 

It would be interesting to profile how big the DataToCompile list is getting.

Robert.

On 8/22/06, Zach Deedler <[EMAIL PROTECTED]> wrote:
Hello all,
 
I have fixed the database hitching problem! 
set OSG_DO_PRE_COMPILE=OFF
 
Can anybody tell me why the red line below was causing me the hitching problems?
 
                 if (_doPreCompile && databaseRequest->_loadedModel.valid() && !_activeGraphicsContexts.empty())
                {
                    // force a compute of the loaded model's bounding volume, so that when the subgraph
                    // merged with the main scene graph and large computeBound() isn't incurred.
                    databaseRequest->_loadedModel->getBound();
 

                    ActiveGraphicsContexts::iterator itr = _activeGraphicsContexts.begin();
 
                    DataToCompile& dtc = databaseRequest->_dataToCompileMap[*itr];
                    ++itr;               
 
                    // find all the compileable rendering objects
                    FindCompileableGLObjectsVisitor frov(dtc,
                                                         _changeAutoUnRef, _valueAutoUnRef,
                                                         _changeAnisotropy, _valueAnisotropy,
                                                         _drawablePolicy);
 
                    databaseRequest->_loadedModel->accept(frov);
 
                    if (!dtc.first.empty() || !dtc.second.empty())
                    {
                        loadedObjectsNeedToBeCompiled = true;               
 
                        // copy the objects from the compile list to the other graphics context list.
                        for(;
                            itr != _activeGraphicsContexts.end();
                            ++itr)
                        {
                            databaseRequest->_dataToCompileMap[*itr] = dtc;
                        }
                    }
                }
 
Also, just so you know, I have tried turning off precompile before but that was before I synched to the latest OpenThreads, so I don't know if that had anything to do with it.  Now, the paging seems to behave much like Linux, (occasional hitches but nothing for periods of multiple seconds).  The paging thread no longer gets 100% of the processor time ever.
 
So, it doesn't look like it was a file I/O thing after all! 

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to