From: Andreas K. <ko...@hl...> - 2004-06-23 15:02:11
|
Hi! On Wed, 2004-06-23 at 15:01, si...@ti... wrote: > I've got some problems when I try to use antialiasing. > I add the follow chunks to every MaterialGroup node of the scenegraph. > > osg::PolygonChunkPtr poly=osg::PolygonChunk::create(); > osg::BlendChunkPtr blend=osg::BlendChunk::create(); > > beginEditCP(blend); > blend->setSrcFactor(GL_SRC_ALPHA); > blend->setDestFactor(GL_ONE_MINUS_SRC_ALPHA); > blend->setColor(osg::Color4f(0,0,0,0)); > endEditCP(blend); > > beginEditCP(poly); > poly->setSmooth(true); > endEditCP(poly); > > So the model appears with some transparent lines: that lines are the wireframe > > but I don't want to see the wireframe. > If I change the DestFactor to GL_ONE, the model becomes transparent.Do you > > know how to solve this problem? Is there another way to use antialiasing > with > OpenSG? Normally you do antialiasing by selecting a multisampling GL-context. Then you can do the following: void setMultisampling(bool on) { #if !defined(GL_MULTISAMPLE_SGIS) && !defined(GL_MULTISAMPLE_ARB) #ifndef _WIN32 #warning "No Multisampling support detected, disabling" #endif #else if (multisampling) { #ifdef GL_MULTISAMPLE_SGIS glEnable(GL_MULTISAMPLE_SGIS); #endif //GL_MULTISAMPLE_SGIS #ifdef GL_MULTISAMPLE_ARB glEnable(GL_MULTISAMPLE_ARB); #endif //GL_MULTISAMPLE_ARB } else { #ifdef GL_MULTISAMPLE_SGIS glDisable(GL_MULTISAMPLE_SGIS); #endif //GL_MULTISAMPLE_SGIS #ifdef GL_MULTISAMPLE_ARB glDisable(GL_MULTISAMPLE_ARB); #endif //GL_MULTISAMPLE_ARB } #endif //!defined(GL_MULTISAMPLE_SGIS) && !defined(GL_MULTISAMPLE_ARB) } also, often you have to set an environment variable, in the NVIDIA (under Linux) case __GL_FSAA_MODE (see the NVIDIA docs) -- Andreas Kopecki High Performance Computing Center (HLRS) Visualisation Department Tel. ++49-711-6855789 Allmandring 30a, D-70550 Stuttgart ko...@hl... http://www.hlrs.de/ ------------------------------------------------------------------------- |