E. Wing | 1 Jun 2007 01:28
Picon

Re: Release schedule for 2.0, end of of May, early June!

So wait, what's the migration path for all the osgsimpleviewerFoo
examples. I don't want to rewrite everything (again).

> On 5/29/07, Paul Martz <pmartz at skew-matrix.com> wrote:
> > > If I can I would like to replace SimpleViewer by Viewer
> this week,
> > > since I think that will just simplify life all round, the
> QSG will
> > > need to reflect this by just removing the paragraphs that mention
> > > it.
> >
> > I want to make sure I understand you correctly: Are you saying that
> > you're removing the SimpleViewer class entirely? Or are you just
> > making it a wrapper around Viewer?
>
> My current thought is that is should be possible to use
> Viewer as a drop in replacement for SimpleViewer, they
> already share many of the
> same functions so porting across should be pretty painless.   Given
> this there shouldn't be any need for SimpleViewer or any
> wrapper around Viewer so SimpleViewer will be removed completely.
>
> The tricky bit is the management of events and the new
> renderingTraversals() implementation and perhaps a proxy
> GraphicsWindow implementation to help glue multi-window
> embedded usage together.  This is mainly internal
> implementation details though, its the hard part, but I
> believe perfectly doable.
>
> Robert.
(Continue reading)

Trajce Nikolov | 1 Jun 2007 05:42
Picon

HeightMap shading troubles

Hi Robert,

I am experiencing some troubles with rendering some HeightFields. Please have a look at the attached images. When I load all in the memory, I get it shaded ok. When I tile the HeightField, it is busted - the second uses the same code but called via PagedLOD. Any idea?

Thanx

--
- Nick

<div><p>Hi Robert,<br><br>I am experiencing some troubles with rendering some HeightFields. Please have a look at the attached images. When I load all in the memory, I get it shaded ok. When I tile the HeightField, it is busted - the second uses the same code but called via PagedLOD. Any idea? 
<br><br>Thanx<br clear="all"><br>-- <br>- Nick
</p></div>
J.P. Delport | 1 Jun 2007 09:09
Picon

Re: OpenThreads::Mutex win32 vs pthread inconsistencies

Hi all,

Paul, your implementation is certainly not wrong, it just differs from
the Linux behaviour.

I have read up on the issue last night and, surprise, I was not the
first person to stumble upon this inconsistency.

What follows is what I've found.

On Windows, both win32 mutexes and critical sections are called
"recursive" and that allows one to lock the same mutex multiple times
from the same thread.

Good info on the terminology can be found here:
http://www.boost.org/doc/html/thread/concepts.html
under locking strategies.

From reading some of the boost lists it seems that making a
non-recursive mutex (like the normal pthread_mutex is) is quite hard on
Windows. Boost neatly sidetsteps the issue by making it the programmer's
problem:
"
In general a mutex object with an unspecified locking strategy is
unsafe, and it requires programmer discipline to use the mutex object
properly. However, this strategy allows an implementation to be as fast
as possible with no restrictions on its implementation. This is
especially true for portable implementations that wrap the native
threading support of a platform. For this reason, the classes
boost::mutex, boost::try_mutex and boost::timed_mutex use this locking
strategy despite the lack of safety.
"

Boost uses critical sections on Windows and this is the same position we
are in now in terms of the differences between Linux and Windows. The
issue therefore is: Can we assume that all the code in OpenThreads/OSG
that relies on OpenThreads::Mutex adheres to this magical "programmer
discipline". It might, but I don't know how to even check. Were other
parts of code written with only non-recursive mutexes in mind?

Alternatives for creating a non-recursive mutex on Windows are:
* InterLockedExchange and various ways of spinning (like the old
OpenThreads code). Seems hard to get right and sched delays are almost
unavoidable.

* InterLockedExchange and an event. This looks quite neat and is used by
pthreads for win32 (see http://sourceware.org/pthreads-win32/)

* more ... e.g. May 2007 article
http://www.ddj.com/dept/cpp/199203083
"Developing Lightweight, Statically Initializable C++ Mutexes"

I hope I'm not kicking up a storm over nothing, but it just seems that a
mutex issue can cause all sorts of funnies with initialisation, shutdown
and multi-threading.

regards
jp

Paul Martz wrote:
> Yep, the CRITICAL_SECTION code was my change. There were bugs reported in
> the old code, and moving to CRITICAL_SECTION seemed like a wonderful
> simplification. I admit I didn't read the OpenThreads documentation, so was
> not aware that a thread should block itself in this case. CRITICAL_SECTION
> doesn't support that, as far as I know. It does block other threads though.
> 
> My apologies,
>    -Paul
> 
> 
>> -----Original Message-----
>> From: osg-users-bounces@... 
>> [mailto:osg-users-bounces@...] On Behalf Of 
>> J.P. Delport
>> Sent: Thursday, May 31, 2007 3:16 AM
>> To: osg users
>> Subject: Re: [osg-users] OpenThreads::Mutex win32 vs pthread 
>> inconsistencies
>>
>> Hi,
>>
>> Robert Osfield wrote:
>>> Hi J.P.
>>>
>>> Must admit I haven't used trylock in the OSG which is 
>> possibly why we 
>>> haven't hit upon this issue before.
>> The same actually happens with lock() on win32 with 
>> USE_CRITICAL_SECTION. I just used trylock() in the example to 
>> show the return value problem.
>>
>> current svn would happilly complete the following:
>>
>> for (int i=0;i<10;i++) {
>> 	mymutex.lock();	
>> }
>>
>> without any unlocks. I think it would only block if lock() is 
>> actually called from a different thread, but this is still 
>> not the pthread behaviour.
>>
>> jp
>>

--

-- 
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.

CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html 

CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html 

For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
CallCentre@...

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.

Alberto Luaces | 1 Jun 2007 09:54
Picon
Favicon

Re: same library path but different behaviour on different distros.

El Jueves 31 Mayo 2007, Frans Fürst escribió:
> Hi all,
>
> it's me again with a supposably simple question but I'm not only interested
> in a solution but in the backround and the suggested way as well.
>
> Situation: on my Gentoo-machine I download, 'cmake...', 'make' and 'make
> install' OpenSceneGraph and everything works.
>
> On an Ubuntu-machine I do the same and the linker won't find the static
> libraries and the executable won't find the shared libraries neither.

I can compile the latest OSG (SVN) on Kubuntu 7.04 without problems.

> On both machines the libraries are installed to /usr/local/lib64 but only
> the compiler on the Gentoo-machine finds them. There is no reference to
> that path in any environment-variable so where does the compiler get it
> from? Is it hard coded? And why doesn't cmake install them to /usr/lib?

It is traditionally assumed that all the software compiled from source is 
installed under /usr/local in order to keep it seperated from the software 
installed from the distribution's packages.

Maybe you haven't set your ldconfig configuration file to point 
to /usr/local/lib and /usr/local/lib64. Look both /etc/ld.so.conf in your 
distributions for differences.

> I guess I can tell cmake to make the install-path /usr/lib but why is it
> pre-configured that way and what could I have done better to have
> everything done "automagically"?
>
> thx
>
> Frans

Robert Osfield | 1 Jun 2007 09:59
Picon

Re: Release schedule for 2.0, end of of May, early June!

Hi Eric,

On 6/1/07, E. Wing <ewmailing@...> wrote:
> So wait, what's the migration path for all the osgsimpleviewerFoo
> examples. I don't want to rewrite everything (again).

The migration path is like to be:

  replace SimpleViewer with Viewer

And perhaps a little change to the way that the events are passed in,
as it'll be done via the GraphicsWindow i..e

   Viewer viewer;
   viewer.setUpViewAsEmbeddedInWindow(x,y,width,height);

   makeCurrent();

   while(!viewer.done())
   {
         // pass in events
        viewer.getEventQueue()->keyPress(...);

        viewer.frame();

        swapBuffers();
   }

When I get into the work I'll probably need to refactor some of this,
but this is roughly how it should look, basically not much different
to before, just with a lot more flexibilty under the hood.

Robert.
Robert Osfield | 1 Jun 2007 10:00
Picon

Re: HeightMap shading troubles

Hi Nick,

How are you creating the tiled hieght fields?

Robert.

On 6/1/07, Trajce Nikolov <nikolov.trajce@...> wrote:
> Hi Robert,
>
> I am experiencing some troubles with rendering some HeightFields. Please
> have a look at the attached images. When I load all in the memory, I get it
> shaded ok. When I tile the HeightField, it is busted - the second uses the
> same code but called via PagedLOD. Any idea?
>
> Thanx
>
> --
> - Nick
> _______________________________________________
> osg-users mailing list
> osg-users@...
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
>
Robert Osfield | 1 Jun 2007 10:08
Picon

Re: OpenThreads::Mutex win32 vs pthread inconsistencies

Hi J.P,

If its hard to make a clean non recusive lock under Windows I'm
tempted to say make OpenThreads::Mutex support recursive calls on all
platfroms, so simulate this under pthreads etc.  We already have a
ReentrantMutex in OpenThreads, the but I'd add to this is it does add
complexity to the OpenThreads, and at a time when I really don't want
to be changing any low down in the OSG as we are about to make 2.0.

Since most of the threading works starts off under linux and then
migrates to Windows we can say in general that out lock() don't
usually need to be recursive as I'd have deadlocks under Linux in
these instances - when these cases do exist the OSG already uses
ReentrantMutex.   If we had threading code coming from Windows to
other platforms this would be a greater issue.

Robert.

Robert.

On 6/1/07, J.P. Delport <jpdelport@...> wrote:
> Hi all,
>
> Paul, your implementation is certainly not wrong, it just differs from
> the Linux behaviour.
>
> I have read up on the issue last night and, surprise, I was not the
> first person to stumble upon this inconsistency.
>
> What follows is what I've found.
>
> On Windows, both win32 mutexes and critical sections are called
> "recursive" and that allows one to lock the same mutex multiple times
> from the same thread.
>
> Good info on the terminology can be found here:
> http://www.boost.org/doc/html/thread/concepts.html
> under locking strategies.
>
> From reading some of the boost lists it seems that making a
> non-recursive mutex (like the normal pthread_mutex is) is quite hard on
> Windows. Boost neatly sidetsteps the issue by making it the programmer's
> problem:
> "
> In general a mutex object with an unspecified locking strategy is
> unsafe, and it requires programmer discipline to use the mutex object
> properly. However, this strategy allows an implementation to be as fast
> as possible with no restrictions on its implementation. This is
> especially true for portable implementations that wrap the native
> threading support of a platform. For this reason, the classes
> boost::mutex, boost::try_mutex and boost::timed_mutex use this locking
> strategy despite the lack of safety.
> "
>
> Boost uses critical sections on Windows and this is the same position we
> are in now in terms of the differences between Linux and Windows. The
> issue therefore is: Can we assume that all the code in OpenThreads/OSG
> that relies on OpenThreads::Mutex adheres to this magical "programmer
> discipline". It might, but I don't know how to even check. Were other
> parts of code written with only non-recursive mutexes in mind?
>
> Alternatives for creating a non-recursive mutex on Windows are:
> * InterLockedExchange and various ways of spinning (like the old
> OpenThreads code). Seems hard to get right and sched delays are almost
> unavoidable.
>
> * InterLockedExchange and an event. This looks quite neat and is used by
> pthreads for win32 (see http://sourceware.org/pthreads-win32/)
>
> * more ... e.g. May 2007 article
> http://www.ddj.com/dept/cpp/199203083
> "Developing Lightweight, Statically Initializable C++ Mutexes"
>
> I hope I'm not kicking up a storm over nothing, but it just seems that a
> mutex issue can cause all sorts of funnies with initialisation, shutdown
> and multi-threading.
>
> regards
> jp
>
>
> Paul Martz wrote:
> > Yep, the CRITICAL_SECTION code was my change. There were bugs reported in
> > the old code, and moving to CRITICAL_SECTION seemed like a wonderful
> > simplification. I admit I didn't read the OpenThreads documentation, so was
> > not aware that a thread should block itself in this case. CRITICAL_SECTION
> > doesn't support that, as far as I know. It does block other threads though.
> >
> > My apologies,
> >    -Paul
> >
> >
> >> -----Original Message-----
> >> From: osg-users-bounces@...
> >> [mailto:osg-users-bounces@...] On Behalf Of
> >> J.P. Delport
> >> Sent: Thursday, May 31, 2007 3:16 AM
> >> To: osg users
> >> Subject: Re: [osg-users] OpenThreads::Mutex win32 vs pthread
> >> inconsistencies
> >>
> >> Hi,
> >>
> >> Robert Osfield wrote:
> >>> Hi J.P.
> >>>
> >>> Must admit I haven't used trylock in the OSG which is
> >> possibly why we
> >>> haven't hit upon this issue before.
> >> The same actually happens with lock() on win32 with
> >> USE_CRITICAL_SECTION. I just used trylock() in the example to
> >> show the return value problem.
> >>
> >> current svn would happilly complete the following:
> >>
> >> for (int i=0;i<10;i++) {
> >>      mymutex.lock();
> >> }
> >>
> >> without any unlocks. I think it would only block if lock() is
> >> actually called from a different thread, but this is still
> >> not the pthread behaviour.
> >>
> >> jp
> >>
>
> --
> This message is subject to the CSIR's copyright, terms and conditions and
> e-mail legal notice. Views expressed herein do not necessarily represent the
> views of the CSIR.
>
> CSIR E-mail Legal Notice
> http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html
>
> CSIR Copyright, Terms and Conditions
> http://mail.csir.co.za/CSIR_Copyright.html
>
> For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
> Legal Notice send a blank message with REQUEST LEGAL in the subject line to
> CallCentre@...
>
>
> This message has been scanned for viruses and dangerous content by MailScanner,
> and is believed to be clean.  MailScanner thanks Transtec Computers for their support.
>
> _______________________________________________
> osg-users mailing list
> osg-users@...
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
belthil | 1 Jun 2007 11:49
Favicon

NodeTrackerManipulator

Hello!
 
    In my application i'm using the NodeTrackerManipulator with the FindNamedNodeVisitor as there is in the osgplanets example. I use exactly the same to target the planet i want. But when i press a button to change the CameraManipulator, the center of the camera is properly centered on the found node but the camera is then so far away from the node i can't see it.
In fact at the very beginning of the application, the viewer is centered on the Sun (as it is its camera which is selected at the end like in the osgplanets example), then i can turn around it but as soon as i use the right button of the mouse to zoom, the viewer goes very far away from the Sun and i can't zoom toward the node anymore: the viewer is like blocked.
How can i correct this problem?
 
I thank you!
 
Belthil


Créez votre adresse électronique prénom.nom-QFKgK+z4sOrR7s880joybQ@public.gmane.org
1 Go d'espace de stockage, anti-spam et anti-virus intégrés.
<div>
<div>
<div>Hello!</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp; In my application i'm using the NodeTrackerManipulator with the FindNamedNodeVisitor as there is in the osgplanets example. I use exactly the same to target the planet i want. But when i press a button to change the CameraManipulator, the center of the camera is properly centered on the found&nbsp;node but the camera is then so far away from the node i can't see it. </div>
<div>In fact at the very beginning of the application, the viewer is centered on the Sun (as it is its camera which is selected at the end like in the osgplanets example), then i can turn around it but as soon as i use the right button of the mouse to zoom, the viewer goes very far away from the Sun and i can't zoom toward the node anymore: the viewer is like blocked.</div>
<div>How can i correct this problem?</div>
<div>&nbsp;</div>
<div>I thank you!</div>
<div>&nbsp;</div>
<div>Belthil</div>
</div>
<div>
<br><br>Cr&eacute;ez votre adresse &eacute;lectronique pr&eacute;nom.nom@...<br>1 Go d'espace de stockage, anti-spam et anti-virus int&eacute;gr&eacute;s.
</div>
</div>
J.P. Delport | 1 Jun 2007 11:56
Picon

Re: OpenThreads::Mutex win32 vs pthread inconsistencies

Hi,

Robert Osfield wrote:
> Hi J.P,
> 
> If its hard to make a clean non recusive lock under Windows I'm
I have code that depends on the non-recursive behaviour, so I will try
out the pthreads_win32 implementation and see how it goes. The old OSG
code also works for me, I will have to dig in the archives to see why it
was replaced and will then try to see if the pthreads_win32 does any better.

> tempted to say make OpenThreads::Mutex support recursive calls on all
> platfroms, so simulate this under pthreads etc.  We already have a
This is one way to get to consistency, but ...

> ReentrantMutex in OpenThreads, the but I'd add to this is it does add
> complexity to the OpenThreads, and at a time when I really don't want
> to be changing any low down in the OSG as we are about to make 2.0.
I also think we should hold off low level changes to Linux code now.
Having Mutex and ReentrantMutex behave the same would make one of them
redundant though.

> 
> Since most of the threading works starts off under linux and then
> migrates to Windows we can say in general that out lock() don't
> usually need to be recursive as I'd have deadlocks under Linux in
> these instances - when these cases do exist the OSG already uses
> ReentrantMutex.   If we had threading code coming from Windows to
> other platforms this would be a greater issue.
Agree fully, don't fix the Linux code if it ain't broken.

jp
> 
> Robert.
> 
> Robert.
> 
> On 6/1/07, J.P. Delport <jpdelport@...> wrote:
>> Hi all,
>>
>> Paul, your implementation is certainly not wrong, it just differs from
>> the Linux behaviour.
>>
>> I have read up on the issue last night and, surprise, I was not the
>> first person to stumble upon this inconsistency.
>>
>> What follows is what I've found.
>>
>> On Windows, both win32 mutexes and critical sections are called
>> "recursive" and that allows one to lock the same mutex multiple times
>> from the same thread.
>>
>> Good info on the terminology can be found here:
>> http://www.boost.org/doc/html/thread/concepts.html
>> under locking strategies.
>>
>> From reading some of the boost lists it seems that making a
>> non-recursive mutex (like the normal pthread_mutex is) is quite hard on
>> Windows. Boost neatly sidetsteps the issue by making it the programmer's
>> problem:
>> "
>> In general a mutex object with an unspecified locking strategy is
>> unsafe, and it requires programmer discipline to use the mutex object
>> properly. However, this strategy allows an implementation to be as fast
>> as possible with no restrictions on its implementation. This is
>> especially true for portable implementations that wrap the native
>> threading support of a platform. For this reason, the classes
>> boost::mutex, boost::try_mutex and boost::timed_mutex use this locking
>> strategy despite the lack of safety.
>> "
>>
>> Boost uses critical sections on Windows and this is the same position we
>> are in now in terms of the differences between Linux and Windows. The
>> issue therefore is: Can we assume that all the code in OpenThreads/OSG
>> that relies on OpenThreads::Mutex adheres to this magical "programmer
>> discipline". It might, but I don't know how to even check. Were other
>> parts of code written with only non-recursive mutexes in mind?
>>
>> Alternatives for creating a non-recursive mutex on Windows are:
>> * InterLockedExchange and various ways of spinning (like the old
>> OpenThreads code). Seems hard to get right and sched delays are almost
>> unavoidable.
>>
>> * InterLockedExchange and an event. This looks quite neat and is used by
>> pthreads for win32 (see http://sourceware.org/pthreads-win32/)
>>
>> * more ... e.g. May 2007 article
>> http://www.ddj.com/dept/cpp/199203083
>> "Developing Lightweight, Statically Initializable C++ Mutexes"
>>
>> I hope I'm not kicking up a storm over nothing, but it just seems that a
>> mutex issue can cause all sorts of funnies with initialisation, shutdown
>> and multi-threading.
>>
>> regards
>> jp
>>
>>
>> Paul Martz wrote:
>> > Yep, the CRITICAL_SECTION code was my change. There were bugs
>> reported in
>> > the old code, and moving to CRITICAL_SECTION seemed like a wonderful
>> > simplification. I admit I didn't read the OpenThreads documentation,
>> so was
>> > not aware that a thread should block itself in this case.
>> CRITICAL_SECTION
>> > doesn't support that, as far as I know. It does block other threads
>> though.
>> >
>> > My apologies,
>> >    -Paul
>> >
>> >
>> >> -----Original Message-----
>> >> From: osg-users-bounces@...
>> >> [mailto:osg-users-bounces@...] On Behalf Of
>> >> J.P. Delport
>> >> Sent: Thursday, May 31, 2007 3:16 AM
>> >> To: osg users
>> >> Subject: Re: [osg-users] OpenThreads::Mutex win32 vs pthread
>> >> inconsistencies
>> >>
>> >> Hi,
>> >>
>> >> Robert Osfield wrote:
>> >>> Hi J.P.
>> >>>
>> >>> Must admit I haven't used trylock in the OSG which is
>> >> possibly why we
>> >>> haven't hit upon this issue before.
>> >> The same actually happens with lock() on win32 with
>> >> USE_CRITICAL_SECTION. I just used trylock() in the example to
>> >> show the return value problem.
>> >>
>> >> current svn would happilly complete the following:
>> >>
>> >> for (int i=0;i<10;i++) {
>> >>      mymutex.lock();
>> >> }
>> >>
>> >> without any unlocks. I think it would only block if lock() is
>> >> actually called from a different thread, but this is still
>> >> not the pthread behaviour.
>> >>
>> >> jp

--

-- 
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.

CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html 

CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html 

For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
CallCentre@...

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.

Robert Osfield | 1 Jun 2007 12:35
Picon

Re: osgviewer Camera Animation (preliminary)

Thanks Jeremy, I've merged the new handler and checked it in.

I have changed its name to RecordCameraPathHandler, and have also
change it to write to saved_animation.path as per the old
osgProducer::Viewer.  I have removed the use of getCameraWithFocus()
as this could cause problems when you have multiple windows open with
multiple slave cameras, when you should just record the master cameras
path.

I haven't added in the 'Z' functionality suggested by Paul yet though,
this is a little more complicated because osgViewer::Viewer isn't hard
wired to use a KeySwitchMatrixManipulator like osgProducer::Viewer
was.  What will need to be done is for a check against the
Viewer::getCameraManipulator() to see if it is a
KeySwitchMatrixManipulator, if not then insert one, and add this
original manipulator plus an AnimationPathManipulator, then switching
this to current selected one.

Robert.

On 5/31/07, Jeremy L. Moles <jeremy@...> wrote:
> I put this together during lunch today if anyone is interested in trying
> it out (I'll submit formal files when it's done, Robert). Basically, it
> tries to emulate the old osgProducer "camera animation" functionality
> (which we've been discussing in another thread). It is a patch against
> SVN as of a few minutes ago (May 31st, 16:30 EST)
>
> It seems to be working okay for me at the moment. Usage is:
>
>         # OSG_CAMERA_ANIMATION_FPS=25 osgviewer cow.osg
>         ...press Z...
>         ...move camera...
>         ...press Z again...
>         # vim camera-path.txt
>         ...awesomeness!...
>         # osgviewer -p camera-path.txt cow.osg
>
> In the example above I explicitly set the FPS to 25, although this is
> the default. It doesn't seem to need a high ControlPoint capture value,
> since it appears to do smooth interpolation between them...
>
> _______________________________________________
> osg-users mailing list
> osg-users@...
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
>

Gmane