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

Robert Osfield robert.osfield at gmail.com
Thu Nov 19 00:16:07 PST 2015


Hi Alex,

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.

FixedFunctionTechnique is a fallback implementation though, you really
should be using RayTracedTechnique as the results will be much better.

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.

Robert.

On 19 November 2015 at 01:11, Alex Taylor <alextaylor at gmail.com> wrote:

> 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
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20151119/c8361a23/attachment-0003.htm>


More information about the osg-users mailing list