From Ulrich Hertlein, "attached is a stencil buffer-based constant-width outline f/x with example. I've also modified osgfxbrowser to setup the stencil buffer accordingly."

This commit is contained in:
Robert Osfield
2009-12-08 17:41:44 +00:00
parent 17b8ee1508
commit e0154c2d28
8 changed files with 357 additions and 0 deletions

View File

@@ -320,6 +320,12 @@ int main(int argc, char *argv[])
viewer.setThreadingModel(threading);
// setup stencil buffer for Outline f/x.
osg::DisplaySettings::instance()->setMinimumNumStencilBits(1);
unsigned int clearMask = viewer.getCamera()->getClearMask();
viewer.getCamera()->setClearMask(clearMask | GL_STENCIL_BUFFER_BIT);
viewer.getCamera()->setClearStencil(0);
// any option left unread are converted into errors to write out later.
arguments.reportRemainingOptionsAsUnrecognized();