I have RayTracedTechnique putting graphics on the screen, but things aren't 
rendering correctly. The culprit is the 'osg::Texture3D::LINEAR' choice that is 
used by default as the min/mag filter for the Texture3D object created by 
RayTracedTechnique. I'd like to change to NEAREST as I'm working with 
segmented/ labeled volume.   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 RayTracedTechnique.cpp to use NEAREST 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:: RayTracedTechnique > technique = new 
osgVolume:: RayTracedTechnique ();
            technique->setNumSlices(200);
            tile->setVolumeTechnique(technique);

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


Here is how the output looks when I edit RayTracedTechnique.cpp to use NEAREST 
minFilter/magFilter. This is how I expect it to look

[cid:[email protected]]



Default RayTracedTechnique.cpp (which uses LINEAR minFilter/magFilter): (Not 
expected)
[cid:[email protected]]


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


I'm using OSG 3.0. I know I need to upgrade, but I didn't see any way to do 
this even in OSG 3.6


Thanks,
-Sailesh
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to