[osg-users] Shader Problem
Hi all, Are there any ways to remove the shader during runtime? I've tried the removeShader function but the effect of the shader is still applied to my models (e.g tank) i.e. the appearance of the models do not go back to the state before shader is applied. Regards,Cg _ Check out Barclays Premier League exclusive video clips here! http://fc.sg.msn.com/index.aspx___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] (no subject)
Hi Pecoraro thank to spot the bug please send your submissions on osg-submissions the next time. after review the original code, at line Optimizer.cpp:1561 lod-getNumRanges() is used to know how many iteration will be done in the for loop, and getNumRanges have to be equal to getNumChild, so lod-getChild(i) at line 1563 is not the problem. Perhaps you LOD is not synchronised (num of children and num of range are not equal)i don't know why or how is possible. Anyway, in a case of a PagedLOD, only the code of LOD is used, so not special case for a PagedLOD. correct me if i'm wrong. Cheers David Callu 2008/6/6 Pecoraro, Alexander N [EMAIL PROTECTED]: I think there is a bug in the osgUtil::Optimizer::CombineLODVisitor - at line 1530 of Optimizer.cpp it does a dynamic_cast on and osg::Node* to osg::LOD* and then at line 1563 it calls getChild(i) (even if getNumChildren() == 0) on the dynamically casted LOD node. This works fine when the node is an LOD node, but when it is a PagedLOD node then it causes in invalid access to the _children vector. I attached a screen shot to show what I mean. This situation would only ocurr when a PagedLOD node was a sibling of an LOD node, which is probably why it hasn't been spotted before. Not sure if this is the accepted way to submit a fix, but anyway I made a fix to the Optimizer code (version 2.4) and attached it to the email. Alex ___ 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
[osg-users] Viewer Hanging Problem (Without the main viewer loop)
Hi Everybody, My problem is that when another window is instantly opened up on the viewer pane (I use OSG within MFC app. without the main viewer loop, I manipulate the camera manually and call frame() whenever necessary because %100 CPU usage is not always allowed, so I can not take advantage of any manipulators in osgGA) Any ideas? Thanks and Regards to all, Can ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Shader Problem
hi CG when you remove a shader, osg::Program need to be relinked. this is done by osgUtil::GLObjectVisitor in osgViewer::Renderer::draw method. So this seem can be done at runtime. Which OSG version did you use ? Did you use osgViewer ? David Callu 2008/6/12 CG [EMAIL PROTECTED]: Hi all, Are there any ways to remove the shader during runtime? I've tried the removeShader function but the effect of the shader is still applied to my models (e.g tank) i.e. the appearance of the models do not go back to the state before shader is applied. Regards, Cg -- Chat online and in real-time with friends and family! Windows Live Messenger http://get.live.com/messenger/overview ___ 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] BlueMarble example
Hi Michael osgDB::ImageOptions class is in the SVN trunk. I can't found osgbluemarble in the SVN trunk so no idea what is wrong. perhaps an include issue... can you send an exact error message. David Callu 2008/6/12 Michael W. Hall [EMAIL PROTECTED]: I was using some code from the osgbluemarble.cpp example. I am getting an error stating that ImageOptions is not a member of osgDB. I have been looking in the documentation on the website and have not found anything. Can someone tell me what has replaced this or where it is now? Thanks. ___ 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] Shader Problem
Hi David, I'm using osg 2.4 and osgViewer. Regards, Cg Date: Thu, 12 Jun 2008 11:09:49 +0200From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: Re: [osg-users] Shader Problemhi CGwhen you remove a shader, osg::Program need to be relinked.this is done by osgUtil::GLObjectVisitor in osgViewer::Renderer::draw method.So this seem can be done at runtime.Which OSG version did you use ?Did you use osgViewer ?David Callu 2008/6/12 CG [EMAIL PROTECTED]: Hi all, Are there any ways to remove the shader during runtime? I've tried the removeShader function but the effect of the shader is still applied to my models (e.g tank) i.e. the appearance of the models do not go back to the state before shader is applied. Regards,Cg Chat online and in real-time with friends and family! Windows Live Messenger___osg-users mailing [EMAIL PROTECTED]://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _ Easily publish your photos to your Spaces with Photo Gallery. http://get.live.com/photogallery/overview___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgmovie error message
Hi, Dieter Pfeffer schrieb: I get an application error (The instruction at ... referenced memory at The memory could not be read.) when I stop my application with esc. When I run in debug mode, it breaks in QTUtils.cpp with the message Unhandled exception .. Access violation reading location ... My application has parts of osgmovie included and I can reproduce this message in osgmovied (windows xp, osg2.3.6) when I comment in the function myCreateTexturedQuadGeometry () the line // pictureQuad-getOrCreateStateSet()-setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON); for useTextureRectangle It makes no sense to do this and I don't do it in my application, but I am trying to find out the reason for the application error. You can compare the output of osgmovie when setting the notify-level to DEBUG_INFO, perhaps there's some info what's going wrong. Quicktime does not like to be unloaded from a DLL, perhaps this is your problem. We use a workaround for this: the qt-plugin observes all quicktime-movies and unloads quicktime when the last quicktime-movie-reference got out of scope to prevent the crash-on-exit. HTH, Stephan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Viewer Hanging Problem (Without the main viewer loop)
Sorry, and the rest of the definition : .. for example a task manager, viewer hangs and does not respond to any commands. Is it wrong to use OSG without the main viewer loop. 2008/6/12 Can T. Oguz [EMAIL PROTECTED]: Hi Everybody, My problem is that when another window is instantly opened up on the viewer pane (I use OSG within MFC app. without the main viewer loop, I manipulate the camera manually and call frame() whenever necessary because %100 CPU usage is not always allowed, so I can not take advantage of any manipulators in osgGA) Any ideas? Thanks and Regards to all, Can ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] bug in last SVN VPB????
also, when using the no-interpolate option, the height image is flipped vertically From: [EMAIL PROTECTED] To: osg-users@lists.openscenegraph.org Date: Thu, 12 Jun 2008 11:06:06 +0200 Subject: [osg-users] bug in last SVN VPB i don´t know if you are aware of this but i think i´ve found a bug in last SVN version of vpb (rev 911) we´re generating some pagedlod islands with osgdem and when using the '--no-interpolate-terrain' option strange effects appear in the screen it looks like the pagedlod 'sub-objects' geometry is not matching perfectly we wanted to reduce the polygon density cause we had a very very high triangle count that was slowing down things. we have a lot of written code for PagedLOD trees so it needs to be a pagedLOD. We downscale our original high resolution heightmaps to 10% and used the '--no-interpolate--terrain' to tell the osgdem not to add extra geometry this is the final command 'c:\osg\vpb\osgdem.exe' --xx 100 --yy 100 -d height_map_downscale_10.tif --xx 0.5 --yy 0.5 --xt 0 --yt 20626.5 -t LG_200703_50cm_1_1.tif --xx 0.5 --yy 0.5 --xt 6875.5 --yt 20626.5 -t LG_200703_50cm_1_2.tif --xx 0.5 --yy 0.5 --xt 13751 --yt 20626.5 -t LG_200703_50cm_1_3.tif --xx 0.5 --yy 0.5 --xt 20626.5 --yt 20626.5 -t LG_200703_50cm_1_4.tif --xx 0.5 --yy 0.5 --xt 0 --yt 13751 -t LG_200703_50cm_2_1.tif --xx 0.5 --yy 0.5 --xt 6875.5 --yt 13751 -t LG_200703_50cm_2_2.tif --xx 0.5 --yy 0.5 --xt 13751 --yt 13751 -t LG_200703_50cm_2_3.tif --xx 0.5 --yy 0.5 --xt 20626.5 --yt 13751 -t LG_200703_50cm_2_4.tif --xx 0.5 --yy 0.5 --xt 0 --yt 6875.5 -t LG_200703_50cm_3_1.tif --xx 0.5 --yy 0.5 --xt 6875.5 --yt 6875.5 -t LG_200703_50cm_3_2.tif --xx 0.5 --yy 0.5 --xt 13751 --yt 6875.5 -t LG_200703_50cm_3_3.tif --xx 0.5 --yy 0.5 --xt 20626.5 --yt 6875.5 -t LG_200703_50cm_3_4.tif --xx 0.5 --yy 0.5 --xt 0 --yt 0 -t LG_200703_50cm_4_1.tif --xx 0.5 --yy 0.5 --xt 6875.5 --yt 0 -t LG_200703_50cm_4_2.tif --xx 0.5 --yy 0.5 --xt 13751 --yt 0 -t LG_200703_50cm_4_3.tif --xx 0.5 --yy 0.5 --xt 20626.5 --yt 0 -t LG_200703_50cm_4_4.tif --no-interpolate-terrain --tile-image-size 1024 -l 9 --compressed -v 0.07 -o i:/lg-l9-malla-reducida-1024/lg.ive now things are faster with lower fps drops due to faster intersections, reduced loading times and the triangle density is still ok. But these wierd effects appeared when --no-interpolate--terrain was used images showing the effects are included original size 1920x1200 downscaled to 60% thanks Todo ruedas: información práctica y todo el glamour del mundo del motor. MSN Estilo y Tendencias _ MSN Noticias http://noticias.msn.es/comunidad.aspx___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [Depth Buffer rendering]
Hello, I would like to create an effect (using osgFX) which render the depth buffer. I'm using a RTT and then apply the texture to the object but i'm having some problem for mapping correctly the texture on the object (see capture in attachment). My RTT camera must be similar to my viewer camera, so i've tried to play with the matrix but without success. In fact for my program, the texture should be use as an input of a shader. can someone help me ? am i doing the right things ? Thanks, Mathieu Here is a fragment of the code i'm using: / const unsigned int tex_depth_width = 1024; const unsigned int tex_depth_height = 1024; osg::Texture2D* _tex_depth = new osg::Texture2D; _tex_depth-setTextureSize(tex_depth_width, tex_depth_height); _tex_depth-setInternalFormat(GL_DEPTH_COMPONENT); _tex_depth-setWrap(osg::Texture2D::WRAP_S, osg::Texture2D::CLAMP_TO_BORDER); _tex_depth-setWrap(osg::Texture2D::WRAP_T, osg::Texture2D::CLAMP_TO_BORDER); _tex_depth-setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR); _tex_depth-setFilter(osg::Texture2D::MAG_FILTER, osg::Texture2D::LINEAR); osg::Camera* camera = new osg::Camera; camera-setClearMask( GL_DEPTH_BUFFER_BIT ); camera-setClearColor( osg::Vec4(1.0f,1.0f,1.0f,1.0f) ); //camera-setReferenceFrame(osg::Camera::ABSOLUTE_RF); camera-setComputeNearFarMode( osg::Camera::DO_NOT_COMPUTE_NEAR_FAR ); camera-setViewport(0, 0, tex_depth_width, tex_depth_height); camera-setViewMatrix( osg::Matrix::identity() ); camera-setRenderOrder(osg::Camera::PRE_RENDER); camera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); camera-attach(osg::Camera::DEPTH_BUFFER, _tex_depth); camera-addChild( _scene ); root-addChild( camera ); root-addChild( _scene ); const unsigned int tex_depth_unit = 0; osg::StateSet* ss = new osg::StateSet; ss-setTextureAttributeAndModes(tex_depth_unit, _tex_depth, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON); _scene-setStateSet( ss ); /// attachment: depthbuffer.JPG___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Viewer Hanging Problem (Without the main viewer loop)
Hello again, I figured out that there is no hung OSG viewer but a WM_KEYDOWN message processed by the OSG's WindowProc. If you put an OSG Viewer in an MFC window, even if you don't activate OSG manipulators, OSG's Window Procedure is still active and handles messages before your DefaultWindowProc, so if you press ESC key, viewer quits :)) But my question still remains and if anyone thinks that it is a mis-use, please let me know. Thanks and Regards, Can 2008/6/12 Can T. Oguz [EMAIL PROTECTED]: Hi Everybody, My problem is that when another window is instantly opened up on the viewer pane (I use OSG within MFC app. without the main viewer loop, I manipulate the camera manually and call frame() whenever necessary because %100 CPU usage is not always allowed, so I can not take advantage of any manipulators in osgGA) Any ideas? Thanks and Regards to all, Can ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] RTT, ParticleSystem, Depth
Hello John, Robert, I don't have any input into your question, but I just wanted to let you know that Robert is doing training all this week, so he's away from his e-mail and can't answer (even if you send your message twice :-) ). Others may have some ideas, though. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] bug in last SVN VPB????
Hi David, The tiles in the PagedLOD don't match up perfectly in general. osgTerrain gets them really close, but sometimes you'll see the gaps like you pointed out in your image. osgTerrain uses a skirt around each tile to hide those gaps. If the default skirt is not working out for you, you can use the --skirt-ratio to increase the size of the skirt to hide the gaps. In general, its going to be better to use the GDAL library to process and georeference your imagery and terrain before passing it along to osgdem rather than trying to use the --xx and --yy family of operators to reduce potential georeferencing problems like the image being flipped. Thanks, On Thu, Jun 12, 2008 at 5:34 AM, David _ [EMAIL PROTECTED] wrote: also, when using the no-interpolate option, the height image is flipped vertically -- From: [EMAIL PROTECTED] To: osg-users@lists.openscenegraph.org Date: Thu, 12 Jun 2008 11:06:06 +0200 Subject: [osg-users] bug in last SVN VPB i don´t know if you are aware of this but i think i´ve found a bug in last SVN version of vpb (rev 911) we´re generating some pagedlod islands with osgdem and when using the '--no-interpolate-terrain' option strange effects appear in the screen it looks like the pagedlod 'sub-objects' geometry is not matching perfectly we wanted to reduce the polygon density cause we had a very very high triangle count that was slowing down things. we have a lot of written code for PagedLOD trees so it needs to be a pagedLOD. We downscale our original high resolution heightmaps to 10% and used the '--no-interpolate--terrain' to tell the osgdem not to add extra geometry this is the final command 'c:\osg\vpb\osgdem.exe' --xx 100 --yy 100 -d height_map_downscale_10.tif --xx 0.5 --yy 0.5 --xt 0 --yt 20626.5 -t LG_200703_50cm_1_1.tif --xx 0.5 --yy 0.5 --xt 6875.5 --yt 20626.5 -t LG_200703_50cm_1_2.tif --xx 0.5 --yy 0.5 --xt 13751 --yt 20626.5 -t LG_200703_50cm_1_3.tif --xx 0.5 --yy 0.5 --xt 20626.5 --yt 20626.5 -t LG_200703_50cm_1_4.tif --xx 0.5 --yy 0.5 --xt 0 --yt 13751 -t LG_200703_50cm_2_1.tif --xx 0.5 --yy 0.5 --xt 6875.5 --yt 13751 -t LG_200703_50cm_2_2.tif --xx 0.5 --yy 0.5 --xt 13751 --yt 13751 -t LG_200703_50cm_2_3.tif --xx 0.5 --yy 0.5 --xt 20626.5 --yt 13751 -t LG_200703_50cm_2_4.tif --xx 0.5 --yy 0.5 --xt 0 --yt 6875.5 -t LG_200703_50cm_3_1.tif --xx 0.5 --yy 0.5 --xt 6875.5 --yt 6875.5 -t LG_200703_50cm_3_2.tif --xx 0.5 --yy 0.5 --xt 13751 --yt 6875.5 -t LG_200703_50cm_3_3.tif --xx 0.5 --yy 0.5 --xt 20626.5 --yt 6875.5 -t LG_200703_50cm_3_4.tif --xx 0.5 --yy 0.5 --xt 0 --yt 0 -t LG_200703_50cm_4_1.tif --xx 0.5 --yy 0.5 --xt 6875.5 --yt 0 -t LG_200703_50cm_4_2.tif --xx 0.5 --yy 0.5 --xt 13751 --yt 0 -t LG_200703_50cm_4_3.tif --xx 0.5 --yy 0.5 --xt 20626.5 --yt 0 -t LG_200703_50cm_4_4.tif --no-interpolate-terrain --tile-image-size 1024 -l 9 --compressed -v 0.07 -o i:/lg-l9-malla-reducida-1024/lg.ive now things are faster with lower fps drops due to faster intersections, reduced loading times and the triangle density is still ok. But these wierd effects appeared when --no-interpolate--terrain was used images showing the effects are included original size 1920x1200 downscaled to 60% thanks -- Todo ruedas: información práctica y todo el glamour del mundo del motor. MSN Estilo y Tendencias http://estilo.es.msn.com/ -- Tecnología, moda, motor, viajes,.suscríbete a nuestros boletines para estar siempre a la última MSN Newslettershttp://newsletters.msn.com/hm/maintenanceeses.asp?L=ESC=ESP=WCMaintenanceBrand=WLRU=http%3a%2f%2fmail.live.com ___ 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] [Depth Buffer rendering]
i post my source code for more clarity.. Maybe someone already try to have the same effect. DepthBuffer.cpp include a main method for test. #include DepthBuffer.h #include osgFX/Registry #include osgViewer/Viewer #include osgDB/ReadFile namespace { osgFX::Registry::Proxy proxy(new osgFX::DepthBuffer); class DefaultTechnique: public osgFX::Technique { public: DefaultTechnique(osg::Texture2D* tex_depth) : osgFX::Technique(), _tex_depth(tex_depth) {} META_Technique(GLSL Depth Buffer, GLSL Depth Buffer); void getRequiredExtensions(std::vectorstd::string extensions) const { //extensions.push_back( GL_ARB_shader_objects ); //extensions.push_back( GL_ARB_vertex_shader ); //extensions.push_back( GL_ARB_fragment_shader ); } protected: void define_passes() { const unsigned int tex_depth_unit = 0; osg::ref_ptrosg::StateSet ss = new osg::StateSet; ss-setTextureAttributeAndModes(tex_depth_unit, _tex_depth.get(), osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE); /* ss-setTextureMode(tex_depth_unit, GL_TEXTURE_GEN_S, osg::StateAttribute::ON); ss-setTextureMode(tex_depth_unit, GL_TEXTURE_GEN_T, osg::StateAttribute::ON); ss-setTextureMode(tex_depth_unit, GL_TEXTURE_GEN_R, osg::StateAttribute::ON); ss-setTextureMode(tex_depth_unit, GL_TEXTURE_GEN_Q, osg::StateAttribute::ON); */ addPass(ss.get()); } private: osg::ref_ptrosg::Texture2D _tex_depth; }; } /// osgFX::DepthBuffer::DepthBuffer() : Effect() { } osgFX::DepthBuffer::DepthBuffer(const DepthBuffer copy, const osg::CopyOp copyop) : Effect(copy, copyop), _tex_depth(static_castosg::Texture2D* (copyop(copy._tex_depth.get( { } void osgFX::DepthBuffer::setUpEffect(osg::Group* root, osg::Node* object) { const unsigned int tex_depth_width = 1024; const unsigned int tex_depth_height = 1024; _tex_depth = new osg::Texture2D; _tex_depth-setTextureSize(tex_depth_width, tex_depth_height); _tex_depth-setInternalFormat(GL_DEPTH_COMPONENT); //_tex_depth-setWrap(osg::Texture2D::WRAP_R, osg::Texture2D::CLAMP_TO_BORDER); //_tex_depth-setWrap(osg::Texture2D::WRAP_S, osg::Texture2D::CLAMP_TO_BORDER); //_tex_depth-setWrap(osg::Texture2D::WRAP_T, osg::Texture2D::CLAMP_TO_BORDER); _tex_depth-setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR); _tex_depth-setFilter(osg::Texture2D::MAG_FILTER, osg::Texture2D::LINEAR); osg::Camera* camera = new osg::Camera; camera-setName(DepthBufferCamera); camera-setClearColor( osg::Vec4(1.0f,1.0f,1.0f,1.0f) ); camera-setClearMask( GL_DEPTH_BUFFER_BIT ); camera-setReferenceFrame(osg::Camera::RELATIVE_RF); camera-setComputeNearFarMode( osg::Camera::DO_NOT_COMPUTE_NEAR_FAR ); camera-setViewport(0, 0, tex_depth_width, tex_depth_height); camera-setProjectionMatrix( osg::Matrix::identity() ); camera-setViewMatrix( osg::Matrix::identity() ); camera-setRenderOrder(osg::Camera::PRE_RENDER); camera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); camera-attach(osg::Camera::DEPTH_BUFFER, _tex_depth.get()); camera-addChild( object ); root-addChild( camera ); dirtyTechniques(); } bool osgFX::DepthBuffer::define_techniques() { addTechnique( new DefaultTechnique(_tex_depth.get()) ); return true; } int main(int argc, char *argv[]) { osgViewer::Viewer viewer; osg::ref_ptrosg::Group rootNode = new osg::Group; osg::ref_ptrosg::Node objectNode = osgDB::readNodeFile(cow.osg); osg::ref_ptrosgFX::DepthBuffer effect = new osgFX::DepthBuffer; effect-setUpEffect(rootNode.get(), objectNode.get()); effect-addChild( objectNode.get() ); rootNode-addChild( effect.get() ); viewer.setSceneData( rootNode.get() ); return viewer.run(); }#ifndef _DEPTHBUFFER_HPP_ #define _DEPTHBUFFER_HPP_ #include osgFX/Export #include osgFX/Effect #include osg/Texture2D namespace osgFX { class DepthBuffer : public osgFX::Effect { public: DepthBuffer(); DepthBuffer(const DepthBuffer copy, const osg::CopyOp copyop = osg::CopyOp::SHALLOW_COPY); // effect class informations
[osg-users] cmake, osgdb_freetype, and OTHER_LDFLAGS for Xcode on OSX
Stephen, I have been working with Eric Wing here at WWDC to improve the CMake generator for Xcode when compiling OSG. I noticed your question on the OSG mailing lists: * I need some CMake-advice. I found a solution for the linker-error, I** have to add** -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:$(SDKROOT)/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib** to** OTHER_LDFLAGS, then xcode compiles the osgdb_freetype plugin. But how do I add this option into the CMakeLists.txt-file? I tried # bugfix for leopard linker bug picking the wrong libgl-lib** IF(APPLE)** SET(CMAKE_SHARED_LINKER_FLAGS,${CMAKE_SHARED_LINKER_FLAGS}** -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib)** ENDIF(APPLE) but this does not work. The OTHER_LDFLAGS remains untouched.** Can somebody help me here, I looked over the CMake docs but could not** find any suitable information...* Did you find a solution? I tried a very similar change that also didn't work. I tried the variable you had above, and I also tried setting LINK_FLAGS and that didn't work either. -Eric ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Shader Problem
Hi CG When your remove a shader, void Program::dirtyProgram() is called to request a relink in the next frame. Program is relinked in the next frame in void Program::apply( osg::State state ) const method. Follow your code in a debugger to see if all is properly done. Are you sure your shader is well removed from your program ? HTH David Callu 2008/6/12 CG [EMAIL PROTECTED]: Hi David, I'm using osg 2.4 and osgViewer. Regards, Cg -- Date: Thu, 12 Jun 2008 11:09:49 +0200 From: [EMAIL PROTECTED] To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Shader Problem hi CG when you remove a shader, osg::Program need to be relinked. this is done by osgUtil::GLObjectVisitor in osgViewer::Renderer::draw method. So this seem can be done at runtime. Which OSG version did you use ? Did you use osgViewer ? David Callu 2008/6/12 CG [EMAIL PROTECTED]: Hi all, Are there any ways to remove the shader during runtime? I've tried the removeShader function but the effect of the shader is still applied to my models (e.g tank) i.e. the appearance of the models do not go back to the state before shader is applied. Regards, Cg -- Chat online and in real-time with friends and family! Windows Live Messenger http://get.live.com/messenger/overview ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Always-on security tools provide safer ways to connect and share anywhere. Find out more. Windows Live http://get.live.com/familysafety/overview ___ 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
[osg-users] Problem compiling OSG from 10 seconds ago
On Linux Scanning dependencies of target osgDB [ 0%] Building CXX object src/osgDB/CMakeFiles/osgDB.dir/DatabasePager.o /local/OSG/OpenSceneGraph/src/osgDB/DatabasePager.cpp:243: error: 'class osgDB::DatabasePager::ReadQueue' has not been declared /local/OSG/OpenSceneGraph/src/osgDB/DatabasePager.cpp:243: error: ISO C++ forbids declaration of 'ReadQueue' with no type /local/OSG/OpenSceneGraph/src/osgDB/DatabasePager.cpp: In function 'int ReadQueue(osgDB::DatabasePager*, const std::string)': /local/OSG/OpenSceneGraph/src/osgDB/DatabasePager.cpp:243: error: only constructors take base initializers /local/OSG/OpenSceneGraph/src/osgDB/DatabasePager.cpp:247: error: '_block' was not declared in this scope etc. etc. -- Ing. Mario Valle Data Analysis and Visualization Services | http://www.cscs.ch/~mvalle Swiss National Supercomputing Centre (CSCS) | Tel: +41 (91) 610.82.60 v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] loading thousands of images!
Hi guys, i'm using osg 1.2. I would like to load a lot of images (15000 jpeg files) in memory using an osg:image vector ( std::vectorosg::image), but i receive something like a memory bug when i arrive to load the 400th image (if i load i.e. 380 images i have no problem). Initally i have supposed to load all images (30 kbyte for each image) in a std:vectorosg:image. I have seen that osg:imagestream also exists. What is the difference between image and imagestream? where i can find more information on how to use these classes? Is there a tutorial or example that explain how to use them? I have taken look on quicktime plugin, but both version and topic inside plugin (quick time plugin try to convert video streaming into image, my problem is to load a lot of images!) don't allow me to use it. Also, i have tought to use two separate threads one for image folder loading, and the second for visualize image, but visualization thread is two time faster then loading thread (and i have only a buffer of 400 images available!). Any suggestion? Bye. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [Depth Buffer rendering]
Hi Mathieu, Sorry I don't have the time to compile and test your code, but I saw the screenshot and it looks like your depth texture gets rendered and applied to the object. What you may need to do is to make sure you set up RTT camera transform exactly as main camera transforms, and texture coordinates are properly generated to span the whole window. In other words I guess that you want to have texcoords match pixel locations in the final output screen. Ie you want texcorrds on the objects to span -1..1x-1..1 range on the output window. Right ? If yes, then you could use simple shader, or add a texgen node to produce proper texcoords for the output scene. This texgen should use EYE_LINEAR coords and its transform should be set to projection matrix of RTT camera and main camera. I am also not sure if seeting your effect camera to RELATIVE_RF gurantees using the same projection for RTT camera as for main camera. One could be sure if he forces this explicitly eg: camera-setProjectionMatrix( viewer-getCamera()-getProjectionMatrix() ); To add texgen node try adding following lines to your code: camera-setProjectionMatrix( viewer-getCamera()-getProjectionMatrix() ); osg::TexGenNode * texGenNode = new osg::TexGenNode; _scene-addChild( texGenNode ); texGenNode-setTextureUnit( 0 ); texGenNode-getTexGen()-setMode( osg::TexGen::EYE_LINEAR ); texGenNode-getTexGen()-setPlanesFromMatrix ( camera-getProjectionMatrix() * osg::Matrix::translate(1,1,1) * // remap -1..1x-1..1 range osg::Matrix::scale(0.5,0.5,0.5) // to 0..1 x 0..1 range ); One final note, it looks like you use cow.osg model. AFAIK this model already contains texgen using SPHERE mapping mode. To avoid conflicts for tests I suggest you use other model. Hope it helps, and no guarrantees, I have no time to verify if everything what I wrote is 100% correct. Cheers, Wojtek - Original Message - From: Mathieu Schoutteten To: osg-users@lists.openscenegraph.org Sent: Thursday, June 12, 2008 4:35 PM Subject: Re: [osg-users] [Depth Buffer rendering] i post my source code for more clarity.. Maybe someone already try to have the same effect. DepthBuffer.cpp include a main method for test. ___ 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
[osg-users] Crash in osgViewerWX
hi, i've used the osgViewerWX example for my program and I'd like to change the camera view inside the GraphicsWindowsWX class. I've done this: - I pass the viewer to GraphicsWindowsWX in function wxOsgApp::OnInit(). frame-SetViewer(viewer.get()); gw-setViewer(viewer.get()); And I set the new camera view in class GraphicsWindowWX. void GraphicsWindowWX::setView() { _viewer-getCamera()-setViewMatrixAsLookAt( osg::Vec3(450.,-450.,1200.),osg::Vec3(450.,450.,0.),osg::Vec3(0.,0.,1.)); } It works fine, but when I close the program, it crashes and i got this message in the console window: 'Warning: deleting still referenced object 08E57B70 of tye 'class osg::Referenced *' the final reference count was 1189214347, memory corruption possible. What am I doing wrong?? _ La vida de los famosos al desnudo en MSN Entretenimiento http://entretenimiento.es.msn.com/___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Ray Tracing a BRLCAD model in Openscenegraph
Steven, I am at GDLS in Sterling Hts, MI. I have been loosely associated with our guys that run BRLCAD, but know that they would love to find better ways to convey results. I would be very interested in hearing more about what you are doing, if you are able to discuss. Stephen Haithcock General Dynamics Land Systems 38500 Mound Rd. Sterling Heights, MI 48310 MZ 436-40-15 (586) 825-8573 Watkins, Steven M CIV NSWCDD, G24 To steven.m.watkins osg-users@lists.openscenegraph.org @navy.mil Sent by: cc osg-users-bounces @lists.opensceneg Subject raph.org [osg-users] Ray Tracing a BRLCAD model in Openscenegraph 06/10/2008 07:36 AM Please respond to OpenSceneGraph Users [EMAIL PROTECTED] openscenegraph.or g Hi All I have implemented BRLCAD, which is a CSG based ray tracing api, into an Openscenegraph application. I am currently displaying BRLCAD models in the Openscenegraph world by generating a point cloud using the native BRLCAD ray tracer and rendering that as Osg point geometry. I would like to display these BRLCAD models by ray trace in Openscenegraph (yes, it will be slow!). I have done some searches through the archives and have not found a lot of info. It appears that I am going to have to use glReadPixels and glWritePixels prior to the swapbuffers (I am not using osgViewer yet). Does anyone know of a better method to render via ray trace in Openscenegraph? Thanks ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org This is an e-mail from General Dynamics Land Systems. It is for the intended recipient only and may contain confidential and privileged information. No one else may read, print, store, copy, forward or act in reliance on it or its attachments. If you are not the intended recipient, please return this message to the sender and delete the message and any attachments from your computer. Your cooperation is appreciated. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] loading thousands of images!
Loading a large number of images all at once might be overloading your memory capacity. Even if you can fit all of the images in main memory at once, doing it this way does not scale very well. Google Earth does it this way and it chokes hard when loading larger animations. Remember that even if each of your images is 30K on disk, they are uncompressed in memory after being loaded. The better way is to just load images individually, use them to display, then throw them away. The imagestream class can help with this. I don't have any specific experience with this class but I imagine that it is similar to what I do myself in my application. The fastest path for loading lots of images is to compress the textures and store them on disk in compressed format (that is, ive format). Then, when you are loading images, no processing is needed to display the image. I use this technique in my program, and it is very effective. -Eric On Thu, Jun 12, 2008 at 8:46 AM, Andrea Martini [EMAIL PROTECTED] wrote: Hi guys, i'm using osg 1.2. I would like to load a lot of images (15000 jpeg files) in memory using an osg:image vector ( std::vectorosg::image), but i receive something like a memory bug when i arrive to load the 400th image (if i load i.e. 380 images i have no problem). Initally i have supposed to load all images (30 kbyte for each image) in a std:vectorosg:image. I have seen that osg:imagestream also exists. What is the difference between image and imagestream? where i can find more information on how to use these classes? Is there a tutorial or example that explain how to use them? I have taken look on quicktime plugin, but both version and topic inside plugin (quick time plugin try to convert video streaming into image, my problem is to load a lot of images!) don't allow me to use it. Also, i have tought to use two separate threads one for image folder loading, and the second for visualize image, but visualization thread is two time faster then loading thread (and i have only a buffer of 400 images available!). Any suggestion? Bye. ___ 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
[osg-users] New versions of OSG and configuring CMake
Hi, I must be doing something wrong when using CMakeSetup. Every time I download a new release of OSG, I have to go through the steps of reconfiguring CMake to point to all the directories for the various extras (GDAL, FLTK, etc.) I've tried setting up environment variables with names like FLTK_LIBRARY or FLTK_INCLUDE_DIR in the hopes that CMake will read those and use them to help make my life easier, but it's all in vain. Is there an easy way to automatically configure CMake? Thanks, Brian ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Build error with latest svn
There is a build error (OSX tested) with latest svn (revision 8434), in the DatabasePager (I don't have the exact error right now). Reverting to build 8425 seems to fix the problem: svn update -r8425 It looks like the refactoring from RequestQueue to ReadQueue didn't get finished or completely checked in. -Eric ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] CMake and OSX
The latest SVN of osg has a problem when generating xcode projects with cmake. In the main directory, CMakeLists.txt on line 349, is the following: ADD_DEFINITIONS(-DOSG_DEBUG_POSTFIX='\${CMAKE_DEBUG_POSTFIX}\') This causes problems on OSX. I would like to change this line to: ADD_DEFINITIONS(-DOSG_DEBUG_POSTFIX=${CMAKE_DEBUG_POSTFIX} ) I don't know what implications this causes on other platforms. Is there a good reason that there are all those extra quotes in the current build? -Eric ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osg Node kits
Hi users, I'm trying to understand the concept of a node kit, but the documentation is very limited: http://www.openscenegraph.org/projects/osg/wiki/Support/KnowledgeBase/NodeKit I believe that the osgFX is a node kit? what is it that defines a node kit? and how does one use them? perhaps someone can give an example how to apply the cartoon effect? I can see that they register themselves, does this mean I can apply them to any object runtime? anyone? Peter ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] New versions of OSG and configuring CMake
Hello Brian, I must be doing something wrong when using CMakeSetup. Every time I download a new release of OSG, I have to go through the steps of reconfiguring CMake to point to all the directories for the various extras (GDAL, FLTK, etc.) I've tried setting up environment variables with names like FLTK_LIBRARY or FLTK_INCLUDE_DIR in the hopes that CMake will read those and use them to help make my life easier, but it's all in vain. Is there an easy way to automatically configure CMake? Check in the CMakeModules/Find*.cmake files to see what the Find scripts look for. Perhaps they look for some environment variables but they're just not named the same as the ones you're setting, or perhaps they don't check any and you could add that functionality if you need it. Or perhaps you can just put all your libs in a given place and it'll find them. I don't know about specific optional libraries. Hope this helps, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] CMake and OSX
Hi Eric, The latest SVN of osg has a problem when generating xcode projects with cmake. In the main directory, CMakeLists.txt on line 349, is the following: ADD_DEFINITIONS(-DOSG_DEBUG_POSTFIX='\${CMAKE_DEBUG_POSTFIX}\') This causes problems on OSX. I would like to change this line to: ADD_DEFINITIONS(-DOSG_DEBUG_POSTFIX=${CMAKE_DEBUG_POSTFIX} ) I don't know what implications this causes on other platforms. Is there a good reason that there are all those extra quotes in the current build? What version of CMake are you using? Removing those escaped quotes is actually needed to be compatible with CMake 2.6. For now we work around it by just disabling the error message... I was under the impression that they were there because CMake 2.4.x didn't like the unquoted string, but if you're using CMake 2.4.x, then I don't know. At least, they didn't cause a problem with CMake 2.4.x on Windows and Linux. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Disabling HUD in one camera
I currently have a setup with one viewer with two cameras. I add a HUD to the scene (as a child to the root node) and it shows up in both camera views. Is there an easy way to disable seeing it in one view? Some camera-Set... that will do this? (based on depth or something?) Mike Greene ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Problem compiling OSG from 10 seconds ago
Hi Mario Same thing for me. Seem Robert have forgetten to commit include/osgDB/DatabasePager. just do this your trunk directory then all build fine. # svn up -r8433 HTH David Callu 2008/6/12 Mario Valle [EMAIL PROTECTED]: On Linux Scanning dependencies of target osgDB [ 0%] Building CXX object src/osgDB/CMakeFiles/osgDB.dir/DatabasePager.o /local/OSG/OpenSceneGraph/src/osgDB/DatabasePager.cpp:243: error: 'class osgDB::DatabasePager::ReadQueue' has not been declared /local/OSG/OpenSceneGraph/src/osgDB/DatabasePager.cpp:243: error: ISO C++ forbids declaration of 'ReadQueue' with no type /local/OSG/OpenSceneGraph/src/osgDB/DatabasePager.cpp: In function 'int ReadQueue(osgDB::DatabasePager*, const std::string)': /local/OSG/OpenSceneGraph/src/osgDB/DatabasePager.cpp:243: error: only constructors take base initializers /local/OSG/OpenSceneGraph/src/osgDB/DatabasePager.cpp:247: error: '_block' was not declared in this scope etc. etc. -- Ing. Mario Valle Data Analysis and Visualization Services | http://www.cscs.ch/~mvalle http://www.cscs.ch/%7Emvalle Swiss National Supercomputing Centre (CSCS) | Tel: +41 (91) 610.82.60 v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82 ___ 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] Disabling HUD in one camera
Hello I currently have a setup with one viewer with two cameras. I add a HUD to the scene (as a child to the root node) and it shows up in both camera views. Is there an easy way to disable seeing it in one view? Some camera-Set... that will do this? (based on depth or something?) osg::Camera is a subclass of osg::Group, and the scene data is just a child of the camera. If you do camera-addChild(hudCamera);, then the HUD will only show up on that camera (since the HUD is not below the scene root, which is a child of all cameras). Hope this helps, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] CMake and OSX
Yes, I am using Cmake 2.6, with OSG svn, on the Mac. The symptoms of the problem is that when Xcode tries to open a project generated by cmake, it complains about syntax problems in the project file. Eric Wing worked around the problem by not allowing a changed postfix. Is there any reason we shouldn't require CMake 2.6 when compiling the latest OSG? I will also see if a conditional based on cmake version will work for me. On Thu, Jun 12, 2008 at 11:45 AM, Jean-Sébastien Guay [EMAIL PROTECTED] wrote: Hi Eric, The latest SVN of osg has a problem when generating xcode projects with cmake. In the main directory, CMakeLists.txt on line 349, is the following: ADD_DEFINITIONS(-DOSG_DEBUG_POSTFIX='\${CMAKE_DEBUG_POSTFIX}\') This causes problems on OSX. I would like to change this line to: ADD_DEFINITIONS(-DOSG_DEBUG_POSTFIX=${CMAKE_DEBUG_POSTFIX} ) I don't know what implications this causes on other platforms. Is there a good reason that there are all those extra quotes in the current build? What version of CMake are you using? Removing those escaped quotes is actually needed to be compatible with CMake 2.6. For now we work around it by just disabling the error message... I was under the impression that they were there because CMake 2.4.x didn't like the unquoted string, but if you're using CMake 2.4.x, then I don't know. At least, they didn't cause a problem with CMake 2.4.x on Windows and Linux. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ 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] CMake and OSX
Hello Eric, Is there any reason we shouldn't require CMake 2.6 when compiling the latest OSG? I don't think it's really that useful to require that everyone update their CMake version to 2.6 just for this. We can work around it through tweaks to the CMakeLists.txt instead. Though we have to draw a line when the number of tweaks/workarounds gets too large, and then requiring a more recent version of CMake is possible. But it's Robert's call. I will also see if a conditional based on cmake version will work for me. See the top of the file, this is what I submitted to work around the problem on Linux and Windows: # Works around warnings about escaped quotes in ADD_DEFINITIONS # statements. cmake_policy(SET CMP0005 OLD) I also suggested that checking CMake version and using a different ADD_DEFINITIONS line without the escaped quotes would work too, but might be harder to maintain if there are more than this ADD_DEFINITIONS line that use escaped quotes... Looks like on Mac, we might not have a choice. When I submitted this fix, I mentioned the possibilities - check the archives. Robert opted for this workaround to minimize the short-term impact, I guess. Longer term, I don't know. Anyways, if we end up using a conditional on the CMake version, we could remove the cmake_policy line. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg Node kits
The OSG Quick Start Guide (www.osgbooks.com) defines a NodeKit as a library that derives new Nodes, Drawables, or StateAttributes from core OSG classes, and provides support for the .osg file format for these new objects. But I'd like to hear Robert's definition. Use them just like any core OSG Node, Drawable or StateAttribute, but note that your app will now have to link with the NodeKit library. -Paul _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Wraae Marino Sent: Thursday, June 12, 2008 12:36 PM To: osg-users@lists.openscenegraph.org Subject: [osg-users] osg Node kits Hi users, I'm trying to understand the concept of a node kit, but the documentation is very limited: http://www.openscenegraph.org/projects/osg/wiki/Support/KnowledgeBase/NodeKi t I believe that the osgFX is a node kit? what is it that defines a node kit? and how does one use them? perhaps someone can give an example how to apply the cartoon effect? I can see that they register themselves, does this mean I can apply them to any object runtime? anyone? Peter ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Need help getting the osg::ColorMask I previously set
CODE: osg::StateSet *stateSet = group-getOrCreateStateSet(); osg::StateSet::AttributeList attributes = stateSet- getAttributeList(); osg::StateSet::AttributeList::iterator aitr = NULL; for(aitr= attributes.begin(); aitr!=attributes.end(); ++aitr) { osg::StateAttribute::Type temp = (*aitr).first.first; if(temp == osg::StateAttribute::COLORMASK) { osg::ColorMask mask = (*aitr).second.second; This won't compile. How can I get the osg::ColorMask from the osg::StateSet::AttributeList::iterator? Thanks, Judie ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] CMake and OSX
On Thu, Jun 12, 2008 at 1:14 PM, Jean-Sébastien Guay [EMAIL PROTECTED] wrote: Hello Eric, Is there any reason we shouldn't require CMake 2.6 when compiling the latest OSG? I don't think it's really that useful to require that everyone update their CMake version to 2.6 just for this. We can work around it through tweaks to the CMakeLists.txt instead. Though we have to draw a line when the number of tweaks/workarounds gets too large, and then requiring a more recent version of CMake is possible. But it's Robert's call. I will also see if a conditional based on cmake version will work for me. See the top of the file, this is what I submitted to work around the problem on Linux and Windows: # Works around warnings about escaped quotes in ADD_DEFINITIONS # statements. cmake_policy(SET CMP0005 OLD) I'm using this change (I'm using the latest svn) but it doesn't fix the problem on OSX. I added a conditional around line 349 that checks the version of cmake in use and that seems to solve the problem for me. I'm attaching my CMakeLists.txt to this message if anyone wants to try it out before I make a formal submission with it. I also suggested that checking CMake version and using a different ADD_DEFINITIONS line without the escaped quotes would work too, but might be harder to maintain if there are more than this ADD_DEFINITIONS line that use escaped quotes... Looks like on Mac, we might not have a choice. This looks like the only one that is causing trouble for me. When I submitted this fix, I mentioned the possibilities - check the archives. Robert opted for this workaround to minimize the short-term impact, I guess. Longer term, I don't know. Anyways, if we end up using a conditional on the CMake version, we could remove the cmake_policy line. I'll test removing that policy line before I submit my changes through osg-submissions. -Eric J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org IF(WIN32) CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR) ELSE(WIN32) IF(APPLE) CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR) IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4 AND ${CMAKE_PATCH_VERSION} LESS 7) MESSAGE(Warning: A critical CMake bug exists in 2.4.6 and below. Trying to build Universal Binaries will result in a compile error that seems unrelated. Either avoid building Universal Binaries by changing the CMAKE_OSX_ARCHITECTURES field to list only your architecture, or upgrade to the current CVS version of CMake or a newer stable version if it exists.) ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4 AND ${CMAKE_PATCH_VERSION} LESS 7) ELSE(APPLE) CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0 FATAL_ERROR) ENDIF(APPLE) ENDIF(WIN32) if(COMMAND cmake_policy) # Works around warnings libraries linked against that don't # have absolute paths (e.g. -lpthreads) cmake_policy(SET CMP0003 NEW) # Works around warnings about escaped quotes in ADD_DEFINITIONS # statements. cmake_policy(SET CMP0005 OLD) endif(COMMAND cmake_policy) PROJECT(OpenSceneGraph) SET(OPENSCENEGRAPH_MAJOR_VERSION 2) SET(OPENSCENEGRAPH_MINOR_VERSION 5) SET(OPENSCENEGRAPH_PATCH_VERSION 2) SET(OPENSCENEGRAPH_SOVERSION 38) SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}) SET(OSG_PLUGINS osgPlugins-${OPENSCENEGRAPH_VERSION}) SET(OSG_PLUGIN_PREFIX ) IF (CYGWIN) SET(OSG_PLUGIN_PREFIX cygwin_) ENDIF(CYGWIN) IF(MINGW) SET(OSG_PLUGIN_PREFIX mingw_) ENDIF(MINGW) # We want to build SONAMES shared librariess SET(OPENSCENEGRAPH_SONAMES TRUE) SET(OPENTHREADS_SONAMES TRUE) SET(OpenThreads_SOURCE_DIR ${OpenSceneGraph_SOURCE_DIR}) # We have some custom .cmake scripts not in the official distribution. # Maybe this can be used override existing behavior if needed? SET(CMAKE_MODULE_PATH ${OpenSceneGraph_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}) # Mainly for Windows as a convenience. This will find a directory in parallel with the # OSG source that contains 3rd party headers and libraries. # Use of relative paths in CMake is ill-advised, but don't know of any alternatives in this case #SET(CMAKE_INCLUDE_PATH ${OpenSceneGraph_SOURCE_DIR}/../3rdParty/include;${CMAKE_INCLUDE_PATH}) #SET(CMAKE_LIBRARY_PATH ${OpenSceneGraph_SOURCE_DIR}/../3rdParty/lib;${CMAKE_LIBRARY_PATH}) IF(USING_OSG_OP_OT_TRIPLE_SET) SET(CMAKE_INCLUDE_PATH ${OpenSceneGraph_SOURCE_DIR}/../../3rdParty/include;${CMAKE_INCLUDE_PATH}) SET(CMAKE_LIBRARY_PATH
Re: [osg-users] Need help getting the osg::ColorMask I previously set
Hi One things I noticed is you do 'osg::ColorMask mask'. This is wrong you need this to be a pointer to an osg::ColorMask instance FYI If you post a question my code won't compile at least provide the compilation errors... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Judie Sent: Thursday, June 12, 2008 4:50 PM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Need help getting the osg::ColorMask I previously set CODE: osg::StateSet *stateSet = group-getOrCreateStateSet(); osg::StateSet::AttributeList attributes = stateSet- getAttributeList(); osg::StateSet::AttributeList::iterator aitr = NULL; for(aitr= attributes.begin(); aitr!=attributes.end(); ++aitr) { osg::StateAttribute::Type temp = (*aitr).first.first; if(temp == osg::StateAttribute::COLORMASK) { osg::ColorMask mask = (*aitr).second.second; This won't compile. How can I get the osg::ColorMask from the osg::StateSet::AttributeList::iterator? Thanks, Judie ___ 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] Need help getting the osg::ColorMask I previously set
osg::Texture2D* texture2D = dynamic_castosg::Texture2D*(stateset-getTextureAttribute(unit,osg::StateA ttribute::TEXTURE)); if (texture2D) ... The above is from osgUtil::Optimizer and shows how the TextureAtlasBuilder gets the Texture2D StateAttribute. You can use a similar method to get any StateAttribute. For non-texture state, use getAttribute(), for example, and of course you don't need a 'unit' parameter. -Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Judie Sent: Thursday, June 12, 2008 2:50 PM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Need help getting the osg::ColorMask I previously set CODE: osg::StateSet *stateSet = group-getOrCreateStateSet(); osg::StateSet::AttributeList attributes = stateSet- getAttributeList(); osg::StateSet::AttributeList::iterator aitr = NULL; for(aitr= attributes.begin(); aitr!=attributes.end(); ++aitr) { osg::StateAttribute::Type temp = (*aitr).first.first; if(temp == osg::StateAttribute::COLORMASK) { osg::ColorMask mask = (*aitr).second.second; This won't compile. How can I get the osg::ColorMask from the osg::StateSet::AttributeList::iterator? Thanks, Judie ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-opensce negraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Composite Viewer with TXP database works?
Has anyone been using a Composite Viewer with multiple views and a TXP database? I have a viewer with a second view that sits in one place within the database. I can add whatever I want to the second view. It works fine unless I call: view2-setSceneData(databasenodes); where databasenodes is a TXP database. The scene comes up in the second view until I start to fly around within the database, then it dies. I'm thinking the TXP plugin has a problem maintaining two views. d ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] New Improved DatabasePager, now with even more threading! Please take a taste today :-)
I'm having a similar issue with DatabasePager::RequestQueue::takeFirst() (osg trunk, Debug build, windows XP VS2005). I'm getting some assertion errors at _requestList.sort (sequence not ordered). Even after adding the updateBlock(). I'm pretty new to this code section, so I'm probably off base here: Is it possible that the state of the databaseRequest objects within the list are being updated (from other threads) during the sort? IE. If the _timestampLastRequest or _priorityLastRequest are changing during the sort, the sort could become unstable. ___ Jim Lynch -Original Message- On Tue, May 27, 2008 at 12:08 PM, Tim Moore timoore at redhat.com wrote: Indeed. I've made the necessary changes to FlightGear, and it seems to be working fine. Except for being a cpu hog. Apparently, the pager thread is not blocked properly and continuously spins. The fact that the queue is empty is confirmed by the debug messages printed after the block call: HANDLE_NON_HTTP 0: _pager-_requestList.size()= 0 to delete = 0 I have been trying to find the place where the blocking is re-established when the queue goes empty, but could not find it. So I added an updateBlock() call at the end of DatabasePager::RequestQueue::takeFirst that seems to fix the issue. Could have added the call within the if-block, but this has the additional benefit of stopping runaway loops should somehow the pager thread get woken up without work to do. Index: DatabasePager.cpp === --- DatabasePager.cpp (revision 8398) +++ DatabasePager.cpp (working copy) @@ -273,6 +273,7 @@ databaseRequest = _requestList.front(); _requestList.erase(_requestList.begin()); } +updateBlock(); } I am not sure if I need an osg-submissions mail for this? -- Cheers, Csaba/Jester.org/listinfo.cgi/osg-users-openscenegraph.org The information contained in this communication may be CONFIDENTIAL and is intended only for the use of the recipient(s) named above. If you are not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please notify the sender and delete/destroy the original message and any copy of it from your computer or paper files. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Build from svn in Cygwin still tries to build osgviewerWX but no WX
Jean-Sébastien Guay wrote: The only thing I can find different about your messages upon quick glance is that the Content-Type: boundary designator is very high in the header. And it contains a line break... which in my limited experience seems a little odd. As does the :thesoftwaresource.com part but that should be ok, I think. So I would probably blame an e-mail client bug. Brian, what client are you using and can you try another one? (but we're pretty far from OSG support/discussion here :-) ) We've been researching this in the Virtual-Access Open Source project and not sure it is the client causing this. I went and checked the email archives at OpenSceneGraph.org and finding my message at: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2008-J une/012550.html and it says the non text attachment was scrubbed and if you follow the URL link you see my original message and the MIME attachment but the break in the line you noticed is not there. I wonder if it could be the fact it was posted as MIME. bk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Build from svn in Cygwin still tries to build osgviewerWX but no WX
Paul Speed wrote: The only thing I can find different about your messages upon quick glance is that the Content-Type: boundary designator is very high in the header. And it contains a line break... which in my limited experience seems a little odd. As does the :thesoftwaresource.com part but that should be ok, I think. It's clear that a strict interpretation of: Content-Type: multipart/mixed; boundary=Next part of message (VA.181d.0185f8c3:thesoftwaresource.com) Just as a thought I am trying the post again with the attachment as text but without MIME Encoding. I apologize for this. bk ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osg::Camera::FRAME_BUFFER_OBJECT, on-screen windows not reflecting rendered image
Hi, I am somewhat new to OpenSceneGraph. For my project we need to render offscreen -- so that overlapping windows do not corrupt the rendered image. We are using osg::Camera::FRAME_BUFFER_OBJECT render implementation, and getting the core behaviour we want, which is to say that we can extract the correctly rendered pixels from the image attached to the camera/frame buffer object. However, I still have two issues, and a question on performance: 1) The on-screen window is not showing the rendered image. Instead it is filled with garbage (or black) pixels. The question is what is the best way to reflect the contents of the fbo image? Should we do as osgprerender example does and create some geometry (osg::Geometry) and then texturemap the image onto the surface, or is there another (better?) way to push the pixels into the framebuffer so that the on-screen window displays properly? 2) using osg::Camera::PIXEL_BUFFER_RTT render implementation crashes on our system. We are running 32-bit Windows XP with dual SLI-graphics NVIDIA 5600 cards. I didn't spend a lot of time on this problem, mainly wondering if others are seeing the same? 3) Question: Any recommendation(s) on ways to increase/maximize performance when using fbo? Here is a code snippet showing how we are currently setting up the fbo: . . . osg::Image * fboImage = new osgImage(); fboImage-allocateImage( width, height, 1, GL_RGB, GL_UNSIGNED_BYTE); wc-cameraPostRenderCB = new WindowCapturePostDrawCallback(wc-getView(), fboImage, NULL); // attach the image so it's copied on each frame. theCamera-attach( osg::Camera::COLOR_BUFFER, fboImage); osg::Camera::RenderTargetImplementation renderImplementation; renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; // tell the camera to use OpenGL frame buffer object where supported. theCamera-setRenderTargetImplementation(renderImplementation); // set the post render callback theCamera-setPostDrawCallback(wc-cameraPostRenderCB); . . . Thanks, -Jon Goldman Sandia National Laboratories Albuquerque, New Mexico ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] New versions of OSG and configuring CMake
I presume you are workng on Windows and change build folder.If you just update from svn you should not be forced to configure again. Anyway, if you want to keep your previous cmake setup, just keep the CmakeCache.txt file. Otherwise,you can force your defaul configuration by adding -Dvar=value tou your cmake command line. I usually store my default setup in a cmake command line then run cmakesetup to eventually change options afterwards Hope it helps Brian wrote: Hi, I must be doing something wrong when using CMakeSetup. Every time I download a new release of OSG, I have to go through the steps of reconfiguring CMake to point to all the directories for the various extras (GDAL, FLTK, etc.) I've tried setting up environment variables with names like FLTK_LIBRARY or FLTK_INCLUDE_DIR in the hopes that CMake will read those and use them to help make my life easier, but it's all in vain. Is there an easy way to automatically configure CMake? Thanks, Brian ___ 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] New versions of OSG and configuring CMake
To add to what Luigi saidhere's my command line: cmake -DWIN32_USE_MP=ON -DGDAL_INCLUDE_DIR:PATH=%rootdir%\3rdparty\gdal\include -DGDAL_LIBRARY:PATH=%rootdir%\3rdparty\gdal\lib\gdal_i.lib -DCURL_LIBRARY_DEBUG:PATH=%rootdir%\3rdparty\curl\lib\debug\curllib.lib -DCURL_LIBRARY:PATH=%rootdir%\3rdparty\curl\lib\release\curllib.lib -DCURL_INCLUDE_DIR:PATH=%rootdir%\3rdparty\curl\include -DCMAKE_INSTALL_PREFIX:PATH=%rootdir%\3rdparty\osg\common\OpenSceneGraph . I use this in my master build script to build everything. I simply fire off a single script and go grab some lunch! To use Visual Studio from the command line after cmake is done I use: devenv OpenSceneGraph.sln /%1 Debug /project ALL_BUILD /out %logfile% devenv OpenSceneGraph.sln /%1 Debug /project INSTALL /out %logfile% devenv OpenSceneGraph.sln /%1 RelWithDebInfo /project ALL_BUILD /out %logfile% devenv OpenSceneGraph.sln /%1 RelWithDebInfo /project INSTALL /out %logfile% where %1 is build or rebuild On Thu, Jun 12, 2008 at 7:19 PM, Luigi Calori [EMAIL PROTECTED] wrote: I presume you are workng on Windows and change build folder.If you just update from svn you should not be forced to configure again. Anyway, if you want to keep your previous cmake setup, just keep the CmakeCache.txt file. Otherwise,you can force your defaul configuration by adding -Dvar=value tou your cmake command line. I usually store my default setup in a cmake command line then run cmakesetup to eventually change options afterwards Hope it helps Brian wrote: Hi, I must be doing something wrong when using CMakeSetup. Every time I download a new release of OSG, I have to go through the steps of reconfiguring CMake to point to all the directories for the various extras (GDAL, FLTK, etc.) I've tried setting up environment variables with names like FLTK_LIBRARY or FLTK_INCLUDE_DIR in the hopes that CMake will read those and use them to help make my life easier, but it's all in vain. Is there an easy way to automatically configure CMake? Thanks, Brian ___ 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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Shader Problem
Hi David, Just found out that the fault lies in my 3D model. Apparently, my shader only works for 3D models that are in OpenFlt format. It doesn't work for ive fomat. I've appended my shader code below: uniform sampler2D tex;uniform float fAmp; void main(){ vec4 texelColor = texture2D(tex, gl_TexCoord[0].st); texelColor = texelColor * fAmp; gl_FragColor = texelColor;} Thanks, Cg Date: Thu, 12 Jun 2008 16:46:04 +0200From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: Re: [osg-users] Shader ProblemHi CGWhen your remove a shader, void Program::dirtyProgram() is called to request a relink in the next frame.Program is relinked in the next frame in void Program::apply( osg::State state ) const method.Follow your code in a debugger to see if all is properly done.Are you sure your shader is well removed from your program ?HTHDavid Callu 2008/6/12 CG [EMAIL PROTECTED]: Hi David, I'm using osg 2.4 and osgViewer. Regards,Cg Date: Thu, 12 Jun 2008 11:09:49 +0200From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: Re: [osg-users] Shader Problem hi CGwhen you remove a shader, osg::Program need to be relinked.this is done by osgUtil::GLObjectVisitor in osgViewer::Renderer::draw method.So this seem can be done at runtime.Which OSG version did you use ?Did you use osgViewer ?David Callu 2008/6/12 CG [EMAIL PROTECTED]: Hi all, Are there any ways to remove the shader during runtime? I've tried the removeShader function but the effect of the shader is still applied to my models (e.g tank) i.e. the appearance of the models do not go back to the state before shader is applied. Regards,Cg Chat online and in real-time with friends and family! Windows Live Messenger___osg-users mailing [EMAIL PROTECTED]://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org Always-on security tools provide safer ways to connect and share anywhere. Find out more. Windows Live___osg-users mailing [EMAIL PROTECTED]://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _ Easily publish your photos to your Spaces with Photo Gallery. http://get.live.com/photogallery/overview___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org