Re: [osg-users] [build] _OPEN_THREADS_ATOMIC_USE_GCC_BUILTINS
Many thanks for the response Jason - I'll modify our build scripts accordingly - I'd prefer to be using atomic operations and avoiding the use of mutexes. Cheers Paul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50459#50459 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [build] _OPEN_THREADS_ATOMIC_USE_GCC_BUILTINS
Hi all, we've been having some intermittent deadlock issues and as part of my investigation I noticed that our (albeit quite old - 2.9.8, we shall be upgrading imminently) OSG libs were being compiled with _OPENTHREADS_ATOMIC_USE_MUTEX. On further investigation, it appears that the test for availability of _OPEN_THREADS_ATOMIC_USE_GCC_BUILTINS on our particular architecture (Linux RH 5.6) requires the additional compiler argument -march=i686 in order to pass and hence not default to using mutexes. Would I be right in thinking that building with _OPEN_THREADS_ATOMIC_USE_GCC_BUILTINS instead of _OPENTHREADS_ATOMIC_USE_MUTEX should provide significant 'general' performance improvement? On a related note - our investigations into these deadlocks has proved very difficult since typically the thread stacktraces recorded at the point of deadlock can't be traced further back beyond libGL.so - if anyone has experience of similar situations, I'd welcome any advice. Any feedback on the above would be appreciated. Many thanks Paul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50424#50424 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How do I create a 2D HUD with loaded images?
Hi Nilix, I've successfully displayed an image in a HUD taking the following general approach: create an osg::geometry set the vertices based on the image size create an osg::Texture2D create an osg::Vec2Array for texture coordinates call setTexCoordArray on the osg::geometry add the osg::geometry to a parent osg::Geode create a stateset on the geometry and call setTextureAttributeAndModes with the above texture HTH -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47636#47636 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] getOrCreateStateSet called from outside the main thread
Hi, I've been away for two weeks, and now returning to this issue. Just wanted to update in case my findings are useful to others. On further investigation, I realised that calling getOrCreateStateSet on a newly created text node will return a pointer to a 'singleton' instance of a stateset. I had assumed that after creating the text node, the above call would 'Create' a new stateset rather than 'Get' an existing one - so I think some of our crashes are due to the same stateset pointer being written to on different threads. We're in the process of rationalising how we use statesets in our app. so we can reusing a singleset - this should resolve our issue. Thanks again Paul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43152#43152 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] getOrCreateStateSet called from outside the main thread
Hi, I'm hoping someone can shed some light on an issue we are having, running OSG 2.8.2 (redhat 5.3) in single threaded mode and creating scenegraph components on a background thread. Basically, we are using a background thread to build up scenegraph components and then adding them to our 'main' scenegraph. For the most part, this works fine, but when the activity on the background and main threads are high (eg. a lot of stuff moving around/ being drawn in the main scene, plus lots of updates happening on our background thread) we are seeing occasional crashes in setAssociatedModes() and other stateset related functions. My first thought was that somehow our calls to getOrCreateStateSet() from our background thread were interfering with state set manipulation on the main thread, indeed replacing getOrCreateStateSet with a call to explicitly create the stateset appears to resolve the crash. Can anyone confirm whether calling getOrCreateStateSet() outside the main thread is a safe / sensible thing to do? As I say, I have what appears to be a fix for the problem, but it would be nice to understand what is going wrong before progressing it. Thanks in advance for any help. Cheers, Paul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=42603#42603 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] getOrCreateStateSet called from outside the main thread
Hi, Thanks for the reply Robert - just to confirm, we are indeed calling getOrCreateStateSet on nodes created in the same thread and not back in the main thread, so as you say, it should work fine. I shall run our app against a debug version of osg and try and get some more details of the crash (last two crashes were in osg::StateAttribute::removeParent(), but this seems to vary between runs). Many Thanks Paul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=42629#42629 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] update and cull frame-spanning issue
Hi, I'm hoping someone can help - I'm calculating a scaling value in my cull traversal using the pixelSize() function. I then set my scaling matrix in the update traversal. The problem with this is that the scale calculated is always one frame out when it get's applied - so there's a noticeable jerkiness on zooming in. If I update my matrix in the cull traversal, zooming is smooth, however I understand that this is a dangerous thing to do. Can anyone suggest a more sensible workaround? Many thanks in advance Paul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32389#32389 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] update and cull frame-spanning issue
Many thanks for the prompt responses. I've got a clear way forward now. Cheers Paul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32403#32403 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osg newbie question: billboard with multiple drawables?
Hi, I'm hoping someone can help. I'm trying to develop an in-scene 'label' for my 3D objects (consisting of text and geometry). I was hoping I'd be able to use the osg billboard and add my geometry and text to it as drawables, but I now realise that each drawable will have its own pivot point, so my text and geometry will become misaligned. Is there a way to massage the billboard such that it 'groups' all its children and effectively applies a single transformation about a single pivot point (hence keeping the text and geometry in the same plane)? Or can anyone suggest a simpler / better approach to the problem? Just to reiterate - I'm trying to create screen-facing labels to insert into my 3D scene - the label needs to support text and geometry. Any advice on how to best approach this is much appreciated - I'm hoping someone has tackled a similar problem in the past. Many thanks Paul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32125#32125 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg newbie question: billboard with multiple drawables?
Hi Robert, many thanks for the prompt reply - I've been playing around with the autotransform and you're right - it is much more suited to our needs than the billboard. Thanks again Paul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32133#32133 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg newbie question: billboard with multiple drawables?
Hi, on the subject of the autotransform: in scale_to_screen mode, I was trying to use minScale and maxScale to effectively bound the drawn screen size of my geode between a minimum and maximum, but I think I'm mis-interpreting these parameters. Increasing maxScale does not appear to increase the maximum drawn size of my geode, and setting minScale doesn't seem to permit me to define a minimum drawn size? I've had a look at the AutoTransform code and I can see that the application of these scale settings are affected by the transition width, but it's not clear to me how they are connected? If anyone can clarify for me, the relationship between transition width, minScale and maxScale and whether or not these could be used to define a minimum and maximum drawn size of a geode, I'd really appreciate it. Many thanks in advance. Paul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32137#32137 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] newbie pixelSize() vs. measured screen size query
Thanks Frederic - as you say, for the case of a square, you'd expect the bounding sphere diameter to contain the bounding box - ie. in this case the square itself. The problem I'm having is trying to relate the pixelSize() returned value to the pixel size of the square's diagonal as measured on the screen. I expected them to be identical, but they don't correlate at all. Is the returned value of pixelSize() for a bounding sphere an area/ diameter? Either way it doesn't seem to equate to the measurements I make from doing a screen grab and counting pixels. I have a feeling I'm missing some kind of transformation between computing the pixelSize and relating that to the measurements made on the screen. Paul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30607#30607 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] newbie pixelSize() vs. measured screen size query
Many thanks Frederic, I now see the point you're making. Still not sure exactly what pixelSize() returns - I may do some simple experiments without the billboard, maybe with just a simple sphere and see if the pixelSize() then correlates with screen pixel measurements - unfortunately I can't do any coding from home at the moment though. Paul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30611#30611 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] newbie pixelSize() vs. measured screen size query
Hi, I've modified the osg billboard example and am examining the pixel size computed from one of the billboard's bounding spheres. I'm sure I'm missing something fundamental in my understanding of what's going on, but I expected the pixel size computed by pixelSize() to correspond to the length of the billboard's diagonal as measured on the screen? Can anyone explain to me the relationship between the pixel size returned from the pixelSize() function and the on-screen pixel size (ie. of the billboard) in this instance? Many thanks Paul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30598#30598 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org