Hi Jorden, This behaviour is an artefact of the ray tracing implementation used in osgVolume::RayTracedTechnique - the rays are generated from the back face of the volume and if these fragments are culled by the z test nothing appears, even if the complete ray would be in front of the z value in the depth buffer.
There are a couple of techniques I am consider that will tackle this problem, but I don't have specific dates when I'll have a bash at implementing them, best I can say right now is within the next six months. My current project work is related to osgVolume so I will be making various improvements to it, as I work on them I'll keep the community informed. Robert. On 17 October 2013 21:38, Hovdebo, Jordan <[email protected]>wrote: > Hi all,**** > > ** ** > > I’ve been looking at using the volume rendering provided by the > RayTracedTechnique in osgVolume in combination with the display of various > geodes. What I seem to find is that when the geode and volume intersect, > the portion of the geode inside appears to be rendered on top of the volume > rather than being partially hidden inside. The problem can be reproduced > by replacing the following line in the osgvolume.cpp example:**** > > ** ** > > viewer.setSceneData(loadedModel.get());**** > > ** ** > > with:**** > > osg::ref_ptr<osg::Group> group = new osg::Group();**** > > {**** > > osg::Box * box = new osg::Box();**** > > osg::BoundingSphere boundingSphere = loadedModel->getBound();** > ** > > box->setCenter( boundingSphere.center() );**** > > const float radius = boundingSphere.radius();**** > > box->setHalfLengths( osg::Vec3( radius , 0.1f*radius , > 0.1f*radius) );**** > > osg::ShapeDrawable * drawable = new osg::ShapeDrawable( box );* > *** > > drawable->setColor( osg::Vec4(1,0,0,1) );**** > > osg::Geode * geode = new osg::Geode();**** > > geode->addDrawable(drawable);**** > > group->addChild(geode);**** > > }**** > > group->addChild(loadedModel.get());**** > > ** ** > > // set the scene to render**** > > viewer.setSceneData(group.get());**** > > ** ** > > ** ** > > The volume I’m using is a simple unsigned char binary image. When I run > this, the red box geode appears to pass through the middle of the rendered > volume, but the section inside looks the same as the section outside, a > screenshot is attached. I’ve tried various changes to the geode’s render > bin, but it did not appear to make any difference. Is there a setting that > I have missed? Or is this the expected behavior?**** > > ** ** > > thanks,**** > > Jordan**** > > ** ** > > -- **** > > Jordan Hovdebo, PhD**** > > Research officer | Agent de recherché**** > > Medical devices | Dispositifs médicaux **** > > National Research Council Canada | Conseil National de Recherches Canada** > ** > > ** ** > > 435 Ellice Avenue | 435, avenue Ellice**** > > Winnipeg, Manitoba**** > > R3B 1Y6**** > > Tel/tél: 204-984-2433**** > > Facsimile/télécopieur 204-984-7036**** > > ** ** > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

