Re: [osg-users] openGL extensions
Ben Axelrod wrote: Thank you Jean and Gordon. I put those functions in my draw callback and now I get some information. However, the behavior is very strange. It only works the first time through. The rest of the time, they return null. Even weirder is that if I click on another window, they work again for one iteration, then go back to being null. Every time I click off and on again of my OSG application, the info appears. Why is this? Draw callbacks are only called when the node is drawn. If you are using display lists (OSG does by default), then the draw is called only on the first draw or when the context is initialized. All other draws are done using the cached display list. You need to disable display lists on your drawable with setUseDisplayList( false ). Hope this helps, --Will FYI: OSG 2.6.0 on Debian Etch with an NVidia 7300 card. Thanks, -Ben -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jean-Sébastien Guay Sent: Monday, September 22, 2008 8:12 PM To: OpenSceneGraph Users Subject: Re: [osg-users] openGL extensions Hi Ben, I would like to detect if the user has the appropriate openGL extensions in order to do shadowing. However, when I do: glGetString(GL_VERSION) glGetString(GL_EXTENSIONS) They return null. How can I get a list of the available extensions? Is there an easy way to get this info from OSG? For the first part of your question, they return NULL if they were called from a thread that does not have a graphics context. The safest way to do this is to create a camera predraw/postdraw/finaldraw callback or a node cull callback or a drawable draw callback. In each of these points you will have a graphics context. What I generally do is assume support is present and start the viewer with a detection callback attached (camera predraw callback on the main camera) which will check extensions and then remove itself from the camera. Then after the first frame, if I see that some feature is not supported, I disable the relevant options. There are other valid strategies of course. As for detecting actual extensions, instead of calling glGetString(GL_EXTENSIONS) and parsing it yourself, you can use #include osg/GLExtensions #include osg/GL2Extensions osg::isGLExtensionSupported(contextID, extensionName) Also, how do I know which extensions I need for the different shadow techniques? I'm personally not sure which extensions are required for all of them, perhaps someone else will know (it might be good to add that info to the osgShadow page on the wiki). I can tell you what I test for in the case of osgShadow::ShadowMap: _shadowsSupported = osg::isGLExtensionSupported(contextID, GL_EXT_framebuffer_object) (osg::isGLExtensionSupported(contextID, GL_ARB_fragment_program) || osg::isGLExtensionSupported(contextID, GL_EXT_fragment_program)) (osg::isGLExtensionSupported(contextID, GL_ARB_fragment_program_shadow) || osg::isGLExtensionSupported(contextID, GL_EXT_fragment_program_shadow)); Not sure if that's totally correct, but in most cases where shadow maps were not supported (they fell back to software and so were extremely slow) it was the first (GL_EXT_framebuffer_object) which was not supported. Hope this helps, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org smime.p7s Description: S/MIME Cryptographic Signature ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG 2.4 and GCC 4.3
Hi, We are currently using OSG 2.2 in our projects. I just moved to GCC 4.3 and am getting compile errors related to the stricter include rules that release implements. I have seen some traffic in the archives discussing a possible fix in the 2.3 development series. Did these fixes make it into 2.4? Thanks, Will smime.p7s Description: S/MIME Cryptographic Signature ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Transparency on a drawable
Hi Vincent, A Drawable (which Geometry inherits from) has an associated StateSet object the same way that Geodes (and other classes inheriting Node) do, so the same method should work for your geometry as well. See http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a01139.html for more information. --Will Vincent Bourdier wrote: Thanks for help. I do exactly the same things, on Nodes... but this time I am looking on a way to do this only on a geometry (So under a Geode)... If you have any suggestion.. Regards, Vincent 2008/7/11 Brian R Hill [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: This is what I do: osg::StateSet * stateset = node-getOrCreateStateSet(); osg::Material * mm = dynamic_castosg::Material*(stateset-getAttribute (osg::StateAttribute::MATERIAL)); if (!mm) { mm = new osg::Material; } mm-setAlpha(osg::Material::FRONT, transparency); stateset-setAttributeAndModes( mm, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON); stateset-setMode(GL_BLEND, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON ); stateset-setMode(GL_LIGHTING,osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON ); stateset-setRenderingHint(osg::StateSet::TRANSPARENT_BIN); Brian [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: - To: 'OpenSceneGraph Users' osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org From: Gordon Tomlinson [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Date: 07/11/2008 09:59AM Subject: Re: [osg-users] Transparency on a drawable Vincent You post your initial question at a little over 2 hours ago.. you need to give people time to possibly respond maybe 1-2 days http://www.catb.org/~esr/faqs/smart-questions.html http://www.catb.org/%7Eesr/faqs/smart-questions.html also a search of the mailing list archive will throw up quite a few discussions and solutions on this very subject From: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]] On Behalf Of Vincent Bourdier Sent: Friday, July 11, 2008 8:54 AM To: osg Subject: Re: [osg-users] Transparency on a drawable No one have any idea of how to set an alpha transparency level on a geometry ? It has no texture, juste one color... Thanks, Regards, Vincent. 2008/7/11 Vincent Bourdier [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] : Hi All, Just a simple question on how to set a transparency effect on a drawable. My geode contains 2 drawables, and I need only one to be transparent... I've tried : double opacity = 0.1; osg::StateSet* state = mygometry-getOrCreateStateSet(); state-setMode(GL_BLEND,osg::StateAttribute::ON| osg::StateAttribute::OVERRIDE); osg::Material* mat = (osg::Material*)state-getAttribute (osg::StateAttribute::MATERIAL); if(!mat) { mat = new osg::Material; mat-setAlpha(osg::Material::FRONT_AND_BACK, opacity); state-setAttributeAndModes(mat,osg::StateAttribute::ON); } Lightning is already set to ON... But nothing appear transparent... Thanks, Regards Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto: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 -- Will Dicharry Stellar Science Ltd Co smime.p7s Description: S/MIME Cryptographic Signature ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] PAT scale and addchild
Yes, it will be scaled. The transformation applies to all children of the PAT, regardless of when they are added. --Will Vincent Bourdier wrote: Hi all, Just a little question : I have a PAT with a setScale() aldeady done and a child. I want to add an other child to this PAT. Will this child be scaled ? no ? thanks. Regard, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Will Dicharry Stellar Science Ltd Co smime.p7s Description: S/MIME Cryptographic Signature ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG Node to Mesh
Hi Deepu, In addition to writing a node visitor to traverse the scene graph and move from node to node accumulating transforms, one thing I have done in the past to get the geometry information once the visitor reaches a scene graph leaf is extending osg::PrimitiveFunctor or osg::PrimitiveIndexFunctor to get geometry information from the drawable. This also follows the visitor pattern, allowing the geometry to describe itself to you. From these classes you can store the geometry to whatever data structure you need for your physics model. I believe the osg::TriangleIndexFunctor template class provides a nice implementation of the PrimitiveIndexFunctor methods for triangle based geometry and allows you to specify the processing function via a functor object (struct with overloaded operator()). Hope this helps. Will Jean-Sébastien Guay wrote: Hello Deepu, I am working on a simulation project in which I have to define an OSG node in the physics world (Bullet Physics). Can any one guide me towards a method by which I can convert an OSG node to a mesh so that I can define it in the physics world. In general, you would write a node visitor that given your node, would extract the vertices and triangles. Then you would give those to your physics engine. You'll have to figure out the particular format of the mesh the physics engine expects, of course. We can't help you with that. There is some code in the OBJ writer (src/osgPlugins/obj/OBJWriterNodeVisitor.{cpp|h}) which you could use as an example of how to extract vertices and triangles from a geometry object. Hope this helps, J-S ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] VRML plugin
Hi all, I've been working with the VRML model plugin in an attempt to load a VRML model into OSG. The plugin loads the sample.wrl model just fine in release mode, although I do have the problems described in this post: http://www.mail-archive.com/[EMAIL PROTECTED]/msg15906.html. When I try and load some of our own models, however, nothing gets loaded. Enabling the debug messages in the console, I receive the message unrecognized node type Separator for almost all of them, which I believe is coming from the OpenVRML library. Would porting the plugin to the latest version of the OpenVRML library fix this? I came across a discussion in the archives from August where the port to the newer OpenVRML library was dismissed due to the Boost dependency. Is this still the consensus? Also, I would like to know if someone more knowledgeable than I has any ideas in what would be involved in updating the plugin, which may be work that I am willing to do. Thanks, Will -- Will Dicharry Stellar Science Ltd Co smime.p7s Description: S/MIME Cryptographic Signature ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] observer_ptr get() return type issue
Hi All, I was working with observer_ptr and noticed that a const gets added to the get() return type. The observer_ptr::get() const method returns a const T*. I think the const modifier on the method should only apply to the observer_ptr object, not to the object that is pointed at. If the pointer is pointing to a const T*, then the return type would be const without modifying the return type of get(). Is this a bug, or is observer_ptr designed this way for some reason? Thanks, Will ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Autotransform Frustum Update
Hi, My scene graph has an Autotransform with a geode containing geometry for a textured quad to display an icon. The transform is set to auto rotate and scale to the screen. I am noticing two problems with this set up: - When the frustum changes (e.g. fov change), the icons no longer scale to the screen correctly. They get larger or smaller depending on whether the fov gets smaller or larger. - For a more dramatic changed in the frustum (e.g. going from windowed mode to full screen mode), the icons disappear entirely. I think these two problems may be related. I'm not sure if I'm mistaken on how the auto scale is supposed to work. I set the size of the icon in pixels, and it is my understanding that the auto scale mode should maintain the size of the icon in screen coordinates (as long as I've set up the viewport correctly, which I think I have). For the disappearing issue, I tried disabling culling for the autotransform node, but that did not help. Is there something I need to do to force the autotransform to update after I've changed the frustum? I've seen a couple of other posts that may have alluded to this issue, however they were related to culling and the advice given was to disable culling. Any information that anyone could offer on this would be very helpful. Thanks, Will ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Creating shapes using Geometry
Hi, You can take a look at the osg::ShapeDrawable and osg::Shape classes to draw simple objects such as spheres, cylinders, and boxes easily. For more complicated objects, you can build them using vertex arrays and osg::Geometry. Hope this helps. Will On Nov 21, 2007 4:58 PM, Renan Mendes [EMAIL PROTECTED] wrote: Hi, How do I create simple shapes, specifically spheres, cylinders and boxes using osg::Geometry? Can't find tutorials for that. Thanks. Renan M Z Mendes ___ 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] Performance issue with Database Pager Terra Vista Files
I don't have access to the machine that I was able to fix it on right now, so I don't know the exact version of the drivers. For the 7900 card, all I had to do was install the vendor drivers that came with the card. I believe the vendor on that one was EVGA. I will be able to check the version tomorrow. I've had the problem on two 8800 GTX cards, one an Asus, the other an Evga. I have not been able to fix it on the Evga card yet. On the Asus card, there is an option in the Nvidia control panel under the 3d settings about threading that doesn't appear on the Evga machine. I have no idea why that is. That option fixed the problem on the Asus card. I will be able to check the exact name and setting of that option tomorrow. I will send another email tomorrow after I check the driver version and the extra setting to give you more information. Will On Nov 11, 2007 7:36 PM, Akhtar Shamim [EMAIL PROTECTED] wrote: Hi Will, Is it possible for you to link me to the driver which solves the problem? That will be very helpful to me. Regards, Shamim On Nov 12, 2007 9:02 AM, Akhtar Shamim [EMAIL PROTECTED] wrote: Thanks for your replies. Robert, I am using windows XP Pro with service pack 2. The problem happens with GeForce 8800 GTX cards. Will, is there any solution to this or do I need to change my graphics cards? Regards, Shamim On Nov 12, 2007 5:53 AM, Will Dicharry [EMAIL PROTECTED] wrote: Hi, I am not sure if this is the same problem, but I have an application that uses large paged databases and have seen a slow down on a higher end machine with a GeForce 7900 The slow down was only on Windows, Linux ran fine. After tracking it down, I found out that the bottleneck was actually in the graphics drivers. After installing an older version of the drivers, the performance went back up again. I've also seen the same behavior on a machine with a GeForce 8800 GTX. Unfortunately, I cannot find an older version of the drivers for that card. Again, I don't know if this is the same problem, but the performance loss on a higher end machine rang a bell in my head. Will On Nov 10, 2007 12:31 AM, Akhtar Shamim [EMAIL PROTECTED] wrote: Dear All, Lately I had been seeing a very obscure problem with our OSG application. The application uses a very large Terra Vista paged terrain. I see the following two phenomena: 1. With all our old computers (i.e. computers having a single core CPU, 1 GB or less RAM and with graphics card NVidia 6600) the application gives a constant update rate of 60 Hz. No problem with any refresh rate issues. 2. However, when I try the same application on a high end machine (Dual Core CPU or Quad Core CPU and with graphics card 7800 GT++) the performance is very poor and quite unpredictable. I looked at the CPU usages and found that the CPU usage is below 20 % for most of the CPUs. The application crawls at less than 6-7 Hz. However, if I change the BIOS setting to use only one CPU the application is back to normal and runs at constant 60 Hz. It seems to me that the database pager isnt working perfectly with multiple CPUs and gets deadlocked. I am very confused with this situation. For our deployment we have all new machines with dual and quad core CPUs and latest graphics cards. I would be very happy to hear suggestion/advice on how to solve this performance issue. To be honest I am quite stuck with the problem. I have tried compiling our application with OSG 1.2 and OSG 2.0. The phenomenon is the same. Best regards. ___ 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] LOD levels in Terrain generation.
I'm not sure if this is what you're looking for, but you can pre-process your imagery using the gdalwarp utility. I believe that it contains options for rescaling and interpolating the source imagery while maintaining the georeferenced extents of the imagery. Will On 10/18/07, om [EMAIL PROTECTED] wrote: Hi Christoph, Thanks for your reply. As you suggested, it is understandable that data generation stops at the original resolution. Is there any option which helps in creating the required data by interpolation, in case we require a higher image resolution? Thanks Om Christoph Ehrler wrote: Hi Om, just a simple answer and some more questions because I'm not one of the VirtualPlanetBuilder/osgDEM coders. The topmost LOD is the one with the worst resolution (only one tile). The deepest LOD is the one with the best resolution. When osgDEM arrives at the resolution of the original data it stops since doing more levels of detail is ridiculous. One question for me is how big is LOD 1 ??? A tile of size 512x512 pixel ?? Is it possible to reduce the LOD count while preserving that the highest LOD is the original resolution??? Meaning, I want to reach my original resolution no matter what I definet as LOD count. Cheers Christoph On 10/18/07, om [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I tried to generate paged LOD database using osgdem (Using texture map and .dem file as input). The application is unable to generate the LOD database in case of high no of levels(I tried with a level 9 input but only 6 levels were created). Application quits after generating these levels without any warning or error message. Is there any dependency between the image resolution and no of levels? Or is it because of some other reasons? Thanks. Om ___ osg-users mailing list [EMAIL PROTECTED]://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list [EMAIL PROTECTED]://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