<div dir="ltr"><div><div><div><div>Hi Alex,<br><br></div>I have just looked at the code and for some reason the FixedFunctionTechnque is enforcing NEAREST, not sure why. I haven't touched this code particular bit of code for a long while.<br><br></div>FixedFunctionTechnique is a fallback implementation though, you really should be using RayTracedTechnique as the results will be much better.<br><br></div>And yes you should upgrade to OSG-3.4. osgVolume has a number of improvements as well as the rest of the OSG being more mature.<br><br></div>Robert.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 19 November 2015 at 01:11, Alex Taylor <span dir="ltr"><<a href="mailto:alextaylor@gmail.com" target="_blank">alextaylor@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;line-height:normal;margin-top:0px;margin-bottom:0px"><div style="margin-top:0px;margin-bottom:0px">This is probably a silly question, but I'm playing around with the osgVolume nodekit. I have FixedFunctionTechnique putting graphics on the screen, but things are rendering more "blocky" than I would like. The culprit is the NEAREST neighbor choice that is used by default as the min/mag filter for the Texture3D object created by FixedFunctionTechnique. I'd like to change to LINEAR. The problem I'm seeing is that when I use the setMinFilter and setMaxFilter methods on the associated ImageLayer, things aren't getting updated for some reason.<b> I know that's what's going on because if I actually edit the code in FixedFunctionTechnique to use LINEAR for the min/max filter on the Texture3D, I get the texture I want on the screen.</b><br></div><div><font face="Calibri,Arial,Helvetica,sans-serif"><div style="margin-top:0px;margin-bottom:0px"><br></div><div style="margin-top:0px;margin-bottom:0px">Here is some code for context:<br></div><div style="margin-top:0px;margin-bottom:0px"><br></div><div style="margin-top:0px;margin-bottom:0px"><font face="Courier New,monospace"> osg::ref_ptr<osgVolume::Volume> volume = </font><font face="Courier New,monospace">new</font><font face="Courier New,monospace"> osgVolume::Volume;</font></div><div style="margin-top:0px;margin-bottom:0px"><font face="Courier New,monospace"> </font><br></div><div style="margin-top:0px;margin-bottom:0px"><font face="Courier New,monospace"> osg::ref_ptr<osgVolume::VolumeTile> tile = </font><font face="Courier New,monospace">new</font><font face="Courier New,monospace"> osgVolume::VolumeTile;</font></div><div style="margin-top:0px;margin-bottom:0px"><font face="Courier New,monospace"> volume->addChild(tile.get());</font></div><div style="margin-top:0px;margin-bottom:0px"> </div><div style="margin-top:0px;margin-bottom:0px"><font face="Courier New,monospace"> osg::ref_ptr<osg::Image> image_3d = createTexture3D(data,xfer_table);</font></div><div style="margin-top:0px;margin-bottom:0px"> </div><div style="margin-top:0px;margin-bottom:0px"><font face="Courier New,monospace"> osg::ref_ptr<osgVolume::ImageLayer> layer = </font><font face="Courier New,monospace">new</font><font face="Courier New,monospace"> osgVolume::ImageLayer(image_3d.get());</font></div><div style="margin-top:0px;margin-bottom:0px"> </div><div style="margin-top:0px;margin-bottom:0px"><font face="Courier New,monospace"> tile->setLayer(layer.get());</font></div><div style="margin-top:0px;margin-bottom:0px"> </div><div style="margin-top:0px;margin-bottom:0px"><font face="Courier New,monospace"> layer->addProperty(</font><font face="Courier New,monospace">new</font><font face="Courier New,monospace"> osgVolume::AlphaFuncProperty(0.02f));</font></div><div style="margin-top:0px;margin-bottom:0px"> </div><div style="margin-top:0px;margin-bottom:0px"><font face="Courier New,monospace"> osg::ref_ptr<osgVolume::FixedFunctionTechnique> technique = </font><font face="Courier New,monospace">new</font><font face="Courier New,monospace"> osgVolume::FixedFunctionTechnique();</font></div><div style="margin-top:0px;margin-bottom:0px"><font face="Courier New,monospace"> technique->setNumSlices(200);</font></div><div style="margin-top:0px;margin-bottom:0px"><font face="Courier New,monospace"> tile->setVolumeTechnique(technique);</font></div><div style="margin-top:0px;margin-bottom:0px"> </div><div style="margin-top:0px;margin-bottom:0px"><font face="Courier New,monospace"> layer->setMagFilter(osg::Texture3D::LINEAR);</font></div><div style="margin-top:0px;margin-bottom:0px"><font face="Courier New,monospace"> layer->setMinFilter(osg::Texture3D::LINEAR);</font><br></div><div style="margin-top:0px;margin-bottom:0px"><br></div><div style="margin-top:0px;margin-bottom:0px">How can I force the Texture3D object created by FixedFunctionTechnique to use LINEAR for minFilter/magFiltering?</div><div style="margin-top:0px;margin-bottom:0px"><br></div><div style="margin-top:0px;margin-bottom:0px">I'm using OSG 3.0 (I know I need to upgrade).</div><div style="margin-top:0px;margin-bottom:0px"><br></div><div style="margin-top:0px;margin-bottom:0px">Thanks,</div><div style="margin-top:0px;margin-bottom:0px"><br></div><div style="margin-top:0px;margin-bottom:0px">Alex</div></font></div></div></div>
<br>_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
<br></blockquote></div><br></div>