[osg-users] Changing minFilter/magFilter of texture in osgVolume::FixedFunctionTechnique

Alex Taylor alextaylor at gmail.com
Wed Nov 18 17:11:10 PST 2015


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.* 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.*

Here is some code for context:

            osg::ref_ptr<osgVolume::Volume> volume = new osgVolume::Volume;

            osg::ref_ptr<osgVolume::VolumeTile> tile = new
 osgVolume::VolumeTile;
            volume->addChild(tile.get());

            osg::ref_ptr<osg::Image> image_3d =
createTexture3D(data,xfer_table);

            osg::ref_ptr<osgVolume::ImageLayer> layer = new
 osgVolume::ImageLayer(image_3d.get());

            tile->setLayer(layer.get());

            layer->addProperty(new osgVolume::AlphaFuncProperty(0.02f));

            osg::ref_ptr<osgVolume::FixedFunctionTechnique> technique = new
 osgVolume::FixedFunctionTechnique();
            technique->setNumSlices(200);
            tile->setVolumeTechnique(technique);

            layer->setMagFilter(osg::Texture3D::LINEAR);
            layer->setMinFilter(osg::Texture3D::LINEAR);

How can I force the Texture3D object created by FixedFunctionTechnique to
use LINEAR for minFilter/magFiltering?

I'm using OSG 3.0 (I know I need to upgrade).

Thanks,

Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20151119/26c4e78a/attachment-0002.htm>


More information about the osg-users mailing list