Re: [osg-users] Texture problem on Android With GLES1 (Not Environmental mapping)
Hi Rafa, Thank you for the nice help. I did as you said. But still textures are not displayed. These are the things what I did 1) I added -losgdb_jpeg under LOCAL_LDFLAGS in Android.mk file 2) I added ljpeg under LOCAL_LDLIBS in Android.mk file 3) I added USE_OSGPLUGIN(jpeg) to OsgMainApp.hpp file. 4) The JPEG is in Image folder only. The Image directory is in my mobile SD card (/mnt/sdcard/OSG/images). 5) The libosgdb_jpeg.a file is located in both install/obj/local/armeabi and /install/obj/local/armeabi-v7a directories. JPEG library is already installed in my system. When I gave locate jpeg.so then I got the following Code: /usr/lib/ImageMagick-6.6.9/modules-Q16/coders/jpeg.so /usr/lib/i386-linux-gnu/libjpeg.so.8 /usr/lib/i386-linux-gnu/libjpeg.so.8.0.2 /usr/lib/i386-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-jpeg.so /usr/lib/i386-linux-gnu/gstreamer-0.10/libgstjpeg.so /usr/lib/i386-linux-gnu/qt4/plugins/imageformats/libqjpeg.so /usr/lib/jvm/java-6-openjdk-i386/jre/lib/i386/libjpeg.so /usr/lib/strigi/strigiea_jpeg.so I exported the path of the libjpeg.so.8 as export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/i386-linux-gnu Can you please help me why the texture are not loading? ... Thank you! Cheers, Koduri -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49910#49910 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Texture problem on Android With GLES1 (Not Environmental mapping)
Hi Koduri, I did as you said. But still textures are not displayed. These are the things what I did 1) I added -losgdb_jpeg under LOCAL_LDFLAGS in Android.mk file 2) I added ljpeg under LOCAL_LDLIBS in Android.mk file 3) I added USE_OSGPLUGIN(jpeg) to OsgMainApp.hpp file. 4) The JPEG is in Image folder only. The Image directory is in my mobile SD card (/mnt/sdcard/OSG/images). 5) The libosgdb_jpeg.a file is located in both install/obj/local/armeabi and /install/obj/local/armeabi-v7a directories I think you need to upload your texture to the device and if necessary change the path in the .osg file, if not, for sure it will not be able to find it. Did you try to convert your model to .osgb or .ive with embedded textures?, I think for android is better to work with binary formats with textures inside. . JPEG library is already installed in my system. When I gave locate jpeg.so then I got the following Code: /usr/lib/ImageMagick-6.6.9/modules-Q16/coders/jpeg.so /usr/lib/i386-linux-gnu/libjpeg.so.8 /usr/lib/i386-linux-gnu/libjpeg.so.8.0.2 /usr/lib/i386-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-jpeg.so /usr/lib/i386-linux-gnu/gstreamer-0.10/libgstjpeg.so /usr/lib/i386-linux-gnu/qt4/plugins/imageformats/libqjpeg.so /usr/lib/jvm/java-6-openjdk-i386/jre/lib/i386/libjpeg.so /usr/lib/strigi/strigiea_jpeg.so I exported the path of the libjpeg.so.8 as export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/i386-linux-gnu If you are working on android, then your system libraries are useless in this case, you need to build all the stuff in your android binary statically. Cheers, Rafa. -- Rafael Gaitán Linares CTO at Mirage Technologies S.L - http://www.mirage-tech.com gvSIG3D Developer - http://gvsig3d.blogspot.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Ideas about a resource system, and deferred rendering framework
Hi functionally it is about same as osgPPU as far as i can tell, but more straightforward and easy to use. I like it :) Was missing ogre-like materials and compositiors when working with osg, tyvm for your work. 10.09.2012, 18:57, Wang Rui wangra...@gmail.com: Hi all, Just to announce that the material system is still in progress and I've just made the first version for myself to test and use. An optimized version with a complete deferred shading pipeline (XML files) will be submitted if it could fit most requirements. As to share my current work with anyone who are also interested in this idea and implementations, I'd like to attach the source files along with this mail instead of submitting it in full fling. If you do have better ideas, think the work is misdirected or needs to be fixed in some parts, please don't hesitate to tell me. A second version with more test files and a detailed XML file introduction will be updated soon after some days. Thanks, Wang Rui 2012/6/21 Wang Rui wangra...@gmail.com: Hi Robert, hi all, During the past few days, I was thinking of implementing a resource system, as well as a rendering structure which could support both forward and deferred rendering for OSG. This could help developers design complex materials and effects, test cutting-edge GPU techniques, and implement multi-pass / deferred rendering pipelines with user-friendly interfaces or even a readable script format. Similar work were already done in some game engines like Ogre3D, CryEngine and Unreal, and I now plan to work out something with the same power and can fit our OSG users much better. :-) My initial thoughts are: 1. A resource system records all the resource used in the rendering pipeline, including textures, state attributes, shaders, uniforms, camera parameters, and semantics (not used in GLSL, but very useful IMHO). Resource can be referred by other resource, or obtained from APIs to be altered. It can be recorded in an XML-based format for reading/writing, and external uses. 2. A rendering framework uses one or more techniques, passes, and connect their inputs/outputs for complex render work. It can also be recorded by the resource system and is implemented as a group node in the scene graph, which performs actual forward/deferred rendering work. 3. Some in-built techniques and passes can help implement some complex effects on customized scene quickly. Common ones I planned include HDR, SSDO, godrays, depth of field, motion blur, lensflare, color grading and FXAA. A benchmark could be developed first to show how the framework works. 4. Reader/writers could be developed then to convert DAE, CGFX, or even other game engine scripts into OSG native rendering pipelines, which will greatly help migrations from other engines. The resource system itself is actually abstract and can be extended to contain whole scene information later, so it could be placed in the osgDB library. And the new rendering pipeline, which can totally replace current osgFX functionlities, can be placed in osgFX and rendering resource management will be done here, too. I'm glad to work with others who has interests in such an idea, and hope an initial version could be finished before OSG 3.2. For the first stage I will borrow some code from the osgPostEffects library in my experimental osgXI project, to quickly build the low-level APIs of the framework. But anyone who have better ideas, or could contribute some code or effects will be really appreciated. Cheers, Wang Rui , ___ 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] [vpb] Building Virtual Planet Builder in Linux
I saw that installing OSG on Linux would be easy, so gave it a shot on RHEL6.x. OSG built without any problems, and I set the paths mentioned in this page (http://www.openscenegraph.org/projects/osg/wiki/Support/GettingStarted). But when I created a git clone of virtualplanetbuilder and typed the ./configure of VPB, it gave me this error: Code: [root@static-104 vpb]# ./configure -- Could NOT find osgDB (missing: OSGDB_LIBRARY OSGDB_INCLUDE_DIR) -- Could NOT find osgFX (missing: OSGFX_LIBRARY OSGFX_INCLUDE_DIR) -- Could NOT find osgUtil (missing: OSGUTIL_LIBRARY OSGUTIL_INCLUDE_DIR) -- Could NOT find osgSim (missing: OSGSIM_LIBRARY OSGSIM_INCLUDE_DIR) -- Could NOT find osgTerrain (missing: OSGTERRAIN_LIBRARY OSGTERRAIN_INCLUDE_DIR) -- Could NOT find osgViewer (missing: OSGVIEWER_LIBRARY OSGVIEWER_INCLUDE_DIR) -- Could NOT find osgGA (missing: OSGGA_LIBRARY OSGGA_INCLUDE_DIR) -- Could NOT find osgText (missing: OSGTEXT_LIBRARY OSGTEXT_INCLUDE_DIR) -- Could NOT find osg (missing: OSG_LIBRARY OSG_INCLUDE_DIR) -- Could NOT find OpenThreads (missing: OPENTHREADS_LIBRARY OPENTHREADS_INCLUDE_DIR) CMake Error at /usr/local/share/cmake-2.8/Modules/FindOpenSceneGraph.cmake:226 (message): ERROR: Missing the following osg libraries: osgDB osgFX osgUtil osgSim osgTerrain osgViewer osgGA osgText osg OpenThreads. Consider using CMAKE_PREFIX_PATH or the OSG_DIR environment variable. See the /usr/local/share/cmake-2.8/Modules/FindOpenSceneGraph.cmake for more details. Call Stack (most recent call first): CMakeLists.txt:174 (FIND_PACKAGE) -- Configuring incomplete, errors occurred! My main question is what can I do to solve this kind of error. I looked at the CMake lists but that does not seem to be the problem. Additional info: Although osg had built without any problems, I'm not able to render anything with the viewer. Code: [root@static-104 osg]# export PATH={$PATH}:/home/nav/osg/osg/bin [root@static-104 osg]# export OSG_FILE_PATH=/home/nav/osg/osgdata [root@static-104 osg]# osgviewer cow.osg Warning: Could not find plugin to read objects from file cow.osg. osgviewer: No data loaded Did I miss something? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49915#49915 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] Building Virtual Planet Builder in Linux
Hi Nav, sounds like the libraries are not found at the usual places, both for the plugins (that is why the cow is not loading) and for the configuration of VPB. Did you do the sudo make install? Also sometimes I had to do ldconfig when I installed new libraries for the first time. I am not too familiar with linux, these are just ideas until the experts join :) Thank you! Cheers, Tassilo -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49917#49917 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] Building Virtual Planet Builder in Linux
Hi Nav, 2012/9/11 Nav Joseph nk...@tatapowersed.com I saw that installing OSG on Linux would be easy, so gave it a shot on RHEL6.x. OSG built without any problems, and I set the paths mentioned in this page (http://www.openscenegraph.org/projects/osg/wiki/Support/GettingStarted). But when I created a git clone of virtualplanetbuilder and typed the ./configure of VPB, it gave me this error: Code: [root@static-104 vpb]# ./configure -- Could NOT find osgDB (missing: OSGDB_LIBRARY OSGDB_INCLUDE_DIR) -- Could NOT find osgFX (missing: OSGFX_LIBRARY OSGFX_INCLUDE_DIR) -- Could NOT find osgUtil (missing: OSGUTIL_LIBRARY OSGUTIL_INCLUDE_DIR) -- Could NOT find osgSim (missing: OSGSIM_LIBRARY OSGSIM_INCLUDE_DIR) -- Could NOT find osgTerrain (missing: OSGTERRAIN_LIBRARY OSGTERRAIN_INCLUDE_DIR) -- Could NOT find osgViewer (missing: OSGVIEWER_LIBRARY OSGVIEWER_INCLUDE_DIR) -- Could NOT find osgGA (missing: OSGGA_LIBRARY OSGGA_INCLUDE_DIR) -- Could NOT find osgText (missing: OSGTEXT_LIBRARY OSGTEXT_INCLUDE_DIR) -- Could NOT find osg (missing: OSG_LIBRARY OSG_INCLUDE_DIR) -- Could NOT find OpenThreads (missing: OPENTHREADS_LIBRARY OPENTHREADS_INCLUDE_DIR) CMake Error at /usr/local/share/cmake-2.8/Modules/FindOpenSceneGraph.cmake:226 (message): ERROR: Missing the following osg libraries: osgDB osgFX osgUtil osgSim osgTerrain osgViewer osgGA osgText osg OpenThreads. Consider using CMAKE_PREFIX_PATH or the OSG_DIR environment variable. See the /usr/local/share/cmake-2.8/Modules/FindOpenSceneGraph.cmake for more details. Call Stack (most recent call first): CMakeLists.txt:174 (FIND_PACKAGE) -- Configuring incomplete, errors occurred! Use the environment variable OSG_DIR before configuring (export OSG_DIR=/path_to_osg_install_dir/). If you have compiled and installed osg without problems you should have the subfolders include/ lib/ share/ bin/ in your installation folder. My main question is what can I do to solve this kind of error. I looked at the CMake lists but that does not seem to be the problem. Additional info: Although osg had built without any problems, I'm not able to render anything with the viewer. Code: [root@static-104 osg]# export PATH={$PATH}:/home/nav/osg/osg/bin [root@static-104 osg]# export OSG_FILE_PATH=/home/nav/osg/osgdata [root@static-104 osg]# osgviewer cow.osg Warning: Could not find plugin to read objects from file cow.osg. osgviewer: No data loaded In linux you must export LD_LIBRARY_PATH to the osg/lib/ dir to make visible this dynamic libraries to the osgviewer application. Search the archives for similar topics (Could not find plugin to read objetcs ). Cheers. Did I miss something? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49915#49915 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] Building Virtual Planet Builder in Linux
2012/9/11 Jordi Torres jtorresfa...@gmail.com Hi Nav, 2012/9/11 Nav Joseph nk...@tatapowersed.com I saw that installing OSG on Linux would be easy, so gave it a shot on RHEL6.x. OSG built without any problems, and I set the paths mentioned in this page ( http://www.openscenegraph.org/projects/osg/wiki/Support/GettingStarted). But when I created a git clone of virtualplanetbuilder and typed the ./configure of VPB, it gave me this error: Code: [root@static-104 vpb]# ./configure -- Could NOT find osgDB (missing: OSGDB_LIBRARY OSGDB_INCLUDE_DIR) -- Could NOT find osgFX (missing: OSGFX_LIBRARY OSGFX_INCLUDE_DIR) -- Could NOT find osgUtil (missing: OSGUTIL_LIBRARY OSGUTIL_INCLUDE_DIR) -- Could NOT find osgSim (missing: OSGSIM_LIBRARY OSGSIM_INCLUDE_DIR) -- Could NOT find osgTerrain (missing: OSGTERRAIN_LIBRARY OSGTERRAIN_INCLUDE_DIR) -- Could NOT find osgViewer (missing: OSGVIEWER_LIBRARY OSGVIEWER_INCLUDE_DIR) -- Could NOT find osgGA (missing: OSGGA_LIBRARY OSGGA_INCLUDE_DIR) -- Could NOT find osgText (missing: OSGTEXT_LIBRARY OSGTEXT_INCLUDE_DIR) -- Could NOT find osg (missing: OSG_LIBRARY OSG_INCLUDE_DIR) -- Could NOT find OpenThreads (missing: OPENTHREADS_LIBRARY OPENTHREADS_INCLUDE_DIR) CMake Error at /usr/local/share/cmake-2.8/Modules/FindOpenSceneGraph.cmake:226 (message): ERROR: Missing the following osg libraries: osgDB osgFX osgUtil osgSim osgTerrain osgViewer osgGA osgText osg OpenThreads. Consider using CMAKE_PREFIX_PATH or the OSG_DIR environment variable. See the /usr/local/share/cmake-2.8/Modules/FindOpenSceneGraph.cmake for more details. Call Stack (most recent call first): CMakeLists.txt:174 (FIND_PACKAGE) -- Configuring incomplete, errors occurred! Use the environment variable OSG_DIR before configuring (export OSG_DIR=/path_to_osg_install_dir/). If you have compiled and installed osg without problems you should have the subfolders include/ lib/ share/ bin/ in your installation folder. My main question is what can I do to solve this kind of error. I looked at the CMake lists but that does not seem to be the problem. Additional info: Although osg had built without any problems, I'm not able to render anything with the viewer. Code: [root@static-104 osg]# export PATH={$PATH}:/home/nav/osg/osg/bin [root@static-104 osg]# export OSG_FILE_PATH=/home/nav/osg/osgdata [root@static-104 osg]# osgviewer cow.osg Warning: Could not find plugin to read objects from file cow.osg. osgviewer: No data loaded In linux you must export LD_LIBRARY_PATH to the osg/lib/ dir to make visible this dynamic libraries to the osgviewer application. Search the archives for similar topics (Could not find plugin to read objetcs ). Missed to say this is in case you are installing OSG in a custom directory. Cheers. Did I miss something? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49915#49915 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] Building Virtual Planet Builder in Linux
Thanks Jordi; I have 'lib', 'bin' and 'include' in my osg folder, but no 'share' directory. Viewer is working now! :-) I had to type Code: ./osgviewer cow.osg I was getting an error of a cannot open display and the viewer not being able to create a window, but that was because I was the root user. Running viewer as an ordinary user made it work. Framerate is surprisingly low, at just 6.1fps. VPB found all the plugins it was earlier unable to find (except gdal, which I'll be installing now). Thanks so much! :-) -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49920#49920 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] Building Virtual Planet Builder in Linux
2012/9/11 Nav Joseph nk...@tatapowersed.com Thanks Jordi; I have 'lib', 'bin' and 'include' in my osg folder, but no 'share' directory. Yes, the 'share' directory appears when you compile and install the osg examples. Viewer is working now! :-) I had to type Code: ./osgviewer cow.osg I was getting an error of a cannot open display and the viewer not being able to create a window, but that was because I was the root user. Running viewer as an ordinary user made it work. Framerate is surprisingly low, at just 6.1fps. Maybe you didn't install your graphic card drivers OK. Check if you have direct rendering and your drivers are ok with the command glxinfo. VPB found all the plugins it was earlier unable to find (except gdal, which I'll be installing now). Thanks so much! :-) You might need to recompile osg with Gdal library. Cheers. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49920#49920 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Understanding draggers - and a possible bug in OSG 3.1 dev branch?
in the osgmanipulator.cpp sample (using OpenSceneGraph 3.1.2 dev release): Why is the gray cylinder not moving with the TabPlaneDragger ? I can only move the dragger frame around, but the object linked to it does not respond. Is that a bug or a feature? Are composite draggers broken? How would I use the object's own geometry of the object as the clickable hot spot? I don't really want to see arrows or handles in the Translate2DDragger, but instead I would like to click on the object itself and move it around on the plane. Christian ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG + QT and QTabWidget: Disappearing scene graph
Thanks a lot, with your tip it works ! Alistair Baxter wrote: -Original Message- From: [mailto:] On Behalf Of Lucas SART Sent: 07 September 2012 11:08 To: Subject: Re: OSG + QT and QTabWidget: Disappearing scene graph Hi, I had looking for why it doesn't work. It seems that the first tab camera projection matrix and view matrix are not valid (components = -1.#IND) and I don't know why. I tryed to look into OSG code but I don't found what is wrong... If someone have an idea it would be great ! Oddly, I think I just encountered this problem yesterday. If the QT widget ever gets resized to zero (as can happen sometimes during setup and intermediate layout stages), and osgQt::GLWidget::resizeEvent is called with width and height equal to zero, the camera projection matrix gets screwed up due to divide-by-zeroes, and never recovers because resizing always takes into account the existing camera matrix. I solved the problem by preventing osgQt::GLWidget::resizeEvent being called by my GLWidget subclass if either dimension was zero. But I suppose it would probably be better if a fix was made inside the osgQt library. ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49923#49923 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Understanding draggers - and a possible bug in OSG 3.1 dev branch?
Hi all, a quick followup. The TabPlaneDragger seems to work fine in OSG 3.0.1, so it appears the problem is limited to the current development branch. Christian ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph Newbie: PErformance question
Ah, seems you're right.. I just tweaked it to load an oBJ I've been using for testing (company logo graphic) and now I'm up at 200fps in each of my 2 viewers, much better. Can I get a quick run-down on what exactly kicks it off the "fast path"? Or is this documented on the Wiki somewhere? Chris Hanson September 10, 2012 11:26 PM Yes. Virtually everything about that geometry will kick you off the fast path. Unless your ultimate application purpose involves rendering teapots, you need to try using a better example model. cow.osg or cessna.osg I think are better samples. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___osg-users mailing listosg-users@lists.openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org Randall Hand September 10, 2012 11:04 PM hrm.. Well, I'm using the osgteapot example code ( http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph/trunk/examples/osgteapot/osgteapot.cpp ), that i modified to use basic front/back emissive materials instead of textures. --Randall Handhttp://www.vizworld.com Chris Hanson September 10, 2012 10:32 PM It's better, but still slower than I'ld expect. Hovers now around 100-110fps. Something in the back of my mind makes me think the Teapot is using a really poor geometry representation that forces OSG onto old, slow OpenGL code paths. I didn't actually see the vertices or polygons in the OSG file above, so I can't say for sure. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___osg-users mailing listosg-users@lists.openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org Randall Hand September 10, 2012 10:29 PM It's better, but still slower than I'ld expect. Hovers now around 100-110fps.--Randall Handhttp://www.vizworld.com Chris Hanson September 10, 2012 10:10 PM On Mon, Sep 10, 2012 at 8:35 PM, Randall Hand randall.h...@gmail.com wrote: I'm experimenting with OpenScenegraph for a new project, and I've build a simple application that opens 2 viewer windows, and places 3 teapots in them (using the teapot object from the osgteapot example), translating them into different positions. My resulting scene graph (saved as an osg) looks like this: Pretty basic.. However, I'm only getting about 60-70fps (in each of my 2 viewers). I've already set the vsync=false in my Stateset for the viewer (if I run with _nothing_ in my Scene Graph I get over 1000fps). Is this typical performance? I really expected to still be getting 100+fps easy with such trivial geometry. I didn't really dissect your graph structure, but it would seem like it could perform better. How does it perform with only one window, especially one window with two teapots in it? It could be that some adverse effect of how you have set up your two windows is hurting your performance. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Randall Hand http://www.yeraze.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Understanding draggers - and a possible bug in OSG 3.1 dev branch?
Hi Christian, On 11 September 2012 12:35, Christian Buchner christian.buch...@gmail.com wrote: in the osgmanipulator.cpp sample (using OpenSceneGraph 3.1.2 dev release): Why is the gray cylinder not moving with the TabPlaneDragger ? I can only move the dragger frame around, but the object linked to it does not respond. Is that a bug or a feature? Are composite draggers broken? Curious... I've just tested osgmanipulator --dragger TabPlaneDragger cow.osg And it works fine, but when I just try osgmanipualtor and move the TabPlaneDragger it doesn't drag the grey cylinder. This will be a bug, but I don't have any idea why the dragger works in once way but not the other. How would I use the object's own geometry of the object as the clickable hot spot? I don't really want to see arrows or handles in the Translate2DDragger, but instead I would like to click on the object itself and move it around on the plane. I don't recall seeing any support for this in osgManipulator, feel free to do a code review and see if you can enable yourself. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph Newbie: PErformance question
Hi you can take a look at Geometry::computeFastPathsUsed() source and check yourself. As a general rule you are going to be slow, if your geometry uses separate indices in osg::Geometry for vertex attribs (not those in DrawElements*** primitive sets, but those set with osg::Geometry::set***Indices() ) or if binding for any vertex attribute is set to BIND_PER_PRIMITIVE.Not "fast path" is basically glBegin glEnd style stuff, so it supposed to be slow for high-poly geometries.Cheers.11.09.2012, 17:23, "Randall Hand" randall.h...@gmail.com:Ah, seems you're right.. I just tweaked it to load an oBJ I've been using for testing (company logo graphic) and now I'm up at 200fps in each of my 2 viewers, much better. Can I get a quick run-down on what exactly kicks it off the "fast path"? Or is this documented on the Wiki somewhere? Chris HansonSeptember 10, 2012 11:26 PM Yes. Virtually everything about that geometry will kick you off the fast path. Unless your ultimate application purpose involves rendering teapots, you need to try using a better example model. cow.osg or cessna.osg I think are better samples.-- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/Training • Consulting • Contracting3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCLDigital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android___osg-users mailing listosg-users@lists.openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org Randall HandSeptember 10, 2012 11:04 PMhrm.. Well, I'm using the osgteapot example code ( http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph/trunk/examples/osgteapot/osgteapot.cpp), that i modified to use basic front/back emissive materials instead of textures.--Randall Handhttp://www.vizworld.com Chris HansonSeptember 10, 2012 10:32 PMIt's better, but still slower than I'ld expect. Hovers now around 100-110fps. Something in the back of my mind makes me think the Teapot is using a really poor geometry representation that forces OSG onto old, slow OpenGL code paths. I didn't actually see the vertices or polygons in the OSG file above, so I can't say for sure. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/Training • Consulting • Contracting3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCLDigital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android___osg-users mailing listosg-users@lists.openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org Randall HandSeptember 10, 2012 10:29 PMIt's better, but still slower than I'ld expect. Hovers now around 100-110fps.--Randall Handhttp://www.vizworld.com Chris HansonSeptember 10, 2012 10:10 PMOn Mon, Sep 10, 2012 at 8:35 PM, Randall Hand randall.h...@gmail.com wrote:I'm experimenting with OpenScenegraph for a new project, and I've build a simple application that opens 2 viewer windows, and places 3 teapots in them (using the teapot object from the osgteapot example), translating them into different positions. My resulting scene graph (saved as an osg) looks like this: Pretty basic.. However, I'm only getting about 60-70fps (in each of my 2 viewers). I've already set the vsync=false in my Stateset for the viewer (if I run with _nothing_ in my Scene Graph I get over 1000fps). Is this typical performance? I really expected to still be getting 100+fps easy with such trivial geometry. I didn't really dissect your graph structure, but it would seem like it could perform better. How does it perform with only one window, especially one window with two teapots in it? It could be that some adverse effect of how you have set up your two windows is hurting your performance. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/Training • Consulting • Contracting3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCLDigital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Randall Hand http://www.yeraze.com ,___osg-users mailing listosg-users@lists.openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org___ osg-users mailing list osg-users@lists.openscenegraph.org
Re: [osg-users] Ideas about a resource system, and deferred rendering framework
On Tue, 2012-09-11 at 10:54 +0800, Wang Rui wrote: Hi Jeremy, Thanks for the tests and feedback. I'm focusing on creating a material system which may be a little similar to the Ogre one but will be very easy to integrate with OSG scenes. I'd like to also have a benchmark including a complete deferred shading pipeline in the near future to show others how OSG produces realistic worlds. :-) Your requirement could be easiliy implemented with one forward pass rendering the scene to a texture, and two deferred passes doing the blur work with the texture as input. A final compositing pass will make use of the outputs of the blur passes and output to a new texture. You can get and use the new texture then in the scene for your own purpose instead of direct displaying them on screen. I'd like to upload a DOF effect file and an updated example some days later to demonstrate how these work. Are there ever cases, when doing sophisticated layering of rendering like this, that you'd want to manually kick off the EffectCompositor for just a single frame and update the texture only once? (For example, by setting the NodeMask to 0xF for one frame, then back to 0x0 when you're done updating the View). Is there a term for this kind of approach, and would it make sense to also support this model of rendering directly or should it be left up to the user? Thanks, Wang Rui 2012/9/11 Jeremy Moles cubic...@gmail.com: On Mon, 2012-09-10 at 22:57 +0800, Wang Rui wrote: This looks really cool so far. I'd be really interested to know if it supports the following (and would be willing to create examples if you're willing to help)... Scenario: I want to render an entire subgraph to an FBO texture once, then apply 2 or more completely different shaders in some order, then put the final result into a last texture to be used somewhere in the scene. I'm doing a guassian blur, which typically applies two different shaders for x and y. I have this working in osgPPU, but I think you already have enough to do it here, I just couldn't put the pieces together. :) ___ 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] Understanding draggers - and a possible bug in OSG 3.1 dev branch?
Here's my shot at using a subclassed Translate2DDragger to move actual objects on a plane (without displaying any handles). They key is to make the movable object a child of the dragger, and to disallow the dragger to override the color of that child. See attachment. Christian /* OpenSceneGraph example, osgmanipulator. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the Software), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include osgViewer/Viewer #include osgManipulator/Translate2DDragger #include osg/ShapeDrawable #include osg/MatrixTransform #include osg/Geometry #include osg/Material #include osgGA/TrackballManipulator /** * Dragger for performing 2D translation using the dragged object's own geometry. * For this to work, make the object a child of the dragger. */ class My2DDragger : public osgManipulator::Translate2DDragger { public: My2DDragger(); My2DDragger(osg::Node *node); My2DDragger(osg::Node *node, const osg::Plane plane); META_OSGMANIPULATOR_Object(osgManipulator,My2DDragger) void setupDefaultGeometry(); protected: virtual ~My2DDragger(); }; My2DDragger::My2DDragger() : osgManipulator::Translate2DDragger() { setHandleEvents(true); } My2DDragger::My2DDragger(osg::Node *node) : osgManipulator::Translate2DDragger() { addChild(node); setHandleEvents(true); } My2DDragger::My2DDragger(osg::Node *node, const osg::Plane plane) : osgManipulator::Translate2DDragger(plane) { addChild(node); setHandleEvents(true); } My2DDragger::~My2DDragger() { } void My2DDragger::setupDefaultGeometry() {} /** * create a scene with a mouse-movable cylinder object */ osg::Node* createDemoScene() { osg::Group* root = new osg::Group; osg::ref_ptrosg::Geode geode_cylinder = new osg::Geode; const float radius = 0.8f; const float height = 1.0f; osg::ref_ptrosg::TessellationHints hints = new osg::TessellationHints; hints-setDetailRatio(2.0f); osg::ref_ptrosg::ShapeDrawable shape; shape = new osg::ShapeDrawable(new osg::Cylinder(osg::Vec3(0.0f, 0.0f, 0.0f), radius, height), hints.get()); shape-setColor(osg::Vec4(1.0f, 0.3f, 0.3f, 1.0f)); geode_cylinder-addDrawable(shape.get()); // cylinder's material osg::ref_ptrosg::Material material = new osg::Material; material-setColorMode(osg::Material::DIFFUSE); material-setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4(0, 0, 0, 1)); material-setSpecular(osg::Material::FRONT_AND_BACK, osg::Vec4(1, 1, 1, 1)); material-setShininess(osg::Material::FRONT_AND_BACK, 64.0f); // don't let the dragger object change our material settings root-getOrCreateStateSet()-setAttributeAndModes(material.get(), osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE); root-addChild(new My2DDragger( geode_cylinder.get(), osg::Plane(osg::Z_AXIS, 0.0f))); return root; } int main( int argc, char **argv ) { // construct the viewer. osgViewer::Viewer viewer; osg::ref_ptrosg::Node loadedModel = createDemoScene(); viewer.setSceneData(loadedModel.get()); viewer.setCameraManipulator(new osgGA::TrackballManipulator); viewer.realize(); osgGA::CameraManipulator *cam = viewer.getCameraManipulator(); cam-setHomePosition(osg::Vec3f(0.0f, -10.0f, 5.0f), osg::Vec3f(0.0f, 0.0f, 0.0f), osg::Z_AXIS); cam-home(0); return viewer.run(); } ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Opengl 3
Hello. In the example you mention the is this text: Add the path to GL3/gl3.h to the CMake compiler flags, CMAKE_CXX_FLAGS and CMAKE_CXX_FLAGS_DEBUG (for release and debug builds; others if you use other build configurations). The text to add should look something like this: /I “C:\GLHeader” The folder GLHeader should contain a subfolder GL3, which in turn contains gl3.h. But Cmake doesnt create any entries with these names (CMAKE_CXX_FLAGS, CMAKE_CXX_FLAGS_DEBUG). Do i have to create them or is it ok if i add the opengl path in the parameter CMAKE_INCLUDE_PATH ? thank you. On 11 September 2012 04:58, Paul Martz pma...@skew-matrix.com wrote: On 9/10/2012 10:34 AM, Peterakos wrote: Hello. I face a problem trying to compile open scene graph using open gl 3. I get errors like these: error C3861: 'glLoadMatrixf': identifier not found error C3861: 'glMultMatrixf': identifier not found error C3861: 'glLoadMatrixd': identifier not found error C3861: 'glMultMatrixd': identifier not found Hm. Both v3.0.1 and also svn trunk r13140 seem to build fine for me, so I'm not sure why you'd encounter these errors. In CMake i have disabled everything that have the prefix OSG_GL except OSG_GL3_AVAILABLE. I build for GL3 using the instructions found in the osgsimplegl3.cpp example source code comment block. I also want to ask if i will be able to run the osg examples if i fully convert open scene graph in opengl 3. I doubt that any example other than osgsimplegl3 would work. -Paul __**_ osg-users mailing list osg-users@lists.**openscenegraph.org osg-users@lists.openscenegraph.org http://lists.openscenegraph.**org/listinfo.cgi/osg-users-** openscenegraph.orghttp://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] Check if a Drawable was culled or not
Hi, I have a scene containing several mirrors but I would only like to enable RTT camera if the node representing a mirror is visible. I am trying to check if the specific Drawable was culled or not but so far I was not getting the results I wanted. Before getting into details on how I am trying to do it, I wonder if someone can suggest me a simple way to do such check? Thank you very much! :) Cheers, Janna -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49931#49931 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph Newbie: PErformance question
On 09/11/2012 09:41 AM, Sergey Polischuk wrote: Hi you can take a look at Geometry::computeFastPathsUsed() source and check yourself. As a general rule you are going to be slow, if your geometry uses separate indices in osg::Geometry for vertex attribs (not those in DrawElements*** primitive sets, but those set with osg::Geometry::set***Indices() ) or if binding for any vertex attribute is set to BIND_PER_PRIMITIVE. Not fast path is basically glBegin glEnd style stuff, so it supposed to be slow for high-poly geometries. In this case, the teapot example is using calls to glMap* and glEval*, which takes spline curve data and converts it into vertices, normals, and texture coordinates (on the CPU side), before passing the mesh data on to the rest of the pipeline (using glBegin/glEnd-style calls). I'd guess that this is about as slow path as you can get :-) --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] NodeTrackerManipulator
Hi Robert, if I understand correctly NodeTrackerManipulator::performMovementMiddleMouseButton method is basically not implemented so computeNodeCenterAndRotation call could be avoided. The same for NodeTrackerManipulator::performMovementRightMouseButton since the actual implementation of computeNodeCenterAndRotation does not change local members. Regards, Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49934#49934 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] NodeTrackerManipulator
In addition NodeTrackerManipulator::performMovementLeftMouseButton calls computeNodeCenterAndRotation() but maybe it is useless also in this case. Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49935#49935 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph Newbie: PErformance question
Are you on Windows or Linux? If Windows, are you running with debug OSG libs? If so, release OSG libs are much faster. Just a thought... -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Randall Hand Sent: Monday, September 10, 2012 8:35 PM To: osg-users@lists.openscenegraph.org Subject: [osg-users] OpenSceneGraph Newbie: PErformance question I'm experimenting with OpenScenegraph for a new project, and I've build a simple application that opens 2 viewer windows, and places 3 teapots in them (using the teapot object from the osgteapot example), translating them into different positions. My resulting scene graph (saved as an osg) looks like this: Group { UniqueID Group_0 nodeMask 0x cullingActive TRUE num_children 3 Group { UniqueID Group_1 nodeMask 0x cullingActive TRUE StateSet { UniqueID StateSet_2 DataVariance STATIC rendering_hint DEFAULT_BIN renderBinMode USE binNumber 50 binName RenderBin } num_children 1 MatrixTransform { nodeMask 0x cullingActive TRUE referenceFrame RELATIVE Matrix { 1 0 0 0 0 1 0 0 0 0 1 0 0 -50 0 1 } num_children 1 Geode { UniqueID Geode_3 nodeMask 0x cullingActive TRUE StateSet { UniqueID StateSet_4 DataVariance STATIC rendering_hint DEFAULT_BIN renderBinMode INHERIT Material { ColorMode OFF ambientColor 0.2 0.2 0.2 1 diffuseColor 0.8 0.8 0.8 1 specularColor 0 0 0 1 emissionColor FRONT 0 1 0 1 emissionColor BACK 1 0 0 1 shininess 0 } LightModel { ambientIntensity 0.2 0.2 0.2 1 colorControl SINGLE_COLOR localViewer FALSE twoSided TRUE } } num_drawables 1 } } } Group { UniqueID Group_5 nodeMask 0x cullingActive TRUE Use StateSet_2 num_children 1 MatrixTransform { nodeMask 0x cullingActive TRUE referenceFrame RELATIVE Matrix { 1 0 0 0 0 1 0 0 0 0 1 0 -10 -50 0 1 } num_children 1 Use Geode_3 } } Group { UniqueID Group_6 nodeMask 0x cullingActive TRUE Use StateSet_2 num_children 1 MatrixTransform { nodeMask 0x cullingActive TRUE referenceFrame RELATIVE Matrix { 1 0 0 0 0 1 0 0 0 0 1 0 10 -50 0 1 } num_children 1 Use Geode_3 } } } Pretty basic.. However, I'm only getting about 60-70fps (in each of my 2 viewers). I've already set the vsync=false in my Stateset for the viewer (if I run with _nothing_ in my Scene Graph I get over 1000fps). Is this typical performance? I really expected to still be getting 100+fps easy with such trivial geometry. -- Randall Hand http://www.yeraze.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] LineSegmentIntersector question...
All, I have a couple of questions regarding LineSegmentIntersector. I noticed that for a given line segment, it currently computes and returns ALL intersections with a given geometry in the scene. My questions are: 1) Does it support a feature of detecting a hit and then returning without the need to compute all the intersections? This would be sort of like a visibility test. 2) Does it have the ability to find the closest intersection without the need to compute all the intersections? In other words, does it step along from the starting point of the line segment until an intersection is found and then bail out? 3) If it doesn't support these features, is it possible to modify the LineSegmentIntersector to support these? I would think that having this capability would improve performance where applicable. Thanks for any input in advance... -Shayne ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LineSegmentIntersector question...
Hi Shayne, The base osgUtil::Intersector class supports setting the limits on intersection results, using the setIntersectionLimit() method. The current options are NO_LIMIT, LIMIT_ONE_PER_DRAWABLE, LIMIT_ONE, LIMIT_NEAREST. On Tue, Sep 11, 2012 at 9:47 AM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC shayne.tuel...@hill.af.mil wrote: **1) **Does it support a feature of detecting a “hit” and then returning without the need to compute all the intersections? This would be sort of like a visibility test. Set the intersection limit to LIMIT_ONE **2) **Does it have the ability to find the closest intersection without the need to compute all the intersections? In other words, does it step along from the starting point of the line segment until an intersection is found and then bail out? Set the intersection limit to LIMIT_NEAREST. This mode could be optimized more, but it will currently reject a subgraph if the nearest point of the bounding sphere is further than the nearest hit. So it can still provide significant savings in computation time. Cheers, Farshid **3) **If it doesn’t support these features, is it possible to modify the LineSegmentIntersector to support these? ** ** I would think that having this capability would improve performance where applicable. ** ** Thanks for any input in advance… ** ** -Shayne ** ** ** ** ___ 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] Real3D on LG Optimus with OpenSceneGraph 3.0.0
Thanks Robert and Rafa, Looks I had set the display settings on the viewer correctly but I was not actually rendering with the main camera in the scene graph, I only had an ortho2d camera rendering a HUD underneath the root node. Once I had placed some geometry underneath the root node to be rendered by the perspective camera, the stereoscopic display worked properly. When I set the display settings for the ortho2d camera to do stereo, it still did not work. Is that because ortho cameras do not support stereo? thinking about it hurts my head a bit, since ortho does not have a focal point... I ended up creating another camera for the HUD that simply renders everything into the other half of the viewport. Thanks -Oren Ps. Thanks Rafa for referring me to your interesting project, I will definitely check out! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49938#49938 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LineSegmentIntersector question...
Farshid, Thanks much for the input and addressing my questions. That is good news that the support is there. I'm assuming the default is NO_LIMIT. Is this true? Thanks, -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Farshid Lashkari Sent: Tuesday, September 11, 2012 11:08 AM To: OpenSceneGraph Users Subject: Re: [osg-users] LineSegmentIntersector question... Hi Shayne, The base osgUtil::Intersector class supports setting the limits on intersection results, using the setIntersectionLimit() method. The current options are NO_LIMIT, LIMIT_ONE_PER_DRAWABLE, LIMIT_ONE, LIMIT_NEAREST. On Tue, Sep 11, 2012 at 9:47 AM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC shayne.tuel...@hill.af.mil wrote: 1) Does it support a feature of detecting a hit and then returning without the need to compute all the intersections? This would be sort of like a visibility test. Set the intersection limit to LIMIT_ONE 2) Does it have the ability to find the closest intersection without the need to compute all the intersections? In other words, does it step along from the starting point of the line segment until an intersection is found and then bail out? Set the intersection limit to LIMIT_NEAREST. This mode could be optimized more, but it will currently reject a subgraph if the nearest point of the bounding sphere is further than the nearest hit. So it can still provide significant savings in computation time. Cheers, Farshid 3) If it doesn't support these features, is it possible to modify the LineSegmentIntersector to support these? I would think that having this capability would improve performance where applicable. Thanks for any input in advance... -Shayne ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LineSegmentIntersector question...
Just a follow on question to my previous email... Is this functionality of setting limits on intersection results only found in later versions of OSG? I'm currently using OSG 2.9.11 and I can't find any support for this. I guess this would explain why I asked the questions in the first place. If true, I need to upgrade to a later version like 3.0.1... -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Tueller,Shayne R Civ USAF AFMC 519 SMXS/MXDEC Sent: Tuesday, September 11, 2012 11:13 AM To: OpenSceneGraph Users Subject: Re: [osg-users] LineSegmentIntersector question... Farshid, Thanks much for the input and addressing my questions. That is good news that the support is there. I'm assuming the default is NO_LIMIT. Is this true? Thanks, -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Farshid Lashkari Sent: Tuesday, September 11, 2012 11:08 AM To: OpenSceneGraph Users Subject: Re: [osg-users] LineSegmentIntersector question... Hi Shayne, The base osgUtil::Intersector class supports setting the limits on intersection results, using the setIntersectionLimit() method. The current options are NO_LIMIT, LIMIT_ONE_PER_DRAWABLE, LIMIT_ONE, LIMIT_NEAREST. On Tue, Sep 11, 2012 at 9:47 AM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC shayne.tuel...@hill.af.mil wrote: 1) Does it support a feature of detecting a hit and then returning without the need to compute all the intersections? This would be sort of like a visibility test. Set the intersection limit to LIMIT_ONE 2) Does it have the ability to find the closest intersection without the need to compute all the intersections? In other words, does it step along from the starting point of the line segment until an intersection is found and then bail out? Set the intersection limit to LIMIT_NEAREST. This mode could be optimized more, but it will currently reject a subgraph if the nearest point of the bounding sphere is further than the nearest hit. So it can still provide significant savings in computation time. Cheers, Farshid 3) If it doesn't support these features, is it possible to modify the LineSegmentIntersector to support these? I would think that having this capability would improve performance where applicable. Thanks for any input in advance... -Shayne ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LineSegmentIntersector question...
Hi Shayne, Yes, the default is NO_LIMIT. I'm using it in version 2.9.12, but I think I might have backported it from a newer version. Sounds like you'll need to do an upgrade to get this feature. Cheers, Farshid On Tue, Sep 11, 2012 at 10:25 AM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC shayne.tuel...@hill.af.mil wrote: Just a follow on question to my previous email... Is this functionality of setting limits on intersection results only found in later versions of OSG? I'm currently using OSG 2.9.11 and I can't find any support for this. I guess this would explain why I asked the questions in the first place. If true, I need to upgrade to a later version like 3.0.1... -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Tueller,Shayne R Civ USAF AFMC 519 SMXS/MXDEC Sent: Tuesday, September 11, 2012 11:13 AM To: OpenSceneGraph Users Subject: Re: [osg-users] LineSegmentIntersector question... Farshid, Thanks much for the input and addressing my questions. That is good news that the support is there. I'm assuming the default is NO_LIMIT. Is this true? Thanks, -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Farshid Lashkari Sent: Tuesday, September 11, 2012 11:08 AM To: OpenSceneGraph Users Subject: Re: [osg-users] LineSegmentIntersector question... Hi Shayne, The base osgUtil::Intersector class supports setting the limits on intersection results, using the setIntersectionLimit() method. The current options are NO_LIMIT, LIMIT_ONE_PER_DRAWABLE, LIMIT_ONE, LIMIT_NEAREST. On Tue, Sep 11, 2012 at 9:47 AM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC shayne.tuel...@hill.af.mil wrote: 1) Does it support a feature of detecting a hit and then returning without the need to compute all the intersections? This would be sort of like a visibility test. Set the intersection limit to LIMIT_ONE 2) Does it have the ability to find the closest intersection without the need to compute all the intersections? In other words, does it step along from the starting point of the line segment until an intersection is found and then bail out? Set the intersection limit to LIMIT_NEAREST. This mode could be optimized more, but it will currently reject a subgraph if the nearest point of the bounding sphere is further than the nearest hit. So it can still provide significant savings in computation time. Cheers, Farshid 3) If it doesn't support these features, is it possible to modify the LineSegmentIntersector to support these? I would think that having this capability would improve performance where applicable. Thanks for any input in advance... -Shayne ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ 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] LineSegmentIntersector question...
Farshid, Thank you for your help...:) -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Farshid Lashkari Sent: Tuesday, September 11, 2012 11:28 AM To: OpenSceneGraph Users Subject: Re: [osg-users] LineSegmentIntersector question... Hi Shayne, Yes, the default is NO_LIMIT. I'm using it in version 2.9.12, but I think I might have backported it from a newer version. Sounds like you'll need to do an upgrade to get this feature. Cheers, Farshid On Tue, Sep 11, 2012 at 10:25 AM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC shayne.tuel...@hill.af.mil wrote: Just a follow on question to my previous email... Is this functionality of setting limits on intersection results only found in later versions of OSG? I'm currently using OSG 2.9.11 and I can't find any support for this. I guess this would explain why I asked the questions in the first place. If true, I need to upgrade to a later version like 3.0.1... -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Tueller,Shayne R Civ USAF AFMC 519 SMXS/MXDEC Sent: Tuesday, September 11, 2012 11:13 AM To: OpenSceneGraph Users Subject: Re: [osg-users] LineSegmentIntersector question... Farshid, Thanks much for the input and addressing my questions. That is good news that the support is there. I'm assuming the default is NO_LIMIT. Is this true? Thanks, -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Farshid Lashkari Sent: Tuesday, September 11, 2012 11:08 AM To: OpenSceneGraph Users Subject: Re: [osg-users] LineSegmentIntersector question... Hi Shayne, The base osgUtil::Intersector class supports setting the limits on intersection results, using the setIntersectionLimit() method. The current options are NO_LIMIT, LIMIT_ONE_PER_DRAWABLE, LIMIT_ONE, LIMIT_NEAREST. On Tue, Sep 11, 2012 at 9:47 AM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC shayne.tuel...@hill.af.mil wrote: 1) Does it support a feature of detecting a hit and then returning without the need to compute all the intersections? This would be sort of like a visibility test. Set the intersection limit to LIMIT_ONE 2) Does it have the ability to find the closest intersection without the need to compute all the intersections? In other words, does it step along from the starting point of the line segment until an intersection is found and then bail out? Set the intersection limit to LIMIT_NEAREST. This mode could be optimized more, but it will currently reject a subgraph if the nearest point of the bounding sphere is further than the nearest hit. So it can still provide significant savings in computation time. Cheers, Farshid 3) If it doesn't support these features, is it possible to modify the LineSegmentIntersector to support these? I would think that having this capability would improve performance where applicable. Thanks for any input in advance... -Shayne ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.o r g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.o r g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org
[osg-users] Using glDrawElements causes crash with osg::Stats
I have a situation that is requiring me to use raw gl commands in the drawImplementation of an osg::Drawable. I have a double buffer that is not updated fully until draw time as opposed to update time and I am not at liberty to change this. Currently in the drawImplementation, I get the current buffer, then perform glVertex and glNormal commands on the list of vertices in the buffer. This works just fine and there are no problems other than it can slow down the scene do to the number of verts. I was attempting to convert this to a glDrawElements call as a quick improvement and saw a noticeable performance increase. Everything is drawing just fine and I haven't found any slow downs or stability issues, with one exception. If I enable osg::Stats, it crashes immediately and I have no idea why. I was hoping someone might have some insight for me. Here is the drawImplementation code: { //get the current active buffer VertBuffer buffer = getCurBuffer(); //set up the client state glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT); //crashes immediately without this glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_NORMAL_ARRAY); //set up arrays glVertexPointer(3, GL_FLOAT, 0, (GLvoid*)pmCoords); glNormalPointer(GL_FLOAT, 0, (GLvoid*)pmNormals); //draw if (buffer.vertexList.size() 0) { glDrawElements(GL_TRIANGLES, buffer.vertexList.size(), GL_UNSIGNED_INT, (buffer.vertexList)[0]); } //disable client state glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_NORMAL_ARRAY); glPopClientAttrib(); } In this, VertBuffer, is just a structure that holds a std::vectorunsigned int of the vertices to draw (vertexList), and some other info that is not used during the draw. pmCoords and pmNormals are lists of all available coordinates and their normals. The vertexList is just a list of indices in these coordinates to draw at this time. As I said, everything works fine if the draw is as follows instead: glBegin(GL_TRIANGLES); for (int ii = 0; ii buffer.vertexList.size(); ii+= 3) { glNormal3fv(pmNormals[buffer.vertexList[ii]]; glVertex3fv(pmCoords[buffer.vertexList[ii]]; glNormal3fv(pmNormals[buffer.vertexList[ii+1]]; glVertex3fv(pmCoords[buffer.vertexList[ii+1]]; glNormal3fv(pmNormals[buffer.vertexList[ii+2]]; glVertex3fv(pmCoords[buffer.vertexList[ii+2]]; } glEnd(); I've tried copying the data locally from the buffer and that did nothing different. I even tried to create a small array locally that contained the same data. If I only drew 1 triangle it was fine, but if I tried to draw more, it would sometimes work and sometimes crash. Karl Cary SAIC Software Developer 301-227-5656 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Check if a Drawable was culled or not
On Tue, 2012-09-11 at 16:52 +0200, Janna Terde wrote: Hi, I have a scene containing several mirrors but I would only like to enable RTT camera if the node representing a mirror is visible. I am trying to check if the specific Drawable was culled or not but so far I was not getting the results I wanted. Before getting into details on how I am trying to do it, I wonder if someone can suggest me a simple way to do such check? If I'm not mistaken, this is already the default behavior. In fact, I was under the impression that the recommended way to even disable RTT in the first place was to simply have it automatically culled via it's NodeMask. What would you be doing differently in order to enable/disable RTT? P. S. This is just what I think. I could be wrong, and hopefully someone will chime in and prevent me spreading misinformation if I am. :) Thank you very much! :) Cheers, Janna -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49931#49931 ___ 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] Check if a Drawable was culled or not
Hi Jeremy, I can cull the RTT camera using its cull mask or node mask however I need to know when should I do it. I would like to cull the camera when the node representing the mirror (Geode) is culled so when it is outside of the viewing frustum. This is what I am trying to do, I've tried to use CullVisitor and isCulled function and also tried to construct the Polytope from main camera but still did not get the correct behavior. :( So I am wondering if there is something I don't know since it seems to be very common thing to do and should be simple to do. Cheers, Janna -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49946#49946 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] strange behavior with NodeMasks and camera CullMasks
Hi, I am trying to setup 2 cameras viewing the same scene but with different cull masks. Some nodes have nodemask 0x1, others 0x2. It only seems to work if I use 0x2 as a cullmask for one of the two cameras, and the other camera doesn't see anything unless i set it's cullmask to 0xf. but I want it to see only the nodes with nodemask 0x1. here is the graph setup: Code: [camera1]-[group]--[scene] . . . . . . . . . . . \-[camera2]/ Camera1 is the main viewer's camera. (a CompositeViewer with only one view, if that matters). It's CullMask is set to 0x1. Camera2 is a RTT camera with CullMask set to 0x2. Both cameras have their inheritanceMask set to( osg::CullSettings::ALL_VARIABLES ~osg::CullSettings::CULL_MASK ) In the scene, there are nodes with NodeMasks set to either 0x1 or 0x2. There is a shader on the main camera that takes the resulting buffers for camera1 and 2 and sends them to the red and green channels respectively... but I don't *think* that has anything to do with the problem. Just to be clear, lets say we have node1 (mask=0x1) and node2 (mask=0x2) a camera with cull mask 0x1 doesn't seen anything (bad!) a camera with cull mask 0x2 sees node2 (good) a camera with cull mask 0xf sees nodes 1 and 2. (also good) what I don't understand, is that I have done something identical in a test program and it works fine, and I really can't see what is different in my current program. are there pitfalls that I should know about? there isn't much information about the subject out there. Cheers, Louis -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49947#49947 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Check if a Drawable was culled or not
On Tue, 2012-09-11 at 20:36 +0200, Janna Terde wrote: Hi Jeremy, I can cull the RTT camera using its cull mask or node mask however I need to know when should I do it. I would like to cull the camera when the node representing the mirror (Geode) is culled so when it is outside of the viewing frustum. This is what I am trying to do, I've tried to use CullVisitor and isCulled function and also tried to construct the Polytope from main camera but still did not get the correct behavior. :( OH RIGHT. Good point, a kind of chicken-and-egg problem. :) Try this, and I'll try it to as soon as I can: create a CullCallback that calls isCullingActive(); if so, set NodeMask to something wonky. Attach the CullCallback to your Geode. (This is just from a cursory look at the API and from experience, I'll try it soon...) So I am wondering if there is something I don't know since it seems to be very common thing to do and should be simple to do. Cheers, Janna -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49946#49946 ___ 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] AntTweakBar with Opengl 3.2
Hello. Has anyone managed to make AntTweakBar work with OpengGL 3.2 and the usage of shaders in the models ? Thnx. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Check if a Drawable was culled or not
Hi Janna, From my understanding there is no built-in and simple way of accomplishing this, but it is possible. I have a similar feature working in my application that does the following: - I attach a custom cull callback to the drawable I am interested in. This cull callback simply records the frame number from the cull visitor. - I then attach another cull callback to the RTT camera node. This cull callback compares the current frame number to the last recorded frame number in the drawable cull callback. If the frame numbers don't match, then the drawable has been culled and the cull callback will disable the RTT node. - An important note about this technique is that it depends on the traversal order of the drawable and RTT node. For this to work, the RTT node must be traversed AFTER the drawable node. So make sure the drawable appears before the RTT node in the scene graph. Hope this is helpful. Cheers, Farshid On Tue, Sep 11, 2012 at 11:36 AM, Janna Terde brja...@gmail.com wrote: Hi Jeremy, I can cull the RTT camera using its cull mask or node mask however I need to know when should I do it. I would like to cull the camera when the node representing the mirror (Geode) is culled so when it is outside of the viewing frustum. This is what I am trying to do, I've tried to use CullVisitor and isCulled function and also tried to construct the Polytope from main camera but still did not get the correct behavior. :( So I am wondering if there is something I don't know since it seems to be very common thing to do and should be simple to do. Cheers, Janna -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49946#49946 ___ 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] Check if a Drawable was culled or not
Hi, I think I got it to work using Polytope like this: Code: osg::Polytope frustum; frustum.setToUnitFrustum(); frustum.transformProvidingInverse(mMainCamera-getViewMatrix() * mMainCamera-getProjectionMatrix() ); bool isNotCulled = frustum.contains(boundingBox); Cheers, Janna -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49950#49950 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Check if a Drawable was culled or not
Hi Farshid, Your method is interesting. Before I've tried to use isCulled from CullVisitor but I was getting inconsistent results and did not figure out why. So I've tried to manually do the test using Polytope for the frustum check and it seems to be working fine so I think I will go with it for now. Thanks for your suggestion though! :) Cheers, Janna -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49953#49953 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph Newbie: PErformance question
OSX Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC September 11, 2012 11:33 AM Are you on Windows or Linux? If Windows, are you running with debug OSG libs? If so, release OSG libsare much faster.Just a thought...-Shayne-Original Message-From: osg-users-boun...@lists.openscenegraph.org[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of RandallHandSent: Monday, September 10, 2012 8:35 PMTo: osg-users@lists.openscenegraph.orgSubject: [osg-users] OpenSceneGraph Newbie: PErformance questionI'm experimenting with OpenScenegraph for a new project, and I've builda simple application that opens 2 viewer windows, and places 3 teapotsin them (using the teapot object from the osgteapot example),translating them into different positions. My resulting scene graph(saved as an osg) looks like this: Group { UniqueID Group_0 nodeMask 0x cullingActive TRUE num_children 3 Group {UniqueID Group_1nodeMask 0x cullingActive TRUEStateSet { UniqueID StateSet_2 DataVariance STATIC rendering_hint DEFAULT_BIN renderBinMode USE binNumber 50 binName RenderBin }num_children 1MatrixTransform { nodeMask 0x cullingActive TRUE referenceFrame RELATIVE Matrix {1 0 0 00 1 0 00 0 1 0 0 -50 0 1 } num_children 1 Geode { UniqueID Geode_3nodeMask 0x cullingActive TRUEStateSet { UniqueID StateSet_4 DataVariance STATIC rendering_hint DEFAULT_BIN renderBinMode INHERIT Material { ColorMode OFFambientColor 0.2 0.2 0.2 1 diffuseColor 0.8 0.8 0.8 1specularColor 0 0 0 1emissionColor FRONT 0 1 0 1 emissionColor BACK 1 0 0 1shininess 0 } LightModel {ambientIntensity 0.2 0.2 0.2 1 colorControl SINGLE_COLORlocalViewer FALSE twoSided TRUE }} num_drawables 1 }} } Group {UniqueID Group_5nodeMask 0xcullingActive TRUEUse StateSet_2num_children 1MatrixTransform { nodeMask 0x cullingActive TRUE referenceFrame RELATIVE Matrix {1 0 0 00 1 0 0 0 0 1 0-10 -50 0 1 } num_children 1 Use Geode_3} } Group {UniqueID Group_6 nodeMask 0xcullingActive TRUEUse StateSet_2 num_children 1MatrixTransform { nodeMask 0x cullingActive TRUE referenceFrame RELATIVE Matrix {1 0 0 00 1 0 00 0 1 0 10 -50 0 1 } num_children 1 Use Geode_3 } }}Pretty basic.. However, I'm only getting about 60-70fps (in each of my 2viewers). I've already set the vsync=false in my Stateset for theviewer (if I run with _nothing_ in my Scene Graph I get over 1000fps).Is this typical performance? I really expected to still be getting100+fps easy with such trivial geometry. Randall Hand September 10, 2012 9:35 PM I'm experimenting with OpenScenegraph for a new project, and I've build a simple application that opens 2 viewer windows, and places 3 teapots in them (using the teapot object from the osgteapot example), translating them into different positions. My resulting scene graph (saved as an osg) looks like this: Group { UniqueID Group_0 nodeMask 0x cullingActive TRUE num_children 3 Group { UniqueID Group_1 nodeMask 0x cullingActive TRUE StateSet { UniqueID StateSet_2 DataVariance STATIC rendering_hint DEFAULT_BIN renderBinMode USE binNumber 50 binName RenderBin } num_children 1 MatrixTransform { nodeMask 0x cullingActive TRUE referenceFrame RELATIVE Matrix { 1 0 0 0 0 1 0 0 0 0 1 0 0 -50 0 1 } num_children 1 Geode { UniqueID Geode_3 nodeMask 0x cullingActive TRUE StateSet { UniqueID StateSet_4 DataVariance STATIC rendering_hint DEFAULT_BIN renderBinMode INHERIT Material { ColorMode OFF ambientColor 0.2 0.2 0.2 1 diffuseColor 0.8 0.8 0.8 1 specularColor 0 0 0 1 emissionColor FRONT 0 1 0 1 emissionColor BACK 1 0 0 1 shininess 0 } LightModel { ambientIntensity 0.2 0.2 0.2 1 colorControl SINGLE_COLOR localViewer FALSE twoSided TRUE } } num_drawables 1 } } } Group { UniqueID Group_5 nodeMask 0x cullingActive TRUE Use StateSet_2 num_children 1 MatrixTransform { nodeMask 0x cullingActive TRUE referenceFrame RELATIVE Matrix { 1 0 0 0 0 1 0 0 0 0 1 0 -10 -50
Re: [osg-users] strange behavior with NodeMasks and camera CullMasks
false alarm ... someone had put a 0x2 node mask on the initial scene group node. Everything works now. Moderators, feel free to delete this thread. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49954#49954 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Multiple Buffers on Multiple viewers
I've done this in raw OpenGL before, but I can't for the life of me get it working in OpenSceneGraph. I need to render a scene and then display the result in 2 separate windows: One showing the Color Buffer, one SHowing the Depth Buffer (and eventually a 3rd showing the STencil Buffer). I've tried all day and got varying results, but nothing approaching success. CAn someone tell me what I'm doing wrong? Relevant code below.. Don't laugh too hard, I've been googling and reading the examples and cut-n-pasting code snippets all day, and I'm relatively sure that at least 50% of this is unnecessary.. Right now it's in a state of opening my windows showing _a_ texture, but it's all black (except for the red border I allowed just to see if this code is doing anything at all). The closest I got was using about 4 cameras (a Main camera, a Depth FBO camera, then 2 separate cameras for the 2 final screen-aligned quads), which would render my geometry on screen but nothing into the Depth or Color buffer textures. . Initialization stuff up here, nothing to do with OpenSceneGraph ... there's a global global osgViewer::CompositeViewer compViewer viewerColor = new osgViewer::View(); viewerDepth = new osgViewer::View(); { std::cout ** Initializing depth color texture std::endl; // Now setup the Depth Texture __depthTexture = new osg::Texture2D(); __depthTexture-setTextureSize(width, height); __depthTexture-setInternalFormat(GL_DEPTH_COMPONENT); __depthTexture-setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR); __depthTexture-setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR); __colorTexture = new osg::Texture2D(); __colorTexture-setTextureSize(width, height); __colorTexture-setInternalFormat(GL_RGBA); __colorTexture-setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR); __colorTexture-setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR); osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits; traits-x = xPos + 0; traits-y = yPos + 0; traits-width = width; traits-height = height; traits-windowDecoration = true; traits-doubleBuffer = true; traits-sharedContext = 0; traits-vsync = false; osg::ref_ptrosg::GraphicsContext gc = osg::GraphicsContext::createGraphicsContext(traits.get()); std::cout ** Initializing prime camera std::endl; __camera = new osg::Camera(); __camera-setGraphicsContext(gc.get()); __camera-setViewport(new osg::Viewport(0,0, traits-width, traits-height)); __camera-setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR); __camera-setProjectionMatrixAsPerspective(70,1.0, 1,200); __camera-setClearDepth(1.0); __camera-setViewMatrixAsLookAt( osg::Vec3(0,0,0), osg::Vec3(0,100,0), osg::Vec3(0,0,1) ); GLenum buffer = traits-doubleBuffer ? GL_BACK : GL_FRONT; __camera-setDrawBuffer(buffer); __camera-setReadBuffer(buffer); __camera-getOrCreateStateSet()-setRenderBinDetails(50,RenderBin); //__camera-setRenderOrder(osg::Camera::NESTED_RENDER); __camera-setRenderOrder(osg::Camera::PRE_RENDER); __camera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); __camera-attach(osg::Camera::DEPTH_BUFFER, __depthTexture); __camera-attach(osg::Camera::COLOR_BUFFER, __colorTexture); std::cout ** Attaching cmaeras to viewer std::endl; // add this slave camera to the viewer, with a shift left of the projection matrix if (__Side == leftview) { //viewerColor-addSlave(__depthCamera, osg::Matrixd::translate(-0.8,0,0), osg::Matrixd()); viewerColor-addSlave(__camera.get(), osg::Matrixd::translate(-0.8,0,0), osg::Matrixd()); } else if (__Side == rightview) { //viewerColor-addSlave(__depthCamera, osg::Matrixd::translate(+0.8,0,0), osg::Matrixd()); viewerColor-addSlave(__camera.get(), osg::Matrixd::translate(0.8,0,0), osg::Matrixd()); } else { //viewerColor-addSlave(__depthCamera, osg::Matrixd(), osg::Matrixd(),false); viewerColor-addSlave(__camera.get(), osg::Matrixd(), osg::Matrixd()); } std::cout Planar Depth std::endl; osg::Camera* camPtr = PlanarQuad(xPos, yPos, width,height, gc, true, buffer,__depthTexture); viewerDepth-addSlave(camPtr, osg::Matrixd(), osg::Matrixd(), false); std::cout Planar color std::endl; camPtr = PlanarQuad(xPos, yPos, width,height, gc, false,buffer,__colorTexture); viewerColor-addSlave(camPtr, osg::Matrixd(), osg::Matrixd(), false); } std::cout ** Initializing viewerColor std::endl; // Initialize the variables we'll need for this compViewer-addView(viewerColor);
Re: [osg-users] Ideas about a resource system, and deferred rendering framework
Hi Jeremy, Is there a term for this kind of approach? Well impostors comes to mind. That's where you would replace a complex mesh by a quad with a texture representing the complex mesh. Then when some criteria changes significantly (orientation of the view to the object, light source position, etc) you would re-render the texture once to fit the new criteria. This can be useful for far away meshes, for example trees where a close mesh is used, then lower and lower LODs, and eventually just a quad with a texture. Impostors are used so that the texture is still dynamic, instead of just a static billboard (which tend to look obviously like static billboards). Hope this helps, J-S On 11/09/2012 10:19 AM, Jeremy Moles wrote: On Tue, 2012-09-11 at 10:54 +0800, Wang Rui wrote: Hi Jeremy, Thanks for the tests and feedback. I'm focusing on creating a material system which may be a little similar to the Ogre one but will be very easy to integrate with OSG scenes. I'd like to also have a benchmark including a complete deferred shading pipeline in the near future to show others how OSG produces realistic worlds. :-) Your requirement could be easiliy implemented with one forward pass rendering the scene to a texture, and two deferred passes doing the blur work with the texture as input. A final compositing pass will make use of the outputs of the blur passes and output to a new texture. You can get and use the new texture then in the scene for your own purpose instead of direct displaying them on screen. I'd like to upload a DOF effect file and an updated example some days later to demonstrate how these work. Are there ever cases, when doing sophisticated layering of rendering like this, that you'd want to manually kick off the EffectCompositor for just a single frame and update the texture only once? (For example, by setting the NodeMask to 0xF for one frame, then back to 0x0 when you're done updating the View). Is there a term for this kind of approach, and would it make sense to also support this model of rendering directly or should it be left up to the user? Thanks, Wang Rui 2012/9/11 Jeremy Moles cubic...@gmail.com: On Mon, 2012-09-10 at 22:57 +0800, Wang Rui wrote: This looks really cool so far. I'd be really interested to know if it supports the following (and would be willing to create examples if you're willing to help)... Scenario: I want to render an entire subgraph to an FBO texture once, then apply 2 or more completely different shaders in some order, then put the final result into a last texture to be used somewhere in the scene. I'm doing a guassian blur, which typically applies two different shaders for x and y. I have this working in osgPPU, but I think you already have enough to do it here, I just couldn't put the pieces together. :) ___ 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 -- __ Jean-Sebastien Guay jean_...@videotron.ca http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Opengl 3
I'm not sure I understand Pererakos' question, as the errors he was getting concern deprecated GL1/2 commands such as glLoadMatrixf(), which should not be part of the OSG build if CMake was properly configured for GL3. I believe his build is already finding the gl3.h header file. I suspect he has not set up CMake properly for a GL3 build, which is why I directed him to review the comments in the osgsimplegl3 example. OSG_GL_MATRICES_AVAILABLE should be off, for example. Below, he says he has already switched this off, but I don't know what else would allow matrix functions to be accessed. -Paul On 9/11/2012 3:01 PM, Preet wrote: If you're using cmake-gui, make sure you tick the 'advanced' checkbox to see those flags. On Tue, Sep 11, 2012 at 10:44 AM, Peterakoshay...@gmail.com wrote: Hello. In the example you mention the is this text: Add the path toGL3/gl3.h to the CMake compiler flags, CMAKE_CXX_FLAGS and CMAKE_CXX_FLAGS_DEBUG (for release and debug builds; others if you use other build configurations). The text to add should look something like this: /I “C:\GLHeader” The folder GLHeader should contain a subfolder GL3, which in turn contains gl3.h. But Cmake doesnt create any entries with these names (CMAKE_CXX_FLAGS, CMAKE_CXX_FLAGS_DEBUG). Do i have to create them or is it ok if i add the opengl path in the parameter CMAKE_INCLUDE_PATH ? thank you. On 11 September 2012 04:58, Paul Martzpma...@skew-matrix.com wrote: On 9/10/2012 10:34 AM, Peterakos wrote: Hello. I face a problem trying to compile open scene graph using open gl 3. I get errors like these: error C3861: 'glLoadMatrixf': identifier not found error C3861: 'glMultMatrixf': identifier not found error C3861: 'glLoadMatrixd': identifier not found error C3861: 'glMultMatrixd': identifier not found Hm. Both v3.0.1 and also svn trunk r13140 seem to build fine for me, so I'm not sure why you'd encounter these errors. In CMake i have disabled everything that have the prefix OSG_GL except OSG_GL3_AVAILABLE. I build for GL3 using the instructions found in the osgsimplegl3.cpp example source code comment block. I also want to ask if i will be able to run the osg examples if i fully convert open scene graph in opengl 3. I doubt that any example other than osgsimplegl3 would work. -Paul ___ 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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Ideas about a resource system, and deferred rendering framework
Hi Jeremy, I will add a setEnable() method for each technique and pass of the compositor so we can control the forward/deferred rendering work more accurately. A texture which is attached with certain pass won't be updated if the pass is disabled, and will become activated when the pass is enabled again. I may upload the new version this weekend and hope it will help achieve your goal. Wang Rui 2012/9/11 Jeremy Moles cubic...@gmail.com: On Tue, 2012-09-11 at 10:54 +0800, Wang Rui wrote: Are there ever cases, when doing sophisticated layering of rendering like this, that you'd want to manually kick off the EffectCompositor for just a single frame and update the texture only once? (For example, by setting the NodeMask to 0xF for one frame, then back to 0x0 when you're done updating the View). Is there a term for this kind of approach, and would it make sense to also support this model of rendering directly or should it be left up to the user? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] AntTweakBar with Opengl 3.2
Hi Peterakos, Sorry for a little late to reply the same question on GitHub. The AntTweakBar example currently use a camera draw callback to render UI elements. This may not be suitable for some practical uses, as draw callbacks won't keep its own state sets. Thus when you apply shaders to scene graph, the state will affect the AntTweakBar calls and make the final results invalid. A good idea to solve this is to reimplement this example using a custom drawable which render AntTweakBar in the drawImplementation() method. I will consider rewrite this example soon. And you are welcomed to contribute. :-) Thanks, Wang Rui 2012/9/12 Peterakos hay...@gmail.com: Hello. Has anyone managed to make AntTweakBar work with OpengGL 3.2 and the usage of shaders in the models ? Thnx. ___ 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] [ANN] osgRecipes: Integrate OSG with almost everything, the second wave
I've just recalled that there also exist gameswf project which allows for Flash UI inside games. http://tulrich.com/textweb.pl?path=geekstuff/gameswf.txt Would be nice to see this one integrated. Would make a lot of hype with some easy flash demos :P ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [ANN] osgRecipes: Integrate OSG with almost everything, the second wave
Oh, you mean GameSWF. Yes it is in my TODO list. But in fact GameSWF doesn't handle AS3 so it may not be enough for Flash UI needs. I was interested in Vektrix before, which provides a better framework for Flash and AS3 (using Tamarin), but it seems inactivated now. Thanks for the notification, Wang Rui 2012/9/12 michael kapelko korn...@gmail.com: I've just recalled that there also exist gameswf project which allows for Flash UI inside games. http://tulrich.com/textweb.pl?path=geekstuff/gameswf.txt Would be nice to see this one integrated. Would make a lot of hype with some easy flash demos :P ___ 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