Re: [osg-users] osg::Texture and stateSets
Hi, I am already looked at the optimizer. But still I cannot access my Texture ;(. stateset.getTextureAttributeList() is always null. Why? I can call the geode Name. I can call the Geometry - but no Texture!!! My OSG File: Geode { DataVariance DYNAMIC name cube.osg nodeMask 0x cullingActive TRUE num_drawables 6 Geometry { DataVariance DYNAMIC StateSet { DataVariance DYNAMIC rendering_hint OPAQUE_BIN renderBinMode INHERIT GL_CULL_FACE OFF GL_LIGHTING ON textureUnit 0 { GL_TEXTURE_2D ON Texture2D { DataVariance STATIC file images.jpg wrap_s CLAMP wrap_t CLAMP wrap_r CLAMP min_filter LINEAR_MIPMAP_LINEAR mag_filter LINEAR maxAnisotropy 1 useHardwareMipMapGeneration TRUE unRefImageDataAfterApply FALSE internalFormatMode USE_IMAGE_DATA_FORMAT } } } .. Some Ideas?? 冯晨 wrote: Hi, I think osgUtil::optimizer::TextureVisitor should solve your problem.:) Good luck. 在2008-07-09 22:53:21,ka Ming [EMAIL PROTECTED] 写道: Hi, I got a Probel with osg Files, the File structure looks like: Group{ Geode{ Geometry{ StateSet{ Texture{ } } } } Geode{ Geometry{ StateSet{ Texture{ } } } } } The problem is if I try to traverse my SceneGraph I get the names of my geodes, but if I check the TextureAttributeList osg::StateSet::TextureAttributeList texAttrList = stateSet- getTextureAttributeList(); this list is empty. Why is this List empty, did I forget something? I want to access all Textures!! Thanks Ming Gesendet von Yahoo! Mail. Dem pfiffigeren Posteingang. 网易首款免费3D网游“天下2”,6月6日激情公测 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org __ Gesendet von Yahoo! Mail. Dem pfiffigeren Posteingang. http://de.overview.mail.yahoo.com___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::Texture and stateSets
ka Ming schrieb: I am already looked at the optimizer. But still I cannot access my Texture ;(. stateset.getTextureAttributeList() is always null. Why? I can call the geode Name. I can call the Geometry - but no Texture!!! Your texture is part of a stateset attached to the Geometry not to the Geode. query the geometry for the stateset and not the geode. Cheers, Stephan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::Texture and stateSets
Hi, El Jueves 10 Julio 2008ES 14:48:48 ka Ming escribió: Hi, I am already looked at the optimizer. But still I cannot access my Texture ;(. stateset.getTextureAttributeList() is always null. Why? I can call the geode Name. I can call the Geometry - but no Texture!!! I'm having a similar problem. First I developed my own visitor, but then I used osgUtil::Optimizer::TextureVisitor, but the method apply(osg::Texture texture) is never called. Short code below: class ImageVisitor2: public osgUtil::Optimizer::TextureVisitor { public: std::setosg::Image* images; ImageVisitor2(): osgUtil::Optimizer::TextureVisitor(true, true, true, true, true, 0.0) {} void apply(osg::Texture texture) { images.insert(texture.getImage(0)); } void escribirImagenes() { for_each(images.begin(), images.end(), imagenToDisk); } }; ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::Texture and stateSets
Hi, I think osgUtil::optimizer::TextureVisitor should solve your problem:) Good luck. 在2008-07-09 22:53:21,ka Ming [EMAIL PROTECTED] 写道: Hi, I got a Probel with osg Files, the File structure looks like: Group{ Geode{ Geometry{ StateSet{ Texture{ } } } } Geode{ Geometry{ StateSet{ Texture{ } } } } } The problem is if I try to traverse my SceneGraph I get the names of my geodes, but if I check the TextureAttributeList osg::StateSet::TextureAttributeList texAttrList = stateSet- getTextureAttributeList(); this list is empty. Why is this List empty, did I forget something? I want to access all Textures!! Thanks Ming Gesendet von Yahoo! Mail. Dem pfiffigeren Posteingang.___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org