Re: [osg-users] [vpb] VPB Latest build
Hi, I think this issue is related to latest OSG. I'm using quite older card ie 3dLabs wildcate 7210. I tried the terrain on different pc with Nvidia card and there is no issue there. Sorry for posting here. Thank you! Cheers, Vijeesh -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36715#36715 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Render To Texture
Hi everyone, I have some question about render to texture. The code that I give below is work but I have some question. 1. Why I have to use viewer.frame() for 2 time for working ?. If I use viewer.frame() just one time it doesn't work. The written image show just bank screen. 2. How to run viewer behind the scene because I don't want viewer show on screen that it look like pop up. If anyone has some way to improve this code for better, could comment my code. int main (int argc, char**argv) { osg::ref_ptrosg::Group model=dynamic_castosg::Group*(osgDB::readNodeFile(cow.osg)); osg::ref_ptrosg::Geode geodeModel = dynamic_castosg::Geode*(model-getChild(0)); osg::ref_ptrosg::Drawable drawable = dynamic_castosg::Drawable*(geodeModel-getDrawable(0)); osg::ref_ptrosg::StateSet stateset = dynamic_castosg::StateSet*(drawable-getStateSet()); osg::Texture2D* oldTexture = dynamic_castosg::Texture2D*(stateset-getTextureAttribute(0,osg::StateAttribute::TEXTURE)); int tex_width = 512, tex_height = 512; osg::ref_ptrosg::Texture2D texture = new osg::Texture2D; texture-setTextureSize( tex_width, tex_height); //osg::ref_ptrosg::Image imageTex = osgDB::readImageFile(Images/skymap.jpg); osg::ref_ptrosg::Image imageTex = oldTexture-getImage(); texture-setImage(imageTex.get()); osg::ref_ptrosg::Geode geode = new osg::Geode; osg::ref_ptrosg::Geometry geom =osg::createTexturedQuadGeometry( osg::Vec3(-1.0f, -1.0f, 0.0f), osg::Vec3( 2.0f, 0.f, 0.f ), osg::Vec3( 0.f, 2.0f, 0.f )); geode-addDrawable(geom.get()); osg::ref_ptrosg::StateSet ss = geode-getOrCreateStateSet(); ss-setTextureAttributeAndModes( 0, texture.get(), osg::StateAttribute::ON ); ss-setMode(GL_CULL_FACE,osg::StateAttribute::ON); ss-setMode(GL_LIGHTING,osg::StateAttribute::OFF); osg::ref_ptrosg::Camera camera = new osg::Camera; camera-setViewport(0,0,tex_width,tex_height); camera-setClearColor(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f)); camera-setClearMask( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); camera-setRenderOrder(osg::Camera::POST_RENDER); camera-setRenderTargetImplementation( osg::Camera::FRAME_BUFFER_OBJECT); osg::ref_ptrosg::Image image = new osg::Image; image-allocateImage(tex_width,tex_height,1,GL_RGBA,GL_UNSIGNED_BYTE); camera-attach(osg::Camera::COLOR_BUFFER,image.get()); camera-setReferenceFrame(osg::Camera::ABSOLUTE_RF); camera-addChild(geode.get()); osg::ref_ptrosg::Group root = new osg::Group; root-addChild(camera.get()); osgViewer::Viewer viewer; viewer.setUpViewInWindow(400,150,512,512); viewer.setSceneData(root.get()); viewer.setCameraManipulator(new osgGA::TrackballManipulator ); viewer.frame(); viewer.frame(); osgDB::writeImageFile(*image.get(),test.bmp); osg::ref_ptrosg::Texture2D newTexture = new osg::Texture2D; newTexture-setTextureSize( tex_width, tex_height); newTexture-setImage(image.get()); osg::ref_ptrosg::Geode newGeode = new osg::Geode; osg::ref_ptrosg::Geometry newGeom =osg::createTexturedQuadGeometry( osg::Vec3(-1.0f, -1.0f, 0.0f), osg::Vec3( 2.0f, 0.f, 0.f ), osg::Vec3( 0.f, 2.0f, 0.f )); newGeode-addDrawable(newGeom.get()); osg::ref_ptrosg::StateSet newss = newGeode-getOrCreateStateSet(); newss-setTextureAttributeAndModes( 0, newTexture.get(), osg::StateAttribute::ON ); newss-setMode(GL_CULL_FACE,osg::StateAttribute::ON); newss-setMode(GL_LIGHTING,osg::StateAttribute::OFF); viewer.setSceneData(newGeode.get()); return viewer.run(); } Best regards, //Phummipat ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to change a texture in a imported OSG file?
Hi, Almir there are visitor that find drawable by name for you class GetDrawableByNameVisitor:public osg::NodeVisitor { public: GetDrawableByNameVisitor(const std::string name):osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN): m_name(name), result(0) { setNodeMaskOverride(0x); setTraversalMask(0x); } using osg::NodeVisitor::apply; void apply(osg::Geode geode) { for (int i = 0; i geode.getNumDrawables(); i++) { osg::Drawable* dr = geode.getDrawable(i); if (dr-getName()==m_name) result = dr; } } osg::Drawable* getResult(){return result;} private: std::string m_name; osg::Drawable* result; }; so in your example you need something like GetDrawableByNameVisitor gdbnv(name of your material in 3dsmax with texture you wanna change) arTransformA-accept(gdbny); if (gdbny.getResult()) { osg::ImageStream* is = ...;//load your movie or whatever you got osg::Texture2D* animatedTexture = new osg::Texture2D(is); gdbny.getResult()-getOrCreateStateSet()-setTextureAttribute(0,animatedTexture,osg::StateAttribute::ON); } there can be case when your texture is not on 0 texture unit so you may need to go through like first 8 texture units with stateset getTextureAttribute(tex_unit_number, osg::StateAttribute::TEXTURE) and check which one texture unit have texture, then set your new texture created with imagestream to that texture unit with setTextureAttribute on stateset. Cheers, Sergey. 16.02.2011, 05:15, Almir Brazil almir@gmail.com: hybr wrote: Hi, Almir Try following thing: Look at material name which uses this texture in 3ds max, in osg this will be the name of drawable with stateset that uses this texture. You can find this drawable with some visitor, get stateset there, then set your animated texture to texture unit where old texture is (if there are one texture in material it's 0 by default). Cheers, Sergey. 15.02.2011, 04:24, Almir Brazil : Hi, I'm new to OpenSceneGraph, and I have the following scenario: A OSG file exported from 3DS Max, using OSGExp0.9.8 That file has 3 textures... 2 should be static, and 1 should be animated. When playing the exported OSG file, all 3 textures still static. I read few things about osg imagesequence, that can read a lot of sequential images to produce a animated texture effect. And that's what I'm looking for!! My dificultie is to change (in code) the static texture exported from 3DSMax to a imagesequence texture. Can anyone say me how to do that? ... Thank you! Cheers, Almir -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36665#36665 ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum Ok, here is the code... It's a modified version of osgartsimple.cpp: (see attachment) The OSG file - karsten.osg - (generated with 3ds Max) has 3 main textures. I want to change one of them with a imagesequence or movie file (quicktime .mov) (I have both of them). I haven't a Geode object, only a VideoGeode... how can I create a stateset to change the texture? Thanks! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36711#36711 /* -*-c++-*- * * osgART - ARToolKit for OpenSceneGraph * Copyright (C) 2005-2008 Human Interface Technology Laboratory New Zealand * * This file is part of osgART 2.0 * * osgART 2.0 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * osgART 2.0 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with osgART 2.0. If not, see http://www.gnu.org/licenses/. * */ #include osgART/Foundation #include osgART/VideoLayer #include osgART/PluginManager #include osgART/VideoGeode #include osgART/Utils #include osgART/GeometryUtils #include osgART/MarkerCallback #include osgART/TransformFilterCallback #include osgViewer/Viewer #include osgViewer/ViewerEventHandlers #include osgDB/FileUtils #include osgDB/WriteFile
[osg-users] osgCompute CMake
Hi, I have found a problem building osgCompute in Ubuntu 10.04 with CMake 2.8. My knowledge about CMake is near zero, so I cannot give much more info than the error I get: CMake Error in examples/osgGeometryDemo/src/CMakeLists.txt: Cannot find source file WarpMe.vsh. Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx Any clue about how to solve it? Regards, -- Javier Taibo ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgCompute CMake
I think you need the data from separate osgCompute repository. cheers jp On 16/02/11 12:35, Javier Taibo wrote: Hi, I have found a problem building osgCompute in Ubuntu 10.04 with CMake 2.8. My knowledge about CMake is near zero, so I cannot give much more info than the error I get: CMake Error in examples/osgGeometryDemo/src/CMakeLists.txt: Cannot find source file WarpMe.vsh. Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx Any clue about how to solve it? Regards, -- Javier Taibo ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgCompute CMake
Silly me!!! I had the data and the OSG_FILE_PATH env var set, but I missed the OSGCOMPUTE_FILE_PATH. Thanks for the hint! (and sorry for the noise :) On Wed, Feb 16, 2011 at 11:49 AM, J.P. Delport jpdelp...@csir.co.za wrote: I think you need the data from separate osgCompute repository. cheers jp On 16/02/11 12:35, Javier Taibo wrote: Hi, I have found a problem building osgCompute in Ubuntu 10.04 with CMake 2.8. My knowledge about CMake is near zero, so I cannot give much more info than the error I get: CMake Error in examples/osgGeometryDemo/src/CMakeLists.txt: Cannot find source file WarpMe.vsh. Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx Any clue about how to solve it? Regards, -- Javier Taibo ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Javier Taibo ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Using clone method properly
Hi, I'm newbie to OpenSceneGraph and I'm developing an application which supports 2D animations over quads. The idea is apply a texture over each quad, and update its texture coordinate array, using a cull callback. MatrixTransform - Billboard(CullCallbakc) - DrawableQuad(texture) Since I want to animate a lot of quads (100?) with the same texture, I would like to share these textures, so that I have in video memory as less textures as possible. For this reason, I'm using the clone method on the root node of each object, but I don't think I'm having the results I am looking for, because the consumed video memory is the same. I have tried with different Copy Operations, but I have not found the appropriate one for sharing only textures and drawables. What I really want is to share the texture, the drawable, and the billboard, but NOT the cullcallback of the billboard, since the new object has to have its own. Which would be the best approach for sharing drawables and textures? Should I use the clone method? Should I use the optimizer instead? Should I implement my own clone method? Maybe the clone method just duplicates nodes and doesnt' share anything? Thank you! Cheers, Roberto -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36721#36721 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] NodeTrackerManipulator for a globe Earth (Geocentric coordinate system)
zonk wrote: Hi Lv (is that your realname?), what in detail does not work with the manipulator together with a round earh database? Do you mean the up-vector of the camera, which is not updated and lead to an misalligned orientation relativ to the tracked node? Cheers, Torben Yes!(Lv is my real name) -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36722#36722 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Problem: CompositeViewer doesn't work with Stereo
Hi, there are no ideas what is wrong with my test programme? I have no idea to fix this problem. Cheers Martin Original-Nachricht Datum: Tue, 15 Feb 2011 10:34:49 +0100 Von: Martin Großer grosser.mar...@gmx.de An: OpenSceneGraph Users osg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Problem: CompositeViewer doesn\'t work with Stereo Hello Robert, I tried a simple test programme. I used the composite viewer and two views. If I set up stereo on one view, it works fine. Also with the horizontal interlace. But if I set the stereo to both, I get the message Warning: detected OpenGL error 'invalid value' after RenderBin::draw(,) and only the first view works. It seems to me that my graphics context is not correct for this use case. Here the main lines of my test programme: // DisplaySettings osg::DisplaySettings* ds0 = new osg::DisplaySettings; ds0-setStereo(true); ds0-setStereoMode(osg::DisplaySettings::HORIZONTAL_INTERLACE); osg::DisplaySettings* ds1 = new osg::DisplaySettings; ds1-setStereo(true); ds1-setStereoMode(osg::DisplaySettings::HORIZONTAL_INTERLACE); // Graphics Context osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits; traits-x = 100; traits-y = 100; traits-width = 1000; traits-height = 800; traits-windowDecoration = true; traits-doubleBuffer = true; traits-sharedContext = 0; traits-stencil = 8; traits-useMultiThreadedOpenGLEngine=true; traits-vsync=true; traits-screenNum = 0; osg::ref_ptrosg::GraphicsContext gc = osg::GraphicsContext::createGraphicsContext(traits.get()); if (gc.valid()){ [...] } osg::ref_ptr osgViewer::View view0 = new osgViewer::View; view0-setDisplaySettings(ds0); [...] osg::ref_ptr osgViewer::View view1 = new osgViewer::View; view1-setDisplaySettings(ds1); [...] Best regards Martin Original-Nachricht Datum: Mon, 14 Feb 2011 11:36:53 + Von: Robert Osfield robert.osfi...@gmail.com An: OpenSceneGraph Users osg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Problem: CompositeViewer doesn\'t work with Stereo Hi Martin, The rendering backend is identical between Viewer and CompositeViewer so both are fully capable of doing stereo. I presume the issue comes from the DisplaySettings hints used to pass in the stereo settings. With CompositeViewer each View can have it's own DisplaySettings object so you can set this up independantly. Robert. 2011/2/14 Martin Großer grosser.mar...@gmx.de: Hello, I use the osg composite viewer and I try to use some stereo mode, i.e. CHECKERBOARD, HORIZONTAL_INTERLACE or the VERTICAL_INTERLACE. But this modes don't work with the composite viewer. I use osg 2.8. I guessed it is a problem in my application, so I tried the osgcompositeviewer example with these stereo modes. Also these didn't work. Any ideas? Cheers Martin -- Schon gehört? GMX hat einen genialen Phishing-Filter in die Toolbar eingebaut! http://www.gmx.net/de/go/toolbar ___ 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 -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Problem: CompositeViewer doesn't work with Stereo
have you tried sharing a context between the views? I'm not very familiar with stereo, but my guess would be the context of the second view is not set for stereo. jp On 16/02/11 14:50, Martin Großer wrote: Hi, there are no ideas what is wrong with my test programme? I have no idea to fix this problem. Cheers Martin Original-Nachricht Datum: Tue, 15 Feb 2011 10:34:49 +0100 Von: Martin Großergrosser.mar...@gmx.de An: OpenSceneGraph Usersosg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Problem: CompositeViewer doesn\'t work with Stereo Hello Robert, I tried a simple test programme. I used the composite viewer and two views. If I set up stereo on one view, it works fine. Also with the horizontal interlace. But if I set the stereo to both, I get the message Warning: detected OpenGL error 'invalid value' after RenderBin::draw(,) and only the first view works. It seems to me that my graphics context is not correct for this use case. Here the main lines of my test programme: // DisplaySettings osg::DisplaySettings* ds0 = new osg::DisplaySettings; ds0-setStereo(true); ds0-setStereoMode(osg::DisplaySettings::HORIZONTAL_INTERLACE); osg::DisplaySettings* ds1 = new osg::DisplaySettings; ds1-setStereo(true); ds1-setStereoMode(osg::DisplaySettings::HORIZONTAL_INTERLACE); // Graphics Context osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits; traits-x = 100; traits-y = 100; traits-width = 1000; traits-height = 800; traits-windowDecoration = true; traits-doubleBuffer = true; traits-sharedContext = 0; traits-stencil = 8; traits-useMultiThreadedOpenGLEngine=true; traits-vsync=true; traits-screenNum = 0; osg::ref_ptrosg::GraphicsContext gc = osg::GraphicsContext::createGraphicsContext(traits.get()); if (gc.valid()){ [...] } osg::ref_ptr osgViewer::View view0 = new osgViewer::View; view0-setDisplaySettings(ds0); [...] osg::ref_ptr osgViewer::View view1 = new osgViewer::View; view1-setDisplaySettings(ds1); [...] Best regards Martin Original-Nachricht Datum: Mon, 14 Feb 2011 11:36:53 + Von: Robert Osfieldrobert.osfi...@gmail.com An: OpenSceneGraph Usersosg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Problem: CompositeViewer doesn\'t work with Stereo Hi Martin, The rendering backend is identical between Viewer and CompositeViewer so both are fully capable of doing stereo. I presume the issue comes from the DisplaySettings hints used to pass in the stereo settings. With CompositeViewer each View can have it's own DisplaySettings object so you can set this up independantly. Robert. 2011/2/14 Martin Großergrosser.mar...@gmx.de: Hello, I use the osg composite viewer and I try to use some stereo mode, i.e. CHECKERBOARD, HORIZONTAL_INTERLACE or the VERTICAL_INTERLACE. But this modes don't work with the composite viewer. I use osg 2.8. I guessed it is a problem in my application, so I tried the osgcompositeviewer example with these stereo modes. Also these didn't work. Any ideas? Cheers Martin -- Schon gehört? GMX hat einen genialen Phishing-Filter in die Toolbar eingebaut! http://www.gmx.net/de/go/toolbar ___ 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 -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] how to make a boat wake used by osg ocean
hi,i want to make a boat wake used by osg ocean.how can i do?___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Problem: CompositeViewer doesn't work with Stereo
Hello J.P., both cameras have the same graphics context (gc). Here the complete part of the code with the views: osg::ref_ptr osgViewer::View view0 = new osgViewer::View; view0-setSceneData(root); view0-setDisplaySettings(ds0); view0-getCamera()-setViewport(500,0,500,800); view0-getCamera()-setGraphicsContext(gc); osg::ref_ptr osgViewer::View view1 = new osgViewer::View; view1-setSceneData(root); view1-setDisplaySettings(ds1); view1-getCamera()-setViewport(0,0,500,800); view1-getCamera()-setGraphicsContext(gc); osg::ref_ptr osgViewer::CompositeViewer viewer = new osgViewer::CompositeViewer; viewer-addView(view0); viewer-addView(view1); Cheers Martin Original-Nachricht Datum: Wed, 16 Feb 2011 14:58:19 +0200 Von: J.P. Delport jpdelp...@csir.co.za An: OpenSceneGraph Users osg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Problem: CompositeViewer doesn\'t work with Stereo have you tried sharing a context between the views? I'm not very familiar with stereo, but my guess would be the context of the second view is not set for stereo. jp On 16/02/11 14:50, Martin Großer wrote: Hi, there are no ideas what is wrong with my test programme? I have no idea to fix this problem. Cheers Martin Original-Nachricht Datum: Tue, 15 Feb 2011 10:34:49 +0100 Von: Martin Großergrosser.mar...@gmx.de An: OpenSceneGraph Usersosg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Problem: CompositeViewer doesn\'t work with Stereo Hello Robert, I tried a simple test programme. I used the composite viewer and two views. If I set up stereo on one view, it works fine. Also with the horizontal interlace. But if I set the stereo to both, I get the message Warning: detected OpenGL error 'invalid value' after RenderBin::draw(,) and only the first view works. It seems to me that my graphics context is not correct for this use case. Here the main lines of my test programme: // DisplaySettings osg::DisplaySettings* ds0 = new osg::DisplaySettings; ds0-setStereo(true); ds0-setStereoMode(osg::DisplaySettings::HORIZONTAL_INTERLACE); osg::DisplaySettings* ds1 = new osg::DisplaySettings; ds1-setStereo(true); ds1-setStereoMode(osg::DisplaySettings::HORIZONTAL_INTERLACE); // Graphics Context osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits; traits-x = 100; traits-y = 100; traits-width = 1000; traits-height = 800; traits-windowDecoration = true; traits-doubleBuffer = true; traits-sharedContext = 0; traits-stencil = 8; traits-useMultiThreadedOpenGLEngine=true; traits-vsync=true; traits-screenNum = 0; osg::ref_ptrosg::GraphicsContext gc = osg::GraphicsContext::createGraphicsContext(traits.get()); if (gc.valid()){ [...] } osg::ref_ptr osgViewer::View view0 = new osgViewer::View; view0-setDisplaySettings(ds0); [...] osg::ref_ptr osgViewer::View view1 = new osgViewer::View; view1-setDisplaySettings(ds1); [...] Best regards Martin Original-Nachricht Datum: Mon, 14 Feb 2011 11:36:53 + Von: Robert Osfieldrobert.osfi...@gmail.com An: OpenSceneGraph Usersosg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Problem: CompositeViewer doesn\'t work with Stereo Hi Martin, The rendering backend is identical between Viewer and CompositeViewer so both are fully capable of doing stereo. I presume the issue comes from the DisplaySettings hints used to pass in the stereo settings. With CompositeViewer each View can have it's own DisplaySettings object so you can set this up independantly. Robert. 2011/2/14 Martin Großergrosser.mar...@gmx.de: Hello, I use the osg composite viewer and I try to use some stereo mode, i.e. CHECKERBOARD, HORIZONTAL_INTERLACE or the VERTICAL_INTERLACE. But this modes don't work with the composite viewer. I use osg 2.8. I guessed it is a problem in my application, so I tried the osgcompositeviewer example with these stereo modes. Also these didn't work. Any ideas? Cheers Martin -- Schon gehört? GMX hat einen genialen Phishing-Filter in die Toolbar eingebaut! http://www.gmx.net/de/go/toolbar ___ 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 -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ osg-users mailing list osg-users@lists.openscenegraph.org
Re: [osg-users] Problem: CompositeViewer doesn't work with Stereo
Hi, OK, I saw this traits-sharedContext = 0; We normally have something like this: if (this-getNumViews() = 1) { traits-sharedContext = this-getView(0)-getCamera()-getGraphicsContext(); } jp On 16/02/11 15:12, Martin Großer wrote: Hello J.P., both cameras have the same graphics context (gc). Here the complete part of the code with the views: osg::ref_ptr osgViewer::View view0 = new osgViewer::View; view0-setSceneData(root); view0-setDisplaySettings(ds0); view0-getCamera()-setViewport(500,0,500,800); view0-getCamera()-setGraphicsContext(gc); osg::ref_ptr osgViewer::View view1 = new osgViewer::View; view1-setSceneData(root); view1-setDisplaySettings(ds1); view1-getCamera()-setViewport(0,0,500,800); view1-getCamera()-setGraphicsContext(gc); osg::ref_ptr osgViewer::CompositeViewer viewer = new osgViewer::CompositeViewer; viewer-addView(view0); viewer-addView(view1); Cheers Martin Original-Nachricht Datum: Wed, 16 Feb 2011 14:58:19 +0200 Von: J.P. Delportjpdelp...@csir.co.za An: OpenSceneGraph Usersosg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Problem: CompositeViewer doesn\'t work with Stereo have you tried sharing a context between the views? I'm not very familiar with stereo, but my guess would be the context of the second view is not set for stereo. jp On 16/02/11 14:50, Martin Großer wrote: Hi, there are no ideas what is wrong with my test programme? I have no idea to fix this problem. Cheers Martin Original-Nachricht Datum: Tue, 15 Feb 2011 10:34:49 +0100 Von: Martin Großergrosser.mar...@gmx.de An: OpenSceneGraph Usersosg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Problem: CompositeViewer doesn\'t work with Stereo Hello Robert, I tried a simple test programme. I used the composite viewer and two views. If I set up stereo on one view, it works fine. Also with the horizontal interlace. But if I set the stereo to both, I get the message Warning: detected OpenGL error 'invalid value' after RenderBin::draw(,) and only the first view works. It seems to me that my graphics context is not correct for this use case. Here the main lines of my test programme: // DisplaySettings osg::DisplaySettings* ds0 = new osg::DisplaySettings; ds0-setStereo(true); ds0-setStereoMode(osg::DisplaySettings::HORIZONTAL_INTERLACE); osg::DisplaySettings* ds1 = new osg::DisplaySettings; ds1-setStereo(true); ds1-setStereoMode(osg::DisplaySettings::HORIZONTAL_INTERLACE); // Graphics Context osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits; traits-x = 100; traits-y = 100; traits-width = 1000; traits-height = 800; traits-windowDecoration = true; traits-doubleBuffer = true; traits-sharedContext = 0; traits-stencil = 8; traits-useMultiThreadedOpenGLEngine=true; traits-vsync=true; traits-screenNum = 0; osg::ref_ptrosg::GraphicsContext gc = osg::GraphicsContext::createGraphicsContext(traits.get()); if (gc.valid()){ [...] } osg::ref_ptr osgViewer::View view0 = new osgViewer::View; view0-setDisplaySettings(ds0); [...] osg::ref_ptr osgViewer::View view1 = new osgViewer::View; view1-setDisplaySettings(ds1); [...] Best regards Martin Original-Nachricht Datum: Mon, 14 Feb 2011 11:36:53 + Von: Robert Osfieldrobert.osfi...@gmail.com An: OpenSceneGraph Usersosg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Problem: CompositeViewer doesn\'t work with Stereo Hi Martin, The rendering backend is identical between Viewer and CompositeViewer so both are fully capable of doing stereo. I presume the issue comes from the DisplaySettings hints used to pass in the stereo settings. With CompositeViewer each View can have it's own DisplaySettings object so you can set this up independantly. Robert. 2011/2/14 Martin Großergrosser.mar...@gmx.de: Hello, I use the osg composite viewer and I try to use some stereo mode, i.e. CHECKERBOARD, HORIZONTAL_INTERLACE or the VERTICAL_INTERLACE. But this modes don't work with the composite viewer. I use osg 2.8. I guessed it is a problem in my application, so I tried the osgcompositeviewer example with these stereo modes. Also these didn't work. Any ideas? Cheers Martin -- Schon gehört? GMX hat einen genialen Phishing-Filter in die Toolbar eingebaut! http://www.gmx.net/de/go/toolbar ___ 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 -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ osg-users mailing list osg-users@lists.openscenegraph.org
Re: [osg-users] Fwd: Controlling animations in FBX models
Glad to hear it worked I got 2 messages: OutputStream::writeObject(): Unsupported wrapper class osg::ComputeBoundingBoxCallback OutputStream::writeObject(): Unsupported wrapper class osg::UpdateCallback I get the same errors, I think it has to do with why you can only save to osgb. I dare say the fbx plugin creates some kind of custom callbacks that normal osg is unaware of. Any how let me know if you add any bug fixes etc Tom ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Render To Texture
Hi, I noticed the problem with first call of viewer.frame() too. This is happens. because meanwhile the viewer initialization - which is called by first call of viewer.frame() - a call to glGetString (SceneView::init() - osg::isGLExtensionSupported(_renderInfo.getState()-getContextID(),); ) triggers exiting to the caller of viewer.frame(). Actually nothing is rendered in the first frame. The following code works for me to get an offscreen viewer. I don't know if you can leave sth. out from the traits. osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits(); traits-x = viewport-x(); // viewport of camera traits-y = viewport-y(); traits-width = viewport-width(); traits-height = viewport-height(); traits-windowDecoration = false; traits-doubleBuffer = false; traits-sharedContext = NULL; traits-pbuffer = true; osg::GraphicsContext *graphicsContext = osg::GraphicsContext::createGraphicsContext(traits.get()); if(!graphicsContext) { osg::notify(osg::NOTICE) Failed to create pbuffer, failing back to normal graphics window. std::endl; traits-pbuffer = false; graphicsContext = osg::GraphicsContext::createGraphicsContext(traits.get()); } viewer-getCamera()-setGraphicsContext(graphicsContext); I found another problem: I would like to change the textures used for render to texture. However the framebufferobject used by osg is only initialized once and cannot be updated - at least with an approach like in the osgmultiplerendertargets example. Camera::detach() has no effect. Best Regards Dietmar Funck -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36728#36728 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: Marching Cube Example?
Hi, thanks everyone here to give me the ideas... I will try matching Cube GPU with OSG. Geomtery shader with OSG i think is the best solution. isn't it? ... Thank you! Cheers, Nan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36730#36730 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] StandardShadowMap and Render To Texture
Hello, Every day a new problem. :-) Ok, so my Render To Texture works, but my shadows are not visible in the texture (rendertarget). My Settings: rtt_cam-setRenderOrder(::osg::Camera::PRE_RENDER, 0); rtt_cam-setRenderTargetImplementation( osg::Camera::FRAME_BUFFER_OBJECT ); rtt_cam-attach(::osg::Camera::COLOR_BUFFER, rtt_tex, 0, 0); Is the Problem the pre rendering? Because the standard shadow map has also a pre render camera. I am not sure which camera do the first rendering. Or is it another Problem? Cheers Martin -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to change a texture in a imported OSG file?
hybr wrote: Hi, Almir there are visitor that find drawable by name for you class GetDrawableByNameVisitor:public osg::NodeVisitor { public: GetDrawableByNameVisitor(const std::string name):osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN): m_name(name), result(0) { setNodeMaskOverride(0x); setTraversalMask(0x); } using osg::NodeVisitor::apply; void apply(osg::Geode geode) { for (int i = 0; i geode.getNumDrawables(); i++) { osg::Drawable* dr = geode.getDrawable(i); if (dr-getName()==m_name) result = dr; } } osg::Drawable* getResult(){return result;} private: std::string m_name; osg::Drawable* result; }; so in your example you need something like GetDrawableByNameVisitor gdbnv(name of your material in 3dsmax with texture you wanna change) arTransformA-accept(gdbny); if (gdbny.getResult()) { osg::ImageStream* is = ...;//load your movie or whatever you got osg::Texture2D* animatedTexture = new osg::Texture2D(is); gdbny.getResult()-getOrCreateStateSet()-setTextureAttribute(0,animatedTexture,osg::StateAttribute::ON); } there can be case when your texture is not on 0 texture unit so you may need to go through like first 8 texture units with stateset getTextureAttribute(tex_unit_number, osg::StateAttribute::TEXTURE) and check which one texture unit have texture, then set your new texture created with imagestream to that texture unit with setTextureAttribute on stateset. Cheers, Sergey. 16.02.2011, 05:15, Almir Brazil : hybr wrote: Hi, Almir Try following thing: Look at material name which uses this texture in 3ds max, in osg this will be the name of drawable with stateset that uses this texture. You can find this drawable with some visitor, get stateset there, then set your animated texture to texture unit where old texture is (if there are one texture in material it's 0 by default). Cheers, Sergey. 15.02.2011, 04:24, Almir Brazil : Hi, I'm new to OpenSceneGraph, and I have the following scenario: A OSG file exported from 3DS Max, using OSGExp0.9.8 That file has 3 textures... 2 should be static, and 1 should be animated. When playing the exported OSG file, all 3 textures still static. I read few things about osg imagesequence, that can read a lot of sequential images to produce a animated texture effect. And that's what I'm looking for!! My dificultie is to change (in code) the static texture exported from 3DSMax to a imagesequence texture. Can anyone say me how to do that? ... Thank you! Cheers, Almir -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36665#36665 ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum Ok, here is the code... It's a modified version of osgartsimple.cpp: (see attachment) The OSG file - karsten.osg - (generated with 3ds Max) has 3 main textures. I want to change one of them with a imagesequence or movie file (quicktime .mov) (I have both of them). I haven't a Geode object, only a VideoGeode... how can I create a stateset to change the texture? Thanks! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36711#36711 /* -*-c++-*- * * osgART - ARToolKit for OpenSceneGraph * Copyright (C) 2005-2008 Human Interface Technology Laboratory New Zealand * * This file is part of osgART 2.0 * * osgART 2.0 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * osgART 2.0 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with osgART 2.0. If not, see http://www.gnu.org/licenses/. * */ #include osgART/Foundation #include osgART/VideoLayer #include osgART/PluginManager #include osgART/VideoGeode #include
Re: [osg-users] Render To Texture
Hi Dietmar Funck Thank you very much for your reply. Do you mean, the first viewer.frame() is used for initialization that why nothing is rendered in the first frame ?. Best regards, Phummipat On Wed, Feb 16, 2011 at 2:48 PM, Dietmar Funck dietmar.fu...@student.hpi.uni-potsdam.de wrote: Hi, I noticed the problem with first call of viewer.frame() too. This is happens. because meanwhile the viewer initialization - which is called by first call of viewer.frame() - a call to glGetString (SceneView::init() - osg::isGLExtensionSupported(_renderInfo.getState()-getContextID(),); ) triggers exiting to the caller of viewer.frame(). Actually nothing is rendered in the first frame. The following code works for me to get an offscreen viewer. I don't know if you can leave sth. out from the traits. osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits(); traits-x = viewport-x(); // viewport of camera traits-y = viewport-y(); traits-width = viewport-width(); traits-height = viewport-height(); traits-windowDecoration = false; traits-doubleBuffer = false; traits-sharedContext = NULL; traits-pbuffer = true; osg::GraphicsContext *graphicsContext = osg::GraphicsContext::createGraphicsContext(traits.get()); if(!graphicsContext) { osg::notify(osg::NOTICE) Failed to create pbuffer, failing back to normal graphics window. std::endl; traits-pbuffer = false; graphicsContext = osg::GraphicsContext::createGraphicsContext(traits.get()); } viewer-getCamera()-setGraphicsContext(graphicsContext); I found another problem: I would like to change the textures used for render to texture. However the framebufferobject used by osg is only initialized once and cannot be updated - at least with an approach like in the osgmultiplerendertargets example. Camera::detach() has no effect. Best Regards Dietmar Funck -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36728#36728 ___ 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] osgPPU HDR culled from certain angles?
Hi Sergey, I've had same issues using osgPPU, for me problem was happening only when i had turned on near\far computation on viewer's camera, i've used this mode only to test some stuff so i didnt investigated this issue further. May be this will give you some hints on problem roots. Hmmm, I saw that the osgPPU HDR example's setupCamera() method disables near/far computation, but in our framework we turn it back on in almost all cases. So this may be the problem. I'll look into this. If this is the problem, I would like to avoid osgPPU forcing the main camera's compute near/far mode off, since it is useful in many cases. It should be possible to only turn it off when going through the cull phase for the osgPPU quads, but then turning it back on the way it was afterwards. Ideally, osgPPU would be as unintrusive as possible on the app's normal operation... I just tried, and this was indeed the problem. So we need to make sure the OSGPPU quads are not culled by the near/far computation. I will look into this. Hopefully I can come up with a solution that is general enough to be integrated into osgPPU and will make it work correctly with all apps regardless of the compute near/far setting they use. Thanks again, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com 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] Render To Texture
Hi, Dietmar Funck. In order to get another texture attached you can use something like _cam-setCullCallback( new fboAttachmentCullCB( this ) ); void fboAttachmentCullCB::operator()(osg::Node* node, osg::NodeVisitor* nv) { osg::Camera* fboCam = dynamic_castosg::Camera*( node ); osgUtil::CullVisitor* cv = dynamic_castosgUtil::CullVisitor*(nv); if ( fboCam cv) { cv-getCurrentRenderBin()-getStage()-setFrameBufferObject(NULL); // reset frame buffer object - see RenderStage::runCameraSetUp for details, the fbo has to be created again cv-getCurrentRenderBin()-getStage()-setCameraRequiresSetUp( true ); // we have to ensure that the runCameraSetUp will be entered! } traverse(node,nv); } Cheers, Sergey. 16.02.2011, 16:48, Dietmar Funck dietmar.fu...@student.hpi.uni-potsdam.de: Hi, I noticed the problem with first call of viewer.frame() too. This is happens. because meanwhile the viewer initialization - which is called by first call of viewer.frame() - a call to glGetString (SceneView::init() - osg::isGLExtensionSupported(_renderInfo.getState()-getContextID(),); ) triggers exiting to the caller of viewer.frame(). Actually nothing is rendered in the first frame. The following code works for me to get an offscreen viewer. I don't know if you can leave sth. out from the traits. osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits(); traits-x = viewport-x(); // viewport of camera traits-y = viewport-y(); traits-width = viewport-width(); traits-height = viewport-height(); traits-windowDecoration = false; traits-doubleBuffer = false; traits-sharedContext = NULL; traits-pbuffer = true; osg::GraphicsContext *graphicsContext = osg::GraphicsContext::createGraphicsContext(traits.get()); if(!graphicsContext) { osg::notify(osg::NOTICE) Failed to create pbuffer, failing back to normal graphics window. std::endl; traits-pbuffer = false; graphicsContext = osg::GraphicsContext::createGraphicsContext(traits.get()); } viewer-getCamera()-setGraphicsContext(graphicsContext); I found another problem: I would like to change the textures used for render to texture. However the framebufferobject used by osg is only initialized once and cannot be updated - at least with an approach like in the osgmultiplerendertargets example. Camera::detach() has no effect. Best Regards Dietmar Funck -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36728#36728 ___ 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] StandardShadowMap and Render To Texture
Maybe your problem is related to the fact that Shadow maps are usually stored in DEPTH_BUFFER (not COLOR_BUFFER). Wojtek Lewandowski -Original Message- From: Martin Großer Sent: Wednesday, February 16, 2011 3:47 PM To: osg-users@lists.openscenegraph.org Subject: [osg-users] StandardShadowMap and Render To Texture Hello, Every day a new problem. :-) Ok, so my Render To Texture works, but my shadows are not visible in the texture (rendertarget). My Settings: rtt_cam-setRenderOrder(::osg::Camera::PRE_RENDER, 0); rtt_cam-setRenderTargetImplementation( osg::Camera::FRAME_BUFFER_OBJECT ); rtt_cam-attach(::osg::Camera::COLOR_BUFFER, rtt_tex, 0, 0); Is the Problem the pre rendering? Because the standard shadow map has also a pre render camera. I am not sure which camera do the first rendering. Or is it another Problem? Cheers Martin -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ 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] StandardShadowMap and Render To Texture
OK, you are right, but that is not my problem. I don't want the shadow texture, which need the DEPTH_BUFFER. I want the final rendering in my texture. The basic graph looks like this: ROOT | rtt_cam (the result has no shadows) | shadowedScene (with StandardShadowMap) | camera (is also a render to texture camera) I hope it is better explanation of my problem. Cheers Martin Original-Nachricht Datum: Wed, 16 Feb 2011 16:19:09 +0100 Von: Wojciech Lewandowski lewandow...@ai.com.pl An: osg-users@lists.openscenegraph.org Betreff: Re: [osg-users] StandardShadowMap and Render To Texture Maybe your problem is related to the fact that Shadow maps are usually stored in DEPTH_BUFFER (not COLOR_BUFFER). Wojtek Lewandowski -Original Message- From: Martin Großer Sent: Wednesday, February 16, 2011 3:47 PM To: osg-users@lists.openscenegraph.org Subject: [osg-users] StandardShadowMap and Render To Texture Hello, Every day a new problem. :-) Ok, so my Render To Texture works, but my shadows are not visible in the texture (rendertarget). My Settings: rtt_cam-setRenderOrder(::osg::Camera::PRE_RENDER, 0); rtt_cam-setRenderTargetImplementation( osg::Camera::FRAME_BUFFER_OBJECT ); rtt_cam-attach(::osg::Camera::COLOR_BUFFER, rtt_tex, 0, 0); Is the Problem the pre rendering? Because the standard shadow map has also a pre render camera. I am not sure which camera do the first rendering. Or is it another Problem? Cheers Martin -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ 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 -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Fwd: Controlling animations in FBX models
Hi Michael Thanks for the info, do you know why I might be having trouble saving these to .ive, .osg, .osgt and .osgx. It's not a show stopper but for some reason I can only re save the imported fbx as .osgb. The rest fail to load except .osg which loads but won't play my animations anymore :( Any info would be much appreciated Tom On 16 February 2011 16:08, Michael Platings mplati...@gmail.com wrote: I dare say the fbx plugin creates some kind of custom callbacks that normal osg is unaware of. Not exactly, the callbacks in question are all part of osgAnimation which is increasingly part of normal osg. They are: osgAnimation::RigComputeBoundingBoxCallback, osgAnimation::MorphGeometry::UpdateVertex osgAnimation::RigGeometry::UpdateVertex ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: Marching Cube Example?
dormouse wrote: Hi, thanks everyone here to give me the ideas... I will try matching Cube GPU with OSG. Geomtery shader with OSG i think is the best solution. isn't it? ... Thank you! Cheers, Nan Sounds Cool! If you have any success, It would be nice (if you can) to share it with us! At least I think, we are rather starved for Shader ideas here. Oh Yea, be careful to avoid any Stupid Shader Tricks! :) Laters! -- D Glenn D Glenn (a.k.a David Glenn) - Moving Heaven and Earth! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36742#36742 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Image brightness using osg::DrawPixels and polygon texture rendering
On 02/16/2011 10:44 AM, Eric Sokolowsky wrote: Hello, Does anyone have suggestions on getting the textured version brighter, hopefully as bright as the DrawPixels version? The textured version is probably getting dimmer because of the linear magnification filter. Since your background is black, any pixels in the image that are partially covering a pixel on the screen are getting mixed with the black background and the overall luminance is lessened because of that. The DrawPixels version is obviously blocky because you're drawing without any kind of magnification filter. If you switched the mag filter settings on the texture version to GL_NEAREST instead of GL_LINEAR, I imagine your results will look very much like the DrawPixels version. Of course, the real problems is that you're rendering the given image to a resolution that is significantly larger than its actual size. Ideally, you'd want to enlarge the original image to as close to the target resolution as you can before using the texturing operations to draw it to the screen. I don't know the source of the image, so I don't know if it's possible or practical to do this, but that would be the best solution. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG 2.9.10 on iOS
Hi, yes, I did it. I finally commented the next lines as a temporal solution: Code: /*else if(dynamic_castconst osgTerrain::Terrain*(node)){ ((ive::Terrain*)(node))-write(this); }*/ on DataOutputStream.cpp and Code: /*else if(nodeTypeID== IVETERRAIN){ node = new osgTerrain::Terrain(); ((ive::Terrain*)(node.get()))-read(this); }*/ on DataInputStream.cpp It seems the functions read and write aren't implemented. Am I right? My problem now is that I've loaded a couple .ive models and they appear at the screen but didn't show their textures. Any of you know what can be the problem? Thank you! Cheers, Dani[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36744#36744 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] disable mipmapping
Hi, How to disable mipmapping on a texture? Thank you! Cheers, lucie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36745#36745 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgWidget::Label::setLabel() does not update the size
The problem now is as follows.` I have the following code: label = new osgWidget::Label; label-setLabel(1234); label-setPadding(10.0f); label-addSize(21.0f, 22.0f); window = new osgWidget::Canvas; window-addWidget(label); window-setUpdateCallback(new AnimatedUpdateCallback(this)); Then on the callback code I have: label-setLabel(123); window-resize(); As result, after the callback code, I see the label shifted a little bit on the right wrt the previous text (i.e. 1234) because the 123 text is shorter. Is there a way to set the label aligned on the left even if I update the text in the callback with a shorter string wrt the previous one? Regards Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36746#36746 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] StandardShadowMap and Render To Texture
View Dependent Shadow techniques don't work with nested cameras. They work with RTT Slave cameras though. Cheers, Wojtek -Original Message- From: Martin Großer Sent: Wednesday, February 16, 2011 4:44 PM To: OpenSceneGraph Users Subject: Re: [osg-users] StandardShadowMap and Render To Texture OK, you are right, but that is not my problem. I don't want the shadow texture, which need the DEPTH_BUFFER. I want the final rendering in my texture. The basic graph looks like this: ROOT | rtt_cam (the result has no shadows) | shadowedScene (with StandardShadowMap) | camera (is also a render to texture camera) I hope it is better explanation of my problem. Cheers Martin Original-Nachricht Datum: Wed, 16 Feb 2011 16:19:09 +0100 Von: Wojciech Lewandowski lewandow...@ai.com.pl An: osg-users@lists.openscenegraph.org Betreff: Re: [osg-users] StandardShadowMap and Render To Texture Maybe your problem is related to the fact that Shadow maps are usually stored in DEPTH_BUFFER (not COLOR_BUFFER). Wojtek Lewandowski -Original Message- From: Martin Großer Sent: Wednesday, February 16, 2011 3:47 PM To: osg-users@lists.openscenegraph.org Subject: [osg-users] StandardShadowMap and Render To Texture Hello, Every day a new problem. :-) Ok, so my Render To Texture works, but my shadows are not visible in the texture (rendertarget). My Settings: rtt_cam-setRenderOrder(::osg::Camera::PRE_RENDER, 0); rtt_cam-setRenderTargetImplementation( osg::Camera::FRAME_BUFFER_OBJECT ); rtt_cam-attach(::osg::Camera::COLOR_BUFFER, rtt_tex, 0, 0); Is the Problem the pre rendering? Because the standard shadow map has also a pre render camera. I am not sure which camera do the first rendering. Or is it another Problem? Cheers Martin -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ 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 -- NEU: FreePhone - kostenlos mobil telefonieren und surfen! Jetzt informieren: http://www.gmx.net/de/go/freephone ___ 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] [osgPlugins] Michael Platings
Hi, Can you please tell me how i can use fbx files in osg? i only know you need download the fbx files Thank you! Cheers, Josue -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36748#36748 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Camera control in osgvisual
Hi Shane, Today I spent a lot of time in reading CIGI documentation and playing with the MPV and HE. Am I right that CIGI is a framework to organize and standardize date formats and query formats, but it does not provide the final network communication functions? Thank you! Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36750#36750 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Image brightness using osg::DrawPixels and polygon texture rendering
Eric, You should look at your TexEnv parameters. Use something like DECAL or REPLACE. Looks like you are using the default, which is MODULATE, which takes into account the color of the polygon with the texture. Of course these modes (DECAL,REPLACE) will disable any lighting that is going on, but you seem to want that anyway. HTH -- Chuck On Feb 16, 2011, at 12:42 PM, Eric Sokolowsky wrote: Jason, Thanks for the suggestion. I did re-render the image at twice the size but I'm still seeing that the textured polygon version is noticeably dimmer than the DrawPixels version. See the attached image. I have three images here, each rendered twice, the top drawn with the textured polygon and the bottom rendered with DrawPixels. I'm not doing any enlargement now. Any ideas on why the DrawPixels version so much brighter than the textured polygon? -Eric On Wed, Feb 16, 2011 at 11:35 AM, Jason Daly jd...@ist.ucf.edu wrote: On 02/16/2011 10:44 AM, Eric Sokolowsky wrote: Hello, Does anyone have suggestions on getting the textured version brighter, hopefully as bright as the DrawPixels version? The textured version is probably getting dimmer because of the linear magnification filter. Since your background is black, any pixels in the image that are partially covering a pixel on the screen are getting mixed with the black background and the overall luminance is lessened because of that. The DrawPixels version is obviously blocky because you're drawing without any kind of magnification filter. If you switched the mag filter settings on the texture version to GL_NEAREST instead of GL_LINEAR, I imagine your results will look very much like the DrawPixels version. Of course, the real problems is that you're rendering the given image to a resolution that is significantly larger than its actual size. Ideally, you'd want to enlarge the original image to as close to the target resolution as you can before using the texturing operations to draw it to the screen. I don't know the source of the image, so I don't know if it's possible or practical to do this, but that would be the best solution. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org out-2.png___ 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] Image brightness using osg::DrawPixels and polygon texture rendering
On Wed, Feb 16, 2011 at 4:12 PM, Chuck Seberino seber...@energid.orgwrote: You should look at your TexEnv parameters. Use something like DECAL or REPLACE. Looks like you are using the default, which is MODULATE, which takes into account the color of the polygon with the texture. Of course these modes (DECAL,REPLACE) will disable any lighting that is going on, but you seem to want that anyway. Chuck, Thank you! This is what I was missing. I used REPLACE mode and now the textured version is the same brightness as the DrawPixels version. You are right in that I don't need any lighting. Thanks again! -Eric ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Problem with scaleImage, copySubImage
Hi, I am trying to create a 3D texture from multiple jpegs as in the texture3D example, however my program is segfaulting at calls to scaleImage() and copySubImage() and I have no idea why. The test picture right now is 512x512, however I do need to eventually rescale pictures that are 1024x768. Here is my code: Image * test = osgDB::readImageFile(/home/rpardrid/Desktop/testimg.jpg); GLint texSize = 512; GLenum pixelFormat = test-getPixelFormat(); GLenum type = test-getDataType(); Image * largeImage = new Image; largeImage-allocateImage(texSize, texSize, numImages, pixelFormat, type); test-scaleImage(texSize, texSize, 1); largeImage-copySubImage(0,0,0,test); ... Thank you! Cheers, Robert -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36754#36754 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to change a texture in a imported OSG file?
Hi hybr! I can feel that I'm getting close. I've done all what you say.. the project compile sucessfully, but I'm getting a black texture replacing my original static texture. I tried all first 8 texture units, as you say. I know that the imagestream is playing, because I can see the 'resize' messages in console. Did I forget something? (code attached below). Thanks, Almir -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36755#36755 /* -*-c++-*- * * osgART - ARToolKit for OpenSceneGraph * Copyright (C) 2005-2008 Human Interface Technology Laboratory New Zealand * * This file is part of osgART 2.0 * * osgART 2.0 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * osgART 2.0 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with osgART 2.0. If not, see http://www.gnu.org/licenses/. * */ #include osgART/Foundation #include osgART/VideoLayer #include osgART/PluginManager #include osgART/VideoGeode #include osgART/Utils #include osgART/GeometryUtils #include osgART/MarkerCallback #include osgART/TransformFilterCallback #include osgViewer/Viewer #include osgViewer/ViewerEventHandlers #include osgDB/FileUtils #include osgDB/WriteFile #include osgDB/ReadFile #include osgDB/FileNameUtils #include osgDB/Registry #include osg/NodeVisitor osg::Group* createImageBackground(osg::Image* video) { osgART::VideoLayer* _layer = new osgART::VideoLayer(); _layer-setSize(*video); osgART::VideoGeode* _geode = new osgART::VideoGeode(osgART::VideoGeode::USE_TEXTURE_2D, video); addTexturedQuad(*_geode,video-s(),video-t()); _layer-addChild(_geode); return _layer; } class GetDrawableByNameVisitor : public osg::NodeVisitor { public: GetDrawableByNameVisitor(const std::string name): osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), m_name(name), result(0) { setNodeMaskOverride(0x); setTraversalMask(0x); } using osg::NodeVisitor::apply; void apply(osg::Geode geode) { for (unsigned int i = 0; i geode.getNumDrawables(); i++) { osg::Drawable* dr = geode.getDrawable(i); if (dr-getName()==m_name) result = dr; } } osg::Drawable* getResult(){return result;} private: std::string m_name; osg::Drawable* result; }; int main(int argc, char* argv[]) { // create a root node osg::ref_ptrosg::Group root = new osg::Group; osgViewer::Viewer viewer; // attach root node to the viewer viewer.setSceneData(root.get()); // add relevant handlers to the viewer viewer.addEventHandler(new osgViewer::StatsHandler); viewer.addEventHandler(new osgViewer::WindowSizeHandler); viewer.addEventHandler(new osgViewer::ThreadingHandler); viewer.addEventHandler(new osgViewer::HelpHandler); // preload the video and tracker int _video_id = osgART::PluginManager::instance()-load(osgart_video_artoolkit2); int _tracker_id = osgART::PluginManager::instance()-load(osgart_tracker_artoolkit2); // Load a video plugin. osg::ref_ptrosgART::Video video = dynamic_castosgART::Video*(osgART::PluginManager::instance()-get(_video_id)); // check if an instance of the video stream could be started if (!video.valid()) { // Without video an AR application can not work. Quit if none found. osg::notify(osg::FATAL) Could not initialize video plugin! std::endl; exit(-1); } // Open the video. This will not yet start the video stream but will // get information about the format of the video which is essential // for the connected tracker video-open(); osg::ref_ptrosgART::Tracker tracker = dynamic_castosgART::Tracker*(osgART::PluginManager::instance()-get(_tracker_id)); if (!tracker.valid()) { // Without tracker an AR application can not work. Quit if none found. osg::notify(osg::FATAL) Could not initialize tracker plugin! std::endl; exit(-1); } // get the tracker calibration object osg::ref_ptrosgART::Calibration calibration = tracker-getOrCreateCalibration();
[osg-users] from Node (loaded from .3ds file) to vec3Array
Hi, i would like to load a 3ds file, that point is ok i have my node* but now i need an Vec3Array from this node*, can i do it and how if possible? that you a lot ! Cheers, Tony. (http://www.hordes.fr?ref=litllechicken) -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36757#36757 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org