Hi Robert, I think all my windows xp machines cannot support 3D texture. Is possible to force osg to use 2D texture on osgVolume? Thanks.
Regards, Clement ________________________________________ From: [email protected] [[email protected]] On Behalf Of [email protected] [[email protected]] Sent: Thursday, 1 March 2012 11:32 PM To: [email protected] Subject: [ExternalEmail] Re: [osg-users] osgVolume RayTracedTechnique problem Hi Robert, If I set to use RayTracedTechnique, the output message shows below: Windows Error #127: [Screen #0] ChooseMatchingPixelFormat() - wglChoosePixelFormatARB extension not found, trying GDI. R eason: The specified procedure could not be found. Rendering in software: pixelFormatIndex 3 Locator::computeLocalBounds Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL driver. Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL driver. Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..) Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL driver. Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL driver. Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..) Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL driver. Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL driver. If I set to use FixedFunctionTechnique, the output message shows below: Matrix = { 350 0 0 0 0 350 0 0 0 0 60 0 -175 -175 -30 1 } Windows Error #127: [Screen #0] ChooseMatchingPixelFormat() - wglChoosePixelFormatARB extension not found, trying GDI. R eason: The specified procedure could not be found. Rendering in software: pixelFormatIndex 3 Locator::computeLocalBounds Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL driver. Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL driver. Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..) Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL driver. Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL driver. Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..) Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL driver. Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL driver. Is it my hardware problem? It cannot support texturing? Regards, Clement ________________________________________ From: [email protected] [[email protected]] On Behalf Of Robert Osfield [[email protected]] Sent: Thursday, 1 March 2012 9:30 PM To: OpenSceneGraph Users Subject: Re: [osg-users] osgVolume RayTracedTechnique problem Hi Clement, Check the console output from the OSG for errors, the OSG itself doesn't create pop up for error reporting as it's a scene graph not a user interface tool. As for other OpenGL applications not having problems on the system, as they may well not be using 3D texture and shaders it's pretty likely that they don't test the OpenGL driver and hardware anywhere close to what the osgVolume will be doing so is of little relevance. If you want to avoid using shaders try the FixedFunctionTechnique instead of RayTracedTechnique. Robert. On 1 March 2012 09:44, <[email protected]> wrote: > 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: [email protected] > [[email protected]] On Behalf Of Robert Osfield > [[email protected]] > 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, <[email protected]> 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 > [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 _______________________________________________ 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 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

