How to suppress moiré patterns during osgb files rendering #1298
-
QuestionWhen I used osg to render an Files(osgb+obj)Code#include <osgDB/ReadFile>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgGA/StateSetManipulator>
#include <osg/DisplaySettings>
int main()
{
osg::DisplaySettings::instance()->setNumMultiSamples(4);
osg::ref_ptr<osg::Node> n = osgDB::readNodeFile(osgPath);
osg::ref_ptr<osg::Group> root = new osg::Group;
osg::ref_ptr<osgViewer::Viewer> viewer = new osgViewer::Viewer;
root->addChild(n);
viewer->setSceneData(root);
viewer->setUpViewInWindow(20, 20, 1400, 700);
viewer->addEventHandler(new osgGA::StateSetManipulator(viewer->getCamera()->getOrCreateStateSet()));
viewer->addEventHandler(new osgViewer::WindowSizeHandler);
viewer->addEventHandler(new osgViewer::StatsHandler);
viewer->realize();
return viewer->run();
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Convert both the .obj and .ossgb to .osgt then compare them both to see what the differences are with the various settings. This should tell you what is going on. My guess the .obj loader is defaulting to mipmapping while the .osfb dataset has been set up without mimapping for some reason. |
Beta Was this translation helpful? Give feedback.
Convert both the .obj and .ossgb to .osgt then compare them both to see what the differences are with the various settings. This should tell you what is going on. My guess the .obj loader is defaulting to mipmapping while the .osfb dataset has been set up without mimapping for some reason.