summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-11-11 20:40:49 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-11-11 20:40:49 (GMT)
commitcf43fb60b0800d9f5bf5b7220a86afbb63aaad89 (patch)
tree7a0473b90a149fdcddd60b5ba28bbd6da7802dea
parent6bdfff91c01408616bb4715b0995a097d1b049e9 (diff)
downloaduscxml-cf43fb60b0800d9f5bf5b7220a86afbb63aaad89.zip
uscxml-cf43fb60b0800d9f5bf5b7220a86afbb63aaad89.tar.gz
uscxml-cf43fb60b0800d9f5bf5b7220a86afbb63aaad89.tar.bz2
Support for anti-aliasing
-rw-r--r--src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp b/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp
index 06a8a30..c742ec7 100644
--- a/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp
+++ b/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp
@@ -250,6 +250,15 @@ void OSGConverter::process(const SendRequest& req) {
}
}
+ bool antiAliased = true;
+ if (req.params.find("antialiased") != req.params.end()) {
+ if (iequals(req.params.find("antialiased")->second.atom, "off") ||
+ iequals(req.params.find("antialiased")->second.atom, "0") ||
+ iequals(req.params.find("antialiased")->second.atom, "false")) {
+ antiAliased = false;
+ }
+ }
+
// get the 3D scene
osg::ref_ptr<osg::Node> model = setupGraph(source, autoRotate);
if (model->asGroup()->getNumChildren() == 0) {
@@ -307,7 +316,14 @@ void OSGConverter::process(const SendRequest& req) {
traits->width = width;
traits->height = height;
traits->pbuffer = true;
+
traits->readDISPLAY();
+ if (antiAliased) {
+ traits->samples = 4; // to make anti-aliased.
+ osg::DisplaySettings* ds = osg::DisplaySettings::instance();
+ ds->setNumMultiSamples(4);
+ viewer.setDisplaySettings(ds);
+ }
osg::GraphicsContext *gc =
osg::GraphicsContext::createGraphicsContext(traits.get());