<div dir="ltr">Well...If you don't need too big resolution, you may try to simply oversample. Set PBUFFER at 2x or 4x of your desired res. Render and then downsample to your image res. Multisampling does not differ much from it (it just more effective with lower number of samples and its randomized sample positions). <div><br><div>Cheers,</div><div>Wojtek</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-12-09 11:46 GMT+01:00 Krzysztof Rahn <span dir="ltr"><<a href="mailto:Krzysztof.Rahn+OpenSceneGraph@gmail.com" target="_blank">Krzysztof.Rahn+OpenSceneGraph@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
Wojtek wrote:<br>
> Hi Krzysztof,<br>
><br>
> Not sure about PBO but FBO support in OSG works with multisampling. <br>
> See <br>
><br>
><br>
><br>
> Camera::attach(<br>
> BufferComponent buffer, <br>
> osg::Texture* texture, <br>
> unsigned int level, <br>
> unsigned int face, <br>
> bool mipMapGeneration, unsigned int multisampleSamples,<br>
> unsigned int multisampleColorSamples)<br>
><br>
><br>
> method.<br>
><br>
><br>
> Cheers,<br>
><br>
> Wojtek Lewandowski<br>
><br>
><br>
</span><div><div class="h5">> 2016-12-09 11:01 GMT+01:00 Krzysztof Rahn <Krzysztof.Rahn+ (Krzysztof.Rahn+)>:<br>
><br>
> > Hello everyone,<br>
> ><br>
> > I'm working on a company project that displays navigation maps for ships with OpenSceneGraph.<br>
> > The product we develop is a library that generates map images, so a customer (developer)<br>
> > can use our library to develop its own navigation system.<br>
> ><br>
> > This requires to generate a offscreen image and if possible an antialiased one.<br>
> > Unfortunately we can not generate a antialiased offscreen image.<br>
> ><br>
> > I already tried<br>
> ><br>
> > > osg::DisplaySettings::<wbr>instance()-><wbr>setNumMultiSamples(4);<br>
> > ><br>
> ><br>
> > and<br>
> ><br>
> > > traits->samples = 4;<br>
> > ><br>
> > to create a osg::GraphicsContext<br>
> > but this only works with a window generated from OpenSceneGraph or<br>
> > with a embedded context (osgViewer::<wbr>GraphicsWindowEmbedded()).<br>
> ><br>
> > I know we can enable "GL_LINE_SMOOTH". This is what we use at this moment and it is<br>
> > working with offscreen rendering but we really need multisampling for better results (or any other form of anitaliasing).<br>
> ><br>
> > I created a small peace of C++ sourcecode on a Linux system that does offscreen rendering (with a pbuffer)<br>
> > into a tga image file (I think you also need OpenSceneGraph plugins for that to work),<br>
> > so you can roughly see how we use it at this moment (without GL_LINE_SMOOTH to keep it simple).<br>
> ><br>
> > Of course I looked into the examples and this peace of code is based of one of them.<br>
> > But I could not spot anything in the examples that could help me.<br>
> > I also searched in the forum on this topic but most threads about offscreen rendering don't consider if multisampling is enabled.<br>
> ><br>
> > I would really appreciate if someone could help us with this small code in the right direction<br>
> > or make any suggestion if there is any other way to solve this if OpenSceneGraph is not able to do this.<br>
> ><br>
> > A main.cpp and a CMakeLists.txt should be attached to this post.<br>
> ><br>
> > Thank you very much,<br>
> > Kris<br>
> ><br>
> > ------------------<br>
> > Read this topic online here:<br>
</div></div>> > <a href="http://forum.openscenegraph.org/viewtopic.php?p=69644#69644" rel="noreferrer" target="_blank">http://forum.openscenegraph.<wbr>org/viewtopic.php?p=69644#<wbr>69644</a> (<a href="http://forum.openscenegraph.org/viewtopic.php?p=69644#69644" rel="noreferrer" target="_blank">http://forum.openscenegraph.<wbr>org/viewtopic.php?p=69644#<wbr>69644</a>)<br>
> ><br>
> ><br>
> ><br>
> ><br>
> > Attachments:<br>
> > <a href="http://forum.openscenegraph.org//files/cmakelists_664.txt" rel="noreferrer" target="_blank">http://forum.openscenegraph.<wbr>org//files/cmakelists_664.txt</a> (<a href="http://forum.openscenegraph.org//files/cmakelists_664.txt" rel="noreferrer" target="_blank">http://forum.openscenegraph.<wbr>org//files/cmakelists_664.txt</a>)<br>
> > <a href="http://forum.openscenegraph.org//files/main_667.cpp" rel="noreferrer" target="_blank">http://forum.openscenegraph.<wbr>org//files/main_667.cpp</a> (<a href="http://forum.openscenegraph.org//files/main_667.cpp" rel="noreferrer" target="_blank">http://forum.openscenegraph.<wbr>org//files/main_667.cpp</a>)<br>
> ><br>
> ><br>
> > ______________________________<wbr>_________________<br>
> > osg-users mailing list<br>
> > ()<br>
> > <a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a> (<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a>)<br>
> ><br>
><br>
><br>
> ------------------<br>
> Post generated by Mail2Forum<br>
<br>
<br>
I guess I will need to test how FBO work. I though that pbuffer and FBO will not make a big difference.<br>
Thank you.<br>
<span class=""><br>
------------------<br>
Read this topic online here:<br>
</span><a href="http://forum.openscenegraph.org/viewtopic.php?p=69649#69649" rel="noreferrer" target="_blank">http://forum.openscenegraph.<wbr>org/viewtopic.php?p=69649#<wbr>69649</a><br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.<wbr>openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a><br>
</div></div></blockquote></div><br></div>