Hi Robert, There is no any error message popup. I tested on three machines which are running windows xp. They also have the same problem. I guess the problem may be related to opengl32.dll file which is at c:\windows\system32. The version of this file is 5.1 in Windows XP and 6.1 in windows 7. I tried to run the program with opengl32 5.1 version in Windows 7. It also comes out the same problem (volume filled with white). If I replaced with the 6.1 version, the problem is gone. But I cannot use the 6.1 opengl32 in windows xp since this file is linking to mscvrt.dll file and it cannot be replaced. My test code is very simple. Even the size of voxel is small, the problem is still existed.
int nx = 20; int ny = 20; int nz = 10; unsigned char *pdisp_ptr; pdisp_ptr = (unsigned char*)malloc(nx * ny *nz * 4 *(sizeof(unsigned char))); osg::ref_ptr<osgVolume::Volume> osgVolume = new osgVolume::Volume; osg::ref_ptr<osgVolume::VolumeTile> tile = new osgVolume::VolumeTile; osgVolume->addChild(tile.get()); osg::ref_ptr<osg::Image> osgImage = new osg::Image; osg::ref_ptr<osgVolume::ImageLayer> layer = new osgVolume::ImageLayer(osgImage.get()); tile->setLayer(layer.get()); tile->setVolumeTechnique(new osgVolume::RayTracedTechnique()); osgImage->setImage(nx, ny, nz, GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, pdisp_ptr, osg::Image::NO_DELETE); osg::ref_ptr<osg::RefMatrix> matrix = new osg::RefMatrix; osg::ref_ptr<osgVolume::Locator> locator = new osgVolume::Locator(*matrix.get()); layer->setLocator(locator.get()); tile->setLocator(locator.get()); locator->setTransformAsExtents(-nx/2.0, -ny/2.0, nx/2.0, ny/2.0, -nz/2.0, nz/2.0); osg::ref_ptr<osgVolume::CompositeProperty> cp = new osgVolume::CompositeProperty; layer->addProperty(cp.get()); osg::ref_ptr<osgVolume::AlphaFuncProperty> ap = new osgVolume::AlphaFuncProperty(0.1f); osg::ref_ptr<osgVolume::SampleDensityProperty> sdProperty = new osgVolume::SampleDensityProperty(0.005); osg::ref_ptr<osgVolume::TransparencyProperty> tp = new osgVolume::TransparencyProperty(1.0f); cp->addProperty(ap.get()); cp->addProperty(sdProperty.get()); cp->addProperty(tp.get()); osgViewer->setSceneData(osgVolume .get()); osgViewer->realize(); All machines in windows XP can run 3D program such as coin3D. If it is hardware or driver problem, they should have the problem to run others 3D program. Let me know if you need any information. Thanks. Regards, Clement ________________________________________ From: osg-users-boun...@lists.openscenegraph.org [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield [robert.osfi...@gmail.com] Sent: Thursday, 1 March 2012 7:59 PM To: OpenSceneGraph Users Subject: Re: [osg-users] osgVolume RayTracedTechnique problem Hi Clement, On 29 February 2012 14:26, <clement....@csiro.au> wrote: > My program is set to use RayTracedTechnique for display voxel. I tested > the same program on windows XP and windows 7 machines. Only windows 7 > machine can display the image properly. In windows XP, it shows the cube > filled with white colour. I found out the problem is related to > RayTracedTechnique. Any one got similar problem? How to fix this? Many > thanks. This is most likely to be an error in the OpenGL driver, unless your hardware is dramatically different and can't handle the shaders. As how to fix it... well you don't provide any information about any OpenGL errors being reported, what hardware you are using, what size of volume - you say voxel which is means one single data value which can't be right... Robert. _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org