Re: [osg-users] GL_POLYGON could not using osgFX::Bumpmapping?
Thanks Sebastian. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] SubloadCallback and PBO cleanup
Hi all! In my OSG application I need to continuously update small parts of 2D texture. So I use osg::Texture2D::SubloadCallback: class MyCallback : public osg::Texture2D::SubloadCallback { /* initialize texture */ void load(const Texture2D texture,State state) const { /* get pixel buffer object extension functions */ osg::PixelBufferObject::Extensions* ext = osg::PixelBufferObject::getExtensions(state.getContextID(), true); /* generate and cache PBO ID */ ext-glGenBuffers(1, m_pbo); if(m_pbo) { /* bind buffer */ ext-glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, m_pbo); /* load texture initial data */ /* unbind buffer */ ext-glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0); } } void subload(const osg::Texture2D tex, osg::State state) const { /* bind buffer */ ext-glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, m_pbo); /* update some small part of the texture */ /* unbind buffer */ ext-glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0); } private: GLuint m_pbo; }; And everything works fine until the cleanup stage. In the code above I've allocated a Pixel Buffer Object. Where should I place it's deletion function (something like ext-glDeleteBuffers(1, m_pbo))? Or I should generate/delete it on every subload call with performance penalty? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] SubloadCallback and PBO cleanup
01.04.2011 11:41, Yurii Monakov wrote: And everything works fine until the cleanup stage. In the code above I've allocated a Pixel Buffer Object. Where should I place it's deletion function (something like ext-glDeleteBuffers(1,m_pbo))? Or I should generate/delete it on every subload call with performance penalty? Hi Yurii, Instead manual generation/destructin of buffer objects use osg::BufferObject. BTW using osg::BufferObject solve problems of your code with multiple contexts. Mikhail. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] G++ version problem
Hi Grahame, On Fri, Apr 1, 2011 at 4:20 AM, Grahame Bowland grah...@fugro-fsi.com.au wrote: Thanks very much, that was it! gcc-4.4.3 was failing the _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS test, which succeeded for 4.5.2. That changed the Atomic header file, which presumably changed the size of a bunch of important classes. Making sure that test fails solves my problem. So binary compatibility for the build was the issue, although not directly due to gcc build binary incompatible libs, but different choosing different implementations on the OSG side. The gcc _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS test should pass for both gcc 4.4.3 and 4.5.2. I used plenty of gcc versions prior to 4.4.3 and it worked fine. I'm currently using gcc 4.4.5 on this system and it pick up on _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS fine. This make me wonder why your build with 4.4.3 isn't picking up on the atomic support correctly. Has anyone else had problems with picking up on the atmoic support? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] SubloadCallback and PBO cleanup
Hi Mikhail, Thank you for your answer. So I should inherit from osg::BufferObject class and implement compileObject() method? Yurii 2011/4/1 Mikhail I. Izmestev izmmish...@gmail.com: 01.04.2011 11:41, Yurii Monakov wrote: And everything works fine until the cleanup stage. In the code above I've allocated a Pixel Buffer Object. Where should I place it's deletion function (something like ext-glDeleteBuffers(1,m_pbo))? Or I should generate/delete it on every subload call with performance penalty? Hi Yurii, Instead manual generation/destructin of buffer objects use osg::BufferObject. BTW using osg::BufferObject solve problems of your code with multiple contexts. Mikhail. ___ 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
Re: [osg-users] Methods definition problem passing 2.8.3 - 2.9.12
Hi, Thanks, this is usefull. Thank you! Cheers, Dario -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=38153#38153 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgQt::QWidgetImage and Key/Mouse events
I put it again if the previous post goes unnoticed... Why using osgQt::QWebViewImage and osgWidget::Browser not me run this method? Code: osg::ref_ptrosgQt::QWebViewImage image = new osgQt::QWebViewImage(); image-getQWebView()-setUrl(QString(url.c_str())); image-getQWebView()-settings()-setAttribute(QWebSettings::JavascriptEnabled, true); image-getQWebView()-settings()-setAttribute(QWebSettings::PluginsEnabled, true); image-getQWebPage()-setLinkDelegationPolicy(QWebPage::DelegateAllLinks); float pos[] = {-8.2,4.0,1.60}; //pos float widthVec[] = {1.0,0.0,0.17}; //wVec float heightVec[] = {-0.12,0.0,1.0}; // hVec float wSize = 3.4; //wRes float hSize = 1.85; //hRes osgWidget::GeometryHints hints(osg::Vec3(0.0f,0.0f,0.0f),//pos osg::Vec3(widthVec[0]*wSize,widthVec[2]*wSize,widthVec[1]*wSize),//wVec osg::Vec3(heightVec[1]*hSize,heightVec[0]*hSize,heightVec[2]*hSize),//hVec osg::Vec4(1.0f,1.0f,1.0f,1.0f), //color osgWidget::GeometryHints::IGNORE_DOCUMENT_ASPECT_RATIO);//AspectRatioPolicy osgWidget::Browser* browser = new osgWidget::Browser(); browser-setName(MyBrowser); browser-assign(image.get(), hints); webBrowserTrans-addChild(browser); BrowserHandler* handler = new BrowserHandler(image.get());//, texture, camera); browser-setEventCallback(handler); browser-setCullCallback(handler); -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=38155#38155 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] SubloadCallback and PBO cleanup
On 04/01/11 12:02, Yurii Monakov wrote: Hi Mikhail, Thank you for your answer. So I should inherit from osg::BufferObject class and implement compileObject() method? I think in your case you can try to use osg::PixelDataBufferObject as it is. Mikhail. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Fast VectorArray inizialization.
Hi all, I have some code like this: float coordinates[] ... ... an external source fill the previous array ... ... osg::ref_ptrosg::Vec3Array vertices = new osg::Vec3Array(); for (int i = 0; i 3 * numPoints; i += 3) { float x = coordinates[i]; float y = coordinates[i+1]; float z = coordinates[i+2]; vertices-push_back(osg::Vec3(x, y, z)); } modelGeometry-setVertexArray(vertices); I'd rather do something like this: modelGeometry-setVertexArray_FromCArray(coordinates); Is it possible? How? --- Best regards, Giulio -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=38157#38157 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] SubloadCallback and PBO cleanup
Thank you! Yurii. 2011/4/1 Mikhail I. Izmestev izmmish...@gmail.com: On 04/01/11 12:02, Yurii Monakov wrote: Hi Mikhail, Thank you for your answer. So I should inherit from osg::BufferObject class and implement compileObject() method? I think in your case you can try to use osg::PixelDataBufferObject as it is. Mikhail. ___ 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
Re: [osg-users] Fast VectorArray inizialization.
Hi Giulio, All osg::Vec*Array() are subclassed from the std::vector so you have all the usual std::vector methods available. For examples of different ways of initialization the array see the osggeometry example. Robert. On Fri, Apr 1, 2011 at 9:57 AM, Giulio De Vecchi giulio.devec...@libero.it wrote: Hi all, I have some code like this: float coordinates[] ... ... an external source fill the previous array ... ... osg::ref_ptrosg::Vec3Array vertices = new osg::Vec3Array(); for (int i = 0; i 3 * numPoints; i += 3) { float x = coordinates[i]; float y = coordinates[i+1]; float z = coordinates[i+2]; vertices-push_back(osg::Vec3(x, y, z)); } modelGeometry-setVertexArray(vertices); I'd rather do something like this: modelGeometry-setVertexArray_FromCArray(coordinates); Is it possible? How? --- Best regards, Giulio -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=38157#38157 ___ 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
Re: [osg-users] Fast VectorArray inizialization.
Hi Giulio, Am 01.04.2011 10:57, schrieb Giulio De Vecchi: Hi all, I have some code like this: float coordinates[] ... ... an external source fill the previous array ... ... osg::ref_ptrosg::Vec3Array vertices = new osg::Vec3Array(); for (int i = 0; i 3 * numPoints; i += 3) { float x = coordinates[i]; float y = coordinates[i+1]; float z = coordinates[i+2]; vertices-push_back(osg::Vec3(x, y, z)); } modelGeometry-setVertexArray(vertices); I'd rather do something like this: modelGeometry-setVertexArray_FromCArray(coordinates); Is it possible? How? Yes, have a look at the example osgsharedarray. Of course you have to make sure the the array is not freed until the last draw is finished. --- Best regards, Giulio Cheers, Peter -- Vorstand/Board of Management: Dr. Bernd Finkbeiner, Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech Vorsitzender des Aufsichtsrats/ Chairman of the Supervisory Board: Michel Lepert Sitz/Registered Office: Tuebingen Registergericht/Registration Court: Stuttgart Registernummer/Commercial Register No.: HRB 382196 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] G++ version problem
Robert Osfield writes: Hi Grahame, On Fri, Apr 1, 2011 at 4:20 AM, Grahame Bowland grah...@fugro-fsi.com.au wrote: Thanks very much, that was it! gcc-4.4.3 was failing the _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS test, which succeeded for 4.5.2. That changed the Atomic header file, which presumably changed the size of a bunch of important classes. Making sure that test fails solves my problem. So binary compatibility for the build was the issue, although not directly due to gcc build binary incompatible libs, but different choosing different implementations on the OSG side. Well, one never knows about ABI issues, but I was optimist because almost all linux distributions carry software compiled with several versions of GCC. Here in my Debian Squeeze desktop I have three versions of gcc installed simultaneosly by different packages, with the lastest one (4.4) as the default. The gcc _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS test should pass for both gcc 4.4.3 and 4.5.2. I used plenty of gcc versions prior to 4.4.3 and it worked fine. I'm currently using gcc 4.4.5 on this system and it pick up on _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS fine. This make me wonder why your build with 4.4.3 isn't picking up on the atomic support correctly. Has anyone else had problems with picking up on the atmoic support? A reason can be the fact that some systems select different default architectures. If you are using a 32 bit system instead of amd64, and say your compiler is set by default to produce 586 or 686 compatible binaries, chances are that the gcc builtins are deactivated. You would have to specify the target architecture explicitly, eg. -march=native. Those default configurations can be checked with `gcc -v'. -- Alberto ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Fast VectorArray inizialization.
Thanks a lot! This is exactly what I was looking for. Best regards. Giulio -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=38162#38162 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using Vertex Attributes
Things seem to be working today, although I need to double check everything to make sure I'm not dreaming. glUseProgram errors only happen on ATI hardware with Catalyst 11.2 drivers - I haven't tried 11.3 yet. My nvidia setup seems fine. As for the GL context version, source code modification isn't required, as it is possible to specify the version through osg::GraphicsContext::Traits. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=38164#38164 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Y up to Z up
On 04/01/2011 08:36 AM, Aitor Ardanza wrote: snip Sorry but I need to disconnect with this issue until Monday... I haven't gotten the animations work well, even putting Y up or with the formula R' = M * R * Minv... On Monday I will try to summarize all my tests with pictures and videos ... I can sympathize :-) It took me a week to get a tracking system with a Z-down/X forward coordinate system to play well with my Z-up/Y-forward apps. Getting different coordinate systems to play well together is probably one of the hardest things to get right. Fortunately, you just have to get it right once, then you can put the code inside a black box and never look at it again :-) --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] fbx animation
thank you so much for this, but now i have a problem: how I can get the library osgDB/XmlParser? another custion: the argument of AnimationSplitter is my .fbx or is something else? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=38166#38166 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [build] Build Issues Trunk 2.9.12 and GL3
Hi, there are Build Issues with the current Trunk and the GL3 Option osgText does not build due to glPushAttrib / glPopAttrib in Text::renderWithDelayedDepthWrites. osgSim OverlayNode Serializer uses Deprecated glTexEnv GL_DECAL Enum. Fix for Text::renderWithDelayedDepthWrites: void Text::renderWithDelayedDepthWrites(osg::State state, const osg::Vec4 colorMultiplier) const { #if !defined(OSG_GLES1_AVAILABLE) !defined(OSG_GLES2_AVAILABLE) !defined(OSG_GL3_AVAILABLE) glPushAttrib( _enableDepthWrites ? (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) : GL_DEPTH_BUFFER_BIT); // Render to color buffer without writing to depth buffer. glDepthMask(GL_FALSE); drawTextWithBackdrop(state,colorMultiplier); // Render to depth buffer if depth writes requested. if( _enableDepthWrites ) { glDepthMask(GL_TRUE); glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); drawTextWithBackdrop(state,colorMultiplier); } glPopAttrib(); #else OSG_NOTICE Warning: Text::renderWithDelayedDepthWrites(..) not implemented. std::endl ; #endif } Fix for osgSim::OverlayNode Serializer ( not sure if this one is sufficient, but works ) #include osgSim/OverlayNode #include osgDB/ObjectWrapper #include osgDB/InputStream #include osgDB/OutputStream REGISTER_OBJECT_WRAPPER( osgSim_OverlayNode, new osgSim::OverlayNode, osgSim::OverlayNode, osg::Object osg::Node osg::Group osgSim::OverlayNode ) { BEGIN_ENUM_SERIALIZER( OverlayTechnique, OBJECT_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY ); ADD_ENUM_VALUE( OBJECT_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY ); ADD_ENUM_VALUE( VIEW_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY ); ADD_ENUM_VALUE( VIEW_DEPENDENT_WITH_PERSPECTIVE_OVERLAY ); END_ENUM_SERIALIZER(); // _overlayTechnique ADD_OBJECT_SERIALIZER( OverlaySubgraph, osg::Node, NULL ); // _overlaySubgraph #if !defined(OSG_GLES1_AVAILABLE) !defined(OSG_GLES2_AVAILABLE) !defined(OSG_GL3_AVAILABLE) ADD_GLENUM_SERIALIZER( TexEnvMode, GLenum, GL_DECAL ); // _texEnvMode #endif ADD_UINT_SERIALIZER( OverlayTextureUnit, 1 ); // _textureUnit ADD_UINT_SERIALIZER( OverlayTextureSizeHint, 1024 ); // _textureSizeHint ADD_VEC4_SERIALIZER( OverlayClearColor, osg::Vec4() ); // _overlayClearColor ADD_BOOL_SERIALIZER( ContinuousUpdate, false ); // _continuousUpdate ADD_DOUBLE_SERIALIZER( OverlayBaseHeight, -100.0 ); // _overlayBaseHeight } Moreover, think it would be a good Idea to add an Option to CMakeLists whether to build osgQT, as QT includes GL.h. No fix for that :-) For completeness, this Thread explains how to build OSG with GL3 option on Windows ( tweak of osg/GL , tweak of CMakeLists.txt ) : http://forum.openscenegraph.org/viewtopic.php?t=7322 Cheers, ParticlePeter -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=38167#38167 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Build Issues Trunk 2.9.12 and GL3
Hi, hm ... current Trunk Version is 2.9.9 after it was 2.9.11 already ??? My mistake with the topic ... ? Cheers, Peter -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=38168#38168 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Compiling iOS / iPhone - FreeType build
Thanks Tom. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=38169#38169 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Way off topic: Osborne PC 30th birthday
http://www.wired.com/gadgetlab/2011/04/portable-pc-osborne/?utm_source=feedburnerutm_medium=feedutm_campaign=Feed%3A+wired%2Findex+%28Wired%3A+Index+3+%28Top+Stories+2%29%29utm_content=Google+Feedfetcher -- -Paul Martz Skew Matrix Software http://www.skew-matrix.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org