Re: [osg-users] Multithreadingcrash due toosgDb::Registry::instance()

2009-03-20 Thread J.P. Delport

Hi all,

for those interested in instruction order issues, these videos might be 
interesting (search google video):


* Herb Sutter - Machine Architecture: Things Your Programming Language 
Never Told You


* IA Memory Ordering

There is quite a bit of work going into the next C++ standard to address 
some of these issues. Sutter  others have written a lot about it in the 
last few months, a search should send you down the rabbit hole.


cheers
jp

I-Nixon, Anthony D wrote:

Thanks for the pointer Paul.  The points you raise do apply to C++ as
well, and it seems the consensus is that it is not possible to implement
the double-checked locking pattern in portable C++ safely.

See Scott Meyer's and Andrei Alexandrescu's paper here
http://www.aristeia.com/Papers/DDJ_Jul_Aug_2004_revised.pdf  


If Scott Meyer's says it can't be done, I tend to believe him :-)


From Scott's paper:


In many cases, initializing a singleton resource during single-threaded
program startup
(e.g., prior to executing main) is the simplest way to offer fast,
thread-safe
singleton access.

So the best thing to do is to advertise in large bold letters somewhere
in the doco (and FAQ) that if you are going to use multithreading, all
instances need to be accessed before threading starts.

Anthony


-Original Message-
From: Paul Speed [mailto:psp...@progeeks.com] 
Sent: Friday, 20 March 2009 2:21 AM

To: OpenSceneGraph Users
Subject: Re: [osg-users] Multithreadingcrash due 
toosgDb::Registry::instance()


Just a note for those of us who have been bitten by double 
check locking issues in Java, this technique is highly 
dependent on the threading and data architecture in use.  
There are subtle issues between when a thread commits its 
local state and the possibility for the compiler to reorder 
statements.  This was less of an issue on single-core boxes 
but comes up in multi-core where the local thread state may 
not be committed.  I can't be sure but there may have also 
been some subtle statement reordering issues with respect to 
the compiler not knowing that your guard release _must_ be 
run after the instance_ = new Singleton has _fully_ executed.


I don't know if these problems crop up in C++ but it 
certainly seems like they could depending on the threading 
implementation and compiler optimization strategy.


Worst case for a singleton pattern is that you might get a 
race condition where two instances are created.  There are 
other double-checked locking situations that are much more insidious.


-Paul

Paul Melis wrote:

Robert Osfield wrote:
2009/3/17 Schmidt, Richard richard.schm...@eads.com 
mailto:richard.schm...@eads.com


http://www.cs.wustl.edu/~schmidt/PDF/DC-Locking.pdf
http://www.cs.wustl.edu/%7Eschmidt/PDF/DC-Locking.pdf


Could you explain what the above document is all about...
I just read it an it describes a pattern where you use a mutex to 
guard access to the singleton's _instance value, but in such a way 
that the mutex is only needed when _instance == NULL, i.e.


class Singleton
{
public:
   static Singleton *instance (void)
   {
// First check
if (instance_ == 0)
   {
  // Ensure serialization (guard constructor 

acquires lock_).

 GuardMutex guard (lock_);
 // Double check.
 if (instance_ == 0)
  instance_ = new Singleton;
   }
return instance_;
// guard destructor releases lock_.
   }
private:
   static Mutex lock_;
   static Singleton *instance_;
};

This should give you thread-safe access to Singleton-instance() at 
all times combined with correct initialization.


Quite neat actually,
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-opensce

negraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


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


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] unsubscruibe

2009-03-20 Thread andree gebert
Hi Have been trying to ubsubscribe for a while, I have no idea what any of you 
are talking about and the inbox is always full!  please help!
Andree




  Stay connected to the people that matter most with a smarter inbox. Take 
a look http://au.docs.yahoo.com/mail/smarterinbox___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] unsubscruibe

2009-03-20 Thread Roland Smeenk
Andree,

Go to the bottom of the following page to unsubscribe from the mailing list:
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

As an alternative you may register at the forums:
http://forum.openscenegraph.org/

--
Roland

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=8823#8823





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] FFmpeg plugin

2009-03-20 Thread Robert Osfield
HI Carlos,

Our plugin doesn't contain any inflateInit_ or inflate method of any kind,
so the missing sybmol must be coming from ffmpeg itself.  I haven't see this
error myself when building from various versions of ffmpeg so perhaps it's
version 0.5 that has gone astray.

Have a look in ffmpeg itself for the inflateInit_ method.  Another thing you
could try is using the svn version of ffmpeg, or the ffmpeg libs pulled down
from the Ubuntu repositories.

Robert.

2009/3/19 Carlos Sanches ces...@gmail.com

 Ok , I did it .
 now I m trying to run de example:
  osgmovie -e ffmpeg

 this error occours

 Warning: dynamic library '/usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so'
 exists, but an error occurred while trying to open it:
 /usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so: undefined symbol:
 inflateInit_
 Usage: ./osgmovie [options] filename ...
 Options:
 ...





 2009/3/19 Adrian Egli OpenSceneGraph (3D) 3dh...@gmail.com

 I am working with windows, no problem there, but here my settings.
 Variable Name: FFMPEG_LIBAVCODEC_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVCODEC
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVCODEC_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avcodec-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVDEVICE_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVDEVICE
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVDEVICE_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avdevice-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVFORMAT_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVFORMAT
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVFORMAT_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avformat-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVUTIL_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVUTIL
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVUTIL_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avutil-49.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBSWSCALE_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/libswscale
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBSWSCALE_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/swscale-0.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_ROOT
 Description: Location of FFMPEG
 Current Value: F:/dev/ffmpeg/SDK/include
 New Value (Enter to keep current value):


 2009/3/19 Carlos Sanches ces...@gmail.com

 Hi Adrian !
 ok, I have the ffmpeg installed . I use it to convert my movies.
 Now I m seeing in ccmake configure list . but have some options that I
 dont know what I have to put there.
 the options are :

 FFMPEG_LIBAVCODEC_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBAVCODEC_LIBRARIES
 /usr/lib/libavcodec.so

  FFMPEG_LIBAVDEVICE_INCLUDE_DIR
 FFMPEG_LIBAVDEVICE_INCLUDE_DIRS-NOTFOUND

  FFMPEG_LIBAVDEVICE_LIBRARIES
 FFMPEG_LIBAVDEVICE_LIBRARIES-NOTFOUND

  FFMPEG_LIBAVFORMAT_INCLUDE_DIR
 /usr/include

  FFMPEG_LIBAVFORMAT_LIBRARIES
 /usr/lib/libavformat.so

  FFMPEG_LIBAVUTIL_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBAVUTIL_LIBRARIES
 /usr/lib/libavutil.so

  FFMPEG_LIBSWSCALE_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBSWSCALE_LIBRARIES
 /usr/lib/libswscale.so

  FFMPEG_ROOT


 The options that I believe that must be wrong are:
 FFMPEG_LIBAVDEVICE_INCLUDE_DIR
  FFMPEG_LIBAVDEVICE_LIBRARIES
  FFMPEG_ROOT

 What I have to do in these options ?
 tks








 2009/3/19 Adrian Egli OpenSceneGraph (3D) 3dh...@gmail.com

 Hi Carlos
 You have to donwload ffmpeg and build the plugin by setting up the right
 parameters in cmake. then osg will build the ffmpeg plugin as well as the
 other 3rd party plugins will be build.

 adrian

 2009/3/18 Carlos Sanches ces...@gmail.com

 Hi Robert.
 I m seeing that my /usr/local/lib/osgPlugins-2.9.1  directory dont have
 the plugin for ffmpeg .
 this is correct ?
 I put this in my code ...
 std::string libName =
 osgDB::Registry::instance()-createLibraryNameForExtension(ffmpeg);
 osgDB::Registry::instance()-loadLibrary(libName);

 but how I know if it is using ffmpeg ?

 tks




 2009/3/16 Robert Osfield robert.osfi...@gmail.com

 Hi Carlos,

 Have a look at the osgmovie example for guidance, it'll boil down to
 reading a image, and assing to the a textured quad.  Right now you'll 
 need
 to preload the ffmpeg plugin as osgDB won't yet automatically alias the
 movie extensions to ffmpeg.  On the movie command line you use the 
 option -e
 ffmpeg to pre load the plugin.  Programatically you'd use:

 

Re: [osg-users] Blueberry3D high detail terrain solution for OpenSceneGraph

2009-03-20 Thread Enrico Raue
Hi,

First I would like to correct previous post, claiming Blueberry3D is a core 
library and cant be used as it is.
Blueberry3D is a commercial off the shelf product with 3 main modules for 
REAL-TIME simulation.
The Blueberry3D Editor, the Blueberry3D Real-Time Environment with SDK and the 
Blueberry3D Run-time.

It is possible to get a free evaluation copy of Blueberry3D.
The software you will get for the evaluation is the full version of Blueberry3D.
There is no limitation of the functionally.
You are also provided with a DEMO database 50km X 30km.
The evaluation period is normally for 30days.

Contact me if you are interested in an evaluation copy: 

Enrico

PS: Frederic, thank you for nice comments about our LandSIM3D product.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=8824#8824





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Image Resolution in VPB

2009-03-20 Thread Robert Osfield
Hi Matins,

Slight variations of the pixel colour may come about due to GDAL
interpolating data, interpolation done with VPB, or the edge boundary
equalization.  The small variation you are seeing might simply be down to
this, it's not something at this stage I'd even flag up as a problem.  It
certainly doesn't looked to be the corner equalization bug, as this just
effects the corners.

BTW, the way is there a reason for the image being pixelated?  VPB typically
generates databases that use linear texture filtering.

Robert.

2009/3/19 Martins Innus min...@ccr.buffalo.edu

 Robert,
Thanks. Using -e with appropriate options did exactly what I wanted,
 except for a slight error on the edges of the created images.  If i overlay
 the created image tiles from the highest resolution level on top of the
 original source imagery, they are pixel to pixel exact except for a 1 pixel
 strip all the way around the image.
It appears that the edge values are an average of what the pixel
 value actually should be and the pixel directly adjacent to it but what
 should be the next tile.
If you layer the attached good and bad images on top of each other
 in an image viewer and toggle back and forth you can see the pixels
 changing.
The good image is just the original source imagery zoomed in.  The
 bad image shows the vpb generated tile overlayed  on the left side.

I saw the corner equalization bug posts, but this seems like a
 different issue.

 This is under Redhat Enterpise Linux, x86_64, with OSG 2.8 and VPB svn of a
 couple days ago.

 Martins


 Robert Osfield wrote:

 Hi Martins,

 You could try to use the -e option.  It takes lat/longs as input.  I don't
 know if it'll pad though, as I suspect it won't unless the at least some of
 the input data covers the region.   If you want to force the resolution to
 be the same then just use the image and height res option.  I can't recall
 what they off the top of my head, run osgdem --help to list them all.

 Robert.

 On Mon, Mar 16, 2009 at 6:12 PM, Martins Innus 
 min...@ccr.buffalo.edumailto:
 min...@ccr.buffalo.edu wrote:

Hello,
   I'm using VPB to generate a terrain database with 2ft
resolution elevation data and 1 ft resolution imagery. What I'm
trying to do is make the imagery in the highest resolution tiles
have the exact same resolution as the source imagery and also still
be a power of 2 for the image tiles.
   I've verified that if I take a small input area where the
source imagery dimensions are a power of 2, I get what i want for
the final model.
   It seems that if I could tell VPB to pad out the extents of
my input data to a power of 2 that should work as well.  I don't
care if its black or garbage or whatever.

   Would the -e option do what I want if I specify extents
larger than the input data?  I'm about to give that a try but it
takes about three days for this job to run to completion, so I
figured I would ask if anyone has tried to do the same thing.

Thanks for any insight.

Martins
___
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


 ___
 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] OSG 2.8.1

2009-03-20 Thread Robert Osfield
2009/3/19 Andy Skinner andy.skin...@mathworks.com

  This seems to work, too.  I haven’t done what I’d call a thorough
 qualification, but I’m happy.


Thanks for the testing.  Next Monday I'll tag the 2.8.1-rc1 and do another
call for testing.  Hopefully be the end of next week we can roll 2.8.1 out
the door ;-)

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] DoomLike manipulator

2009-03-20 Thread Robert Osfield
Hi Loic,

Great little discussion :-)

2009/3/19 Simon Loic simon1l...@gmail.com

 Maybe when I will have finished to implement the GROUNDED/HORIZONTAL mode
 you can give it a try and decide which  name best fits. In my concern I
 clearly incline towars grounded as the implementation I was about to propose
 allows step over small obstacles like stairs.

 If you have remarks on the implementation so far, go ahead...

 to sukender :
 I didn't exacly get your remarks while I'm sure they are founded. Anyway I
 think that when I wil have finished to code both mode, things will become
 clearer for me and for you.

 Get you informed as soon as the manipulator is ready.


When you ready just post the changes to either osg-submissions if it's ready
to merge, or to osg-users if you feel it still needs more discussion.

Cheers,
Robert,
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osg::Operation lags

2009-03-20 Thread Robert Osfield
HI Roman,

Is i the UpdateSensoeHMDOperation that is at fault?  Put your own timing
stats into your code and see how long this is tacking to run, my guess is
that it's cost will be rather sporadic - if this is the case then you need
to change the way you manage this code, such as by creating an
OperationThread that sits in the background and polls the device(s), and the
during the update thread it merges changes required.


Robert.

2009/3/20 Roman Grigoriev grigor...@gosniias.ru

  Hi Guys!

 I’d like to use osg::Operation to read sensor data to viewer orientation

 So I test simple operation but have strange results – lags in frame rate.

 I attach picture to demonstrate it

 My config osg 2.7.2 vista nvidia 8600m gt

 operationThread = new osg::OperationThread;

 osg::ref_ptrUpdateSensorHMDOperation updateOperation;

 updateOperation = new UpdateSensorHMDOperation();

 operationThread-add(updateOperation.get());

 operationThread-startThread();

 viewer-addUpdateOperation(updateOperation.get());

 class UpdateSensorHMDOperation : public osg::Operation

 {

 public:



 UpdateSensorHMDOperation():

 Operation(UpdateTextOperation, true),

_load(false),_valid1(false)

 {

  osg::notify(osg::NOTICE)load update operationstd::endl;

 }



 virtual void operator () (osg::Object* callingObject)

 {

 osg::notify(osg::NOTICE)updatestd::endl;

   }

virtual void release()

{



}



   bool   _load;

   bool   _valid1;



 };

 ___
 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] OpenCL: democracy for GPU computing?

2009-03-20 Thread Paul Melis

Martin Beckett wrote:
Following OpenGL3 I'm not holding my breath for a standard developed by Khronos. 
  
It was actually developed by Apple, who submitted it to the Khronos 
Group (although they probably fiddled with the original spec, of course).

The bit about OpenCL not just being for GPUs but also for CPUs and Cell worries 
me - it sounds like a 'grand plan' - it supports manufacturers extentions so if 
you have an OpenCL app that needs Nvidia extentions why not just use Cuda?
Finally are there any real competitors to Nvidia in this space? Are you about 
to run heavy weight physics simualtions on an embedded Intel chipset?
  
Would you rather be forced to always use NVidia's stuff through Cuda 
than possibly have the option of using a different backend through OpenCL?
Only time will tell if there are going to be serious competitors, of 
course...


Paul
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OpenCL: democracy for GPU computing?

2009-03-20 Thread Robert Osfield
On Fri, Mar 20, 2009 at 4:57 AM, Martin Beckett m...@mgbeckett.com wrote:

 Following OpenGL3 I'm not holding my breath for a standard developed by
 Khronos.
 The bit about OpenCL not just being for GPUs but also for CPUs and Cell
 worries me - it sounds like a 'grand plan' - it supports manufacturers
 extentions so if you have an OpenCL app that needs Nvidia extentions why not
 just use Cuda?
 Finally are there any real competitors to Nvidia in this space? Are you
 about to run heavy weight physics simualtions on an embedded Intel chipset?


We'll have to see what happens with ATI's and Intel's OpenCL
implementation.  Supporting extensions/some code specifics is far better
than doing work having to do everything in completely proprietary API's as
more of your work will be reusable.

The OSG itself uses lots of OpenGL extensions but it hasn't become a great
problem for maintenance or development - the OSG still supports OpenGL 1.1
hardware as it does OpenGL 2.1 + extensions hardware.  This does suggest
that it won't be a show stopper that OpenCL has extensions and that we might
need to use them occassionally to get best out of particular hardware
platform.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] switch between two camera

2009-03-20 Thread Robert Osfield
HI Ben,

On Fri, Mar 20, 2009 at 9:48 AM, Ben ben.poul...@gmail.com wrote:

 Hi,
 if I have understood , I must design my application with a CompositeViewer
 in order to use two scene, each in it's own view.
 I have a 3D classic view and a map vue.
 How can I display only one at once using compositeviewer? (I don't see how
 to use nodemask)


The natural way to manage a application that was two views on to two
different scenes is to use a osgViewer::View for each separate scene, and
then a osgViewer::CompositeViewer to manage these two scenes.  These two
views can share the same GraphicsWindow, or have their own.  They may even
be added/removed from the CompositeViewer, or have their rendering toggled
on/off via NodeMask's on the master Camera for each View.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] switch between two camera

2009-03-20 Thread Lingyun Yu
Hi, Ben,

I use something like

camera0-setNodeMask(0X);
camera1-setNodeMask(0);

to enable camera0 but disable camera1.

I hope it helps.

Yun

On Fri, Mar 20, 2009 at 10:48 AM, Ben ben.poul...@gmail.com wrote:

 Hi,
 if I have understood , I must design my application with a CompositeViewer
 in order to use two scene, each in it's own view.
 I have a 3D classic view and a map vue.
 How can I display only one at once using compositeviewer? (I don't see how
 to use nodemask)

 thank's

 ps: sorry to post beginners questions . [Rolling Eyes]

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=8833#8833





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




-- 
Cheers,
Yun
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osg::Operation lags

2009-03-20 Thread Robert Osfield
HI Roman,

2009/3/20 Roman Grigoriev grigor...@gosniias.ru

  Hi Robert!

 As you’ve seen in my operation thread  I simply write to stdout simple
 message: update and nothing more.

 But framerate lags unpredictable.

 Maybe there is good example or readme how to use operationthread

 Thanx in advance


I have never seen problems like yours when using OperationThread/Operatons,
but on a second review I see that your OpenThread never sleeps, it just
churns away as effectively a spin lock on the CPU. If your machine doesn't
have sufficient cores to handle a thead using 100% of the CPU core then
you'll get frame stalls like you have.

Try sticking a OpenThreads::Thread::YieldCurrentThread() into your
operation.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] iterate node primitive set elements howto

2009-03-20 Thread paulo

Hi,
is there an obvious way to know which element a node is composed of 
(dots, lines, triangles, quads, polygons,) and iterate over them in a loop?


In an attempt to answer my question, I would say no.
Since a node can be 1 or more models of possibly different 
characteristics, I would probably need to pass a visitor, and search for 
all the geometry nodes.
Then for every one of those geometry nodes I can check the primitive set 
and iterate over its elements.


Can anyone shed some light over my clouded mind and free me of my doubts?

thanks
paulo
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] GraphicsContext problem

2009-03-20 Thread Lingyun Yu
Hi guys,

I want to use OpenGL to render the interface, but use OSG to render in a
region. And in this region I use OSG manipulator, but in the rest of the
interface I use others. I don't know if it is possible, if it is, how to do?

Thanks in advance.
-- 
Cheers,
Yun
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] FFmpeg plugin

2009-03-20 Thread Carlos Sanches
ok , now i m using svn version of ffmpeg.
bow the example runs but the message still apear

I put the the lines in main function of my program::

std::string libName =  osgDB::Registry::instance()-
createLibraryNameForExtension(ffmpeg);
osgDB::Registry::instance()-loadLibrary(libName);

but looks like that its using xine yet .
and the old error continues.


*** glibc detected *** ./OSG: free(): invalid pointer: 0x0b1f8fc7 ***
=== Backtrace: =
/lib/tls/i686/cmov/libc.so.6[0xb73e9a85]
/lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0xb73ed4f0]
/usr/local/lib/osgPlugins-2.9.1/osgdb_xine.so[0xb7f7c823]
/usr/lib/libxine.so.1[0xb58484d8]
=== Memory map: 

Why my ffmpeg is not in use ?
I have to modify something in osgDB ?







2009/3/20 Robert Osfield robert.osfi...@gmail.com

 HI Carlos,

 Our plugin doesn't contain any inflateInit_ or inflate method of any kind,
 so the missing sybmol must be coming from ffmpeg itself.  I haven't see this
 error myself when building from various versions of ffmpeg so perhaps it's
 version 0.5 that has gone astray.

 Have a look in ffmpeg itself for the inflateInit_ method.  Another thing
 you could try is using the svn version of ffmpeg, or the ffmpeg libs pulled
 down from the Ubuntu repositories.

 Robert.


 2009/3/19 Carlos Sanches ces...@gmail.com

 Ok , I did it .
 now I m trying to run de example:
  osgmovie -e ffmpeg

 this error occours

 Warning: dynamic library '/usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so'
 exists, but an error occurred while trying to open it:
 /usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so: undefined symbol:
 inflateInit_
 Usage: ./osgmovie [options] filename ...
 Options:
 ...





 2009/3/19 Adrian Egli OpenSceneGraph (3D) 3dh...@gmail.com

 I am working with windows, no problem there, but here my settings.
 Variable Name: FFMPEG_LIBAVCODEC_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVCODEC
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVCODEC_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avcodec-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVDEVICE_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVDEVICE
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVDEVICE_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avdevice-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVFORMAT_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVFORMAT
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVFORMAT_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avformat-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVUTIL_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVUTIL
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVUTIL_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avutil-49.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBSWSCALE_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/libswscale
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBSWSCALE_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/swscale-0.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_ROOT
 Description: Location of FFMPEG
 Current Value: F:/dev/ffmpeg/SDK/include
 New Value (Enter to keep current value):


 2009/3/19 Carlos Sanches ces...@gmail.com

 Hi Adrian !
 ok, I have the ffmpeg installed . I use it to convert my movies.
 Now I m seeing in ccmake configure list . but have some options that I
 dont know what I have to put there.
 the options are :

 FFMPEG_LIBAVCODEC_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBAVCODEC_LIBRARIES
 /usr/lib/libavcodec.so

  FFMPEG_LIBAVDEVICE_INCLUDE_DIR
 FFMPEG_LIBAVDEVICE_INCLUDE_DIRS-NOTFOUND

  FFMPEG_LIBAVDEVICE_LIBRARIES
 FFMPEG_LIBAVDEVICE_LIBRARIES-NOTFOUND

  FFMPEG_LIBAVFORMAT_INCLUDE_DIR
 /usr/include

  FFMPEG_LIBAVFORMAT_LIBRARIES
 /usr/lib/libavformat.so

  FFMPEG_LIBAVUTIL_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBAVUTIL_LIBRARIES
 /usr/lib/libavutil.so

  FFMPEG_LIBSWSCALE_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBSWSCALE_LIBRARIES
 /usr/lib/libswscale.so

  FFMPEG_ROOT


 The options that I believe that must be wrong are:
 FFMPEG_LIBAVDEVICE_INCLUDE_DIR
  FFMPEG_LIBAVDEVICE_LIBRARIES
  FFMPEG_ROOT

 What I have to do in these options ?
 tks








 2009/3/19 Adrian Egli OpenSceneGraph (3D) 3dh...@gmail.com

 Hi Carlos
 You have to donwload ffmpeg and build the plugin by setting up the
 right parameters in cmake. then osg will build the ffmpeg plugin as well 
 as
 the other 3rd party plugins will be build.

 adrian

 2009/3/18 

Re: [osg-users] osg::Operation lags

2009-03-20 Thread Roman Grigoriev
Thanx Robert!

Working with threads a little bit unfamiliar to me. 

Could you please point me to some examples how to use  YieldCurrentThread()

Thanx in advance

Bye

 

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: Friday, March 20, 2009 1:44 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osg::Operation lags

 

HI Roman,

2009/3/20 Roman Grigoriev grigor...@gosniias.ru

Hi Robert!

As you've seen in my operation thread  I simply write to stdout simple
message: update and nothing more.

But framerate lags unpredictable.

Maybe there is good example or readme how to use operationthread

Thanx in advance


I have never seen problems like yours when using OperationThread/Operatons,
but on a second review I see that your OpenThread never sleeps, it just
churns away as effectively a spin lock on the CPU. If your machine doesn't
have sufficient cores to handle a thead using 100% of the CPU core then
you'll get frame stalls like you have.

Try sticking a OpenThreads::Thread::YieldCurrentThread() into your
operation.

Robert.

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgFX nodes with shaders with variables

2009-03-20 Thread paulo

Hi,
I have a osgFX that needs to apply two pass technique.
On the second pass I need to apply one or more shaders one or more 
times. (controlled by the user parameters)


I looked at the osgFX::Scribe which covers the osgFX creation.
For the shaders I looked at the code from osgshaders.

Now my problem is that a simple callback to set the Uniform will not be 
enough for what I need.
I need to control what shaders are enabling/disable, how many times each 
is applied for a pass and I need to be able to change the Uniforms for 
each of those applications.


Any ideas how to do this with osg?
I'm sure it's not complicated, but I'm kind of new to this.

Thank you
paulo
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] FFmpeg plugin

2009-03-20 Thread Tanguy Fautre
Hi guys,

inflateInit_ sounds very much like an API entry point in zlib.


Tanguy



From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Friday 20 March 2009 08:55
To: OpenSceneGraph Users
Subject: Re: [osg-users] FFmpeg plugin

HI Carlos,

Our plugin doesn't contain any inflateInit_ or inflate method of any kind, so 
the missing sybmol must be coming from ffmpeg itself.  I haven't see this error 
myself when building from various versions of ffmpeg so perhaps it's version 
0.5 that has gone astray.

Have a look in ffmpeg itself for the inflateInit_ method.  Another thing you 
could try is using the svn version of ffmpeg, or the ffmpeg libs pulled down 
from the Ubuntu repositories.

Robert.


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] FFmpeg plugin

2009-03-20 Thread Carlos Sanches
yeah

here *
http://refspecs.freestandards.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/zlib-inflateinit.html
*






On Fri, Mar 20, 2009 at 9:47 AM, Tanguy Fautre tang...@aristechnologies.com
 wrote:

 Hi guys,

 inflateInit_ sounds very much like an API entry point in zlib.


 Tanguy



 From: osg-users-boun...@lists.openscenegraph.org [mailto:
 osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
 Sent: Friday 20 March 2009 08:55
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] FFmpeg plugin

 HI Carlos,

 Our plugin doesn't contain any inflateInit_ or inflate method of any kind,
 so the missing sybmol must be coming from ffmpeg itself.  I haven't see this
 error myself when building from various versions of ffmpeg so perhaps it's
 version 0.5 that has gone astray.

 Have a look in ffmpeg itself for the inflateInit_ method.  Another thing
 you could try is using the svn version of ffmpeg, or the ffmpeg libs pulled
 down from the Ubuntu repositories.

 Robert.


 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




-- 
   Carlos Sanches
Programação Gráfica;

Tel:  55 11 3816 2888
Cel: 55 11 9650 7137

  Somar Meteorologia
www.somarmeteorologia.com.br
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osg::Operation lags

2009-03-20 Thread Roman Grigoriev
Thanx Robert!

I works fine

Here is my class if it will be useful for someone.

 

lass UpdateMissileOperation : public osg::Operation

{

public:

 

UpdateMissileOperation():

Operation(UpdateMissileOperation, true)

{

 

}



virtual void operator () (osg::Object* callingObject)

{

  osgViewer::Viewer* viewer =
dynamic_castosgViewer::Viewer*(callingObject);

 double t;

if (viewer)

t = viewer-getFrameStamp()-getSimulationTime();

_dt=t-_time;

if ((_dt=0.02)) 

{

  //printf(%f\n,_dt);

  update();

  _time=t;

}

else

{

OpenThreads::Thread::YieldCurrentThread();

}

  }

  void update()

  {   

//printf(%f\n,_time);

  }

   virtual void release()

   {

   }

   bool  _load;

  bool   _valid1;

  float _time;

  float _dt;

};

 

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Roman
Grigoriev
Sent: Friday, March 20, 2009 3:42 PM
To: 'OpenSceneGraph Users'
Subject: Re: [osg-users] osg::Operation lags

 

Thanx Robert!

Working with threads a little bit unfamiliar to me. 

Could you please point me to some examples how to use  YieldCurrentThread()

Thanx in advance

Bye

 

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: Friday, March 20, 2009 1:44 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osg::Operation lags

 

HI Roman,

2009/3/20 Roman Grigoriev grigor...@gosniias.ru

Hi Robert!

As you've seen in my operation thread  I simply write to stdout simple
message: update and nothing more.

But framerate lags unpredictable.

Maybe there is good example or readme how to use operationthread

Thanx in advance


I have never seen problems like yours when using OperationThread/Operatons,
but on a second review I see that your OpenThread never sleeps, it just
churns away as effectively a spin lock on the CPU. If your machine doesn't
have sufficient cores to handle a thead using 100% of the CPU core then
you'll get frame stalls like you have.

Try sticking a OpenThreads::Thread::YieldCurrentThread() into your
operation.

Robert.

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osg::Operation lags

2009-03-20 Thread Paul Melis

Hi Robert,

Robert Osfield wrote:
I have never seen problems like yours when using 
OperationThread/Operatons, but on a second review I see that your 
OpenThread never sleeps, it just churns away as effectively a spin 
lock on the CPU. If your machine doesn't have sufficient cores to 
handle a thead using 100% of the CPU core then you'll get frame stalls 
like you have.
More general, is what follows a good summary of how to use an 
osg::Operation (looking at the osgtext example for reference)? You 
subclass it and implement your action in the call operator. Then you add 
an instance of the operation class to a separate thread (starting it so 
it calls the operation in the background), plus you add the same 
instance to a osgViewer::Viewer instance. The only argument to the call 
operator is used to distinguish who makes a call on the operation and 
therefore what action you need to take. Is that a good summary?


Ignoring having to call yield once in a while, is the below test roughly 
the way to do it (I used the osgtext example as a second source)? Is the 
mutex in the call operator necessary?


Doh, lots of question marks above :)
Paul

// g++ -g -o op operation.cpp -I ~/osg2.8/include/ -L ~/osg2.8/lib/ 
-losg -losgDB -losgViewer

#include cstdio
#include osg/OperationThread
#include osgViewer/Viewer
#include osgDB/ReadFile

class UpdateOperation : public osg::Operation
{
public:
   UpdateOperation():
   Operation(UpdateOperation, true)
   {
   }

   virtual void operator() (osg::Object* callingObject)
   {
   OpenThreads::ScopedLockOpenThreads::Mutex lock(_mutex);
   printf(operator(): obj = 0x%08x\n, callingObject);
   }

   virtual void release()
   {
   printf(release()\n);
   }

protected:
   OpenThreads::Mutex  _mutex;
};

int
main()
{
   osg::ref_ptrUpdateOperation updateOperation = new UpdateOperation();

   osgViewer::Viewer viewer;

   osg::ref_ptrosg::OperationThread operationThread = new 
osg::OperationThread;

   operationThread-add(updateOperation.get());
   operationThread-startThread();

   viewer.addUpdateOperation(updateOperation.get());

   viewer.setSceneData(osgDB::readNodeFile(cow.osg));

   viewer.run();
}



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgFX nodes with shaders with variables

2009-03-20 Thread paulo
Well, from reading Technique.cpp I'm able to guess that I have to re-implement 
the traverse traverse method. 

The best idea seems to be just copy paste the 
Technique::traverse_implementation and for each pass implement a specific 
behavior.

For what I want, apply the same shader(s) several times, first each shader 
should be associated with a specific pass/state set. Then loop around the 
traverse of the Technique's children.

I think that here I can freely modify the shaders parameters, but I'm not sure.

Another problem is that I don't know for which kind of visitor I should do 
this. (Or even if this is the right way to do it - as there's no doc)

Someone? [Question]

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=8847#8847





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] FFmpeg plugin

2009-03-20 Thread Robert Osfield
Hi Carlos,

What happens when you run:

   osgmovie -e ffmpeg a_video.mpg

Is it still reporting that it can't load the plugin?

I suspect that you are still hitting against the plugin not loading
correctly.  The inflatInit method is still being reported as not found and
this function is from zlib then ffmpeg is built without linking against zlib
which is needs.  Linking against zlib ourselves in our ffmpeg could a
solution.

It's odd that you're having problems wheras others aren't.  What is the
exact spec of your system?

Robert.

2009/3/20 Carlos Sanches ces...@gmail.com

 ok , now i m using svn version of ffmpeg.
 bow the example runs but the message still apear

 I put the the lines in main function of my program::

 std::string libName =  
 osgDB::Registry::instance()-createLibraryNameForExtension(ffmpeg);
 osgDB::Registry::instance()-loadLibrary(libName);

 but looks like that its using xine yet .
 and the old error continues.


 *** glibc detected *** ./OSG: free(): invalid pointer: 0x0b1f8fc7 ***
 === Backtrace: =
 /lib/tls/i686/cmov/libc.so.6[0xb73e9a85]
 /lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0xb73ed4f0]
 /usr/local/lib/osgPlugins-2.9.1/osgdb_xine.so[0xb7f7c823]
 /usr/lib/libxine.so.1[0xb58484d8]
 === Memory map: 

 Why my ffmpeg is not in use ?
 I have to modify something in osgDB ?







 2009/3/20 Robert Osfield robert.osfi...@gmail.com

 HI Carlos,

 Our plugin doesn't contain any inflateInit_ or inflate method of any kind,
 so the missing sybmol must be coming from ffmpeg itself.  I haven't see this
 error myself when building from various versions of ffmpeg so perhaps it's
 version 0.5 that has gone astray.

 Have a look in ffmpeg itself for the inflateInit_ method.  Another thing
 you could try is using the svn version of ffmpeg, or the ffmpeg libs pulled
 down from the Ubuntu repositories.

 Robert.


 2009/3/19 Carlos Sanches ces...@gmail.com

 Ok , I did it .
 now I m trying to run de example:
  osgmovie -e ffmpeg

 this error occours

 Warning: dynamic library
 '/usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so' exists, but an error
 occurred while trying to open it:
 /usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so: undefined symbol:
 inflateInit_
 Usage: ./osgmovie [options] filename ...
 Options:
 ...





 2009/3/19 Adrian Egli OpenSceneGraph (3D) 3dh...@gmail.com

 I am working with windows, no problem there, but here my settings.
 Variable Name: FFMPEG_LIBAVCODEC_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVCODEC
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVCODEC_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avcodec-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVDEVICE_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVDEVICE
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVDEVICE_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avdevice-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVFORMAT_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVFORMAT
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVFORMAT_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avformat-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVUTIL_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVUTIL
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVUTIL_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avutil-49.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBSWSCALE_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/libswscale
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBSWSCALE_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/swscale-0.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_ROOT
 Description: Location of FFMPEG
 Current Value: F:/dev/ffmpeg/SDK/include
 New Value (Enter to keep current value):


 2009/3/19 Carlos Sanches ces...@gmail.com

 Hi Adrian !
 ok, I have the ffmpeg installed . I use it to convert my movies.
 Now I m seeing in ccmake configure list . but have some options that I
 dont know what I have to put there.
 the options are :

 FFMPEG_LIBAVCODEC_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBAVCODEC_LIBRARIES
 /usr/lib/libavcodec.so

  FFMPEG_LIBAVDEVICE_INCLUDE_DIR
 FFMPEG_LIBAVDEVICE_INCLUDE_DIRS-NOTFOUND

  FFMPEG_LIBAVDEVICE_LIBRARIES
 FFMPEG_LIBAVDEVICE_LIBRARIES-NOTFOUND

  FFMPEG_LIBAVFORMAT_INCLUDE_DIR
 /usr/include

  FFMPEG_LIBAVFORMAT_LIBRARIES
 /usr/lib/libavformat.so

  FFMPEG_LIBAVUTIL_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBAVUTIL_LIBRARIES
 

Re: [osg-users] osg::Operation lags

2009-03-20 Thread Robert Osfield
Hi Roman,

You really need to learn how to investigate stuff on your own, I can provide
pointers of but it's down to you do learn stuff and to code stuff, you can't
expect others to walk you through it.   In the case of YieldCurrentThead
it's a single line of code that Yields the Current Thread, so I can't see
what more needs explaining, there are plenty of examples of it in the core
OSG - just do a grep through the sources.

Robert.

2009/3/20 Roman Grigoriev grigor...@gosniias.ru

  Thanx Robert!

 Working with threads a little bit unfamiliar to me.

 Could you please point me to some examples how to use
 YieldCurrentThread()

 Thanx in advance

 Bye



 *From:* osg-users-boun...@lists.openscenegraph.org [mailto:
 osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Robert Osfield
 *Sent:* Friday, March 20, 2009 1:44 PM
 *To:* OpenSceneGraph Users
 *Subject:* Re: [osg-users] osg::Operation lags



 HI Roman,

 2009/3/20 Roman Grigoriev grigor...@gosniias.ru

 Hi Robert!

 As you’ve seen in my operation thread  I simply write to stdout simple
 message: update and nothing more.

 But framerate lags unpredictable.

 Maybe there is good example or readme how to use operationthread

 Thanx in advance


 I have never seen problems like yours when using OperationThread/Operatons,
 but on a second review I see that your OpenThread never sleeps, it just
 churns away as effectively a spin lock on the CPU. If your machine doesn't
 have sufficient cores to handle a thead using 100% of the CPU core then
 you'll get frame stalls like you have.

 Try sticking a OpenThreads::Thread::YieldCurrentThread() into your
 operation.

 Robert.

 ___
 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] Animating vertices in a Geode

2009-03-20 Thread Laurence Muller

Hi,

In the application I am working on, I am trying to create a smooth 
(transition) animation on the vertices inside an object.


Example:
I have included an illustration to make my problem a bit more clear. The 
current scene contains one geode with a geometry attached.
The geometry is filled with 7 quads (4 vertices per quad) and is 
illustrated as red dots in the picture. (The 'edges' are stored in a 
separate geode)


The application allows users to select a specific layout (radial, force 
based, etc) for the quads. In the current implementation this change 
happens immediately.
(It updates the vertex array with new values and uses the dirty() call 
on the vertex array).


On the OSG wiki page I found some information about animating objects in 
the scene graph.

http://www.openscenegraph.org/projects/osg/wiki/Community/NodeKits/osgAnimation
http://www.robertpenner.com/easing/easing_demo.html

However, it seems like this will only work on geode level (by modifying 
the Matrix or PositionAttitudeTransformation).
Another problem with this method is that it seems that you need to 
create a predefined animation.


In my case the new position of a vertex will depend on the current 
position (and the animation only needs to be used once).


Question:
- Is there a way to use the osgAnimation functions on the vertex array 
and is it possible to use it with the transition methods from the 
EaseMotion demo?


Kind regards,
- Laurence

--
Laurence Muller
Website/Blog/Portfolio:
http://www.multigesture.net/

inline: vertex_animation.png___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osg::Operation lags

2009-03-20 Thread Roman Grigoriev
Hi Robert!

Sorry to disturb you with my simple question

A lot of things to do in a short period time.

Thanx again 

Bye

 

 

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: Friday, March 20, 2009 4:34 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osg::Operation lags

 

Hi Roman,

You really need to learn how to investigate stuff on your own, I can provide
pointers of but it's down to you do learn stuff and to code stuff, you can't
expect others to walk you through it.   In the case of YieldCurrentThead
it's a single line of code that Yields the Current Thread, so I can't see
what more needs explaining, there are plenty of examples of it in the core
OSG - just do a grep through the sources.

Robert.

2009/3/20 Roman Grigoriev grigor...@gosniias.ru

Thanx Robert!

Working with threads a little bit unfamiliar to me. 

Could you please point me to some examples how to use  YieldCurrentThread()

Thanx in advance

Bye

 

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: Friday, March 20, 2009 1:44 PM


To: OpenSceneGraph Users
Subject: Re: [osg-users] osg::Operation lags

 

HI Roman,

2009/3/20 Roman Grigoriev grigor...@gosniias.ru

Hi Robert!

As you've seen in my operation thread  I simply write to stdout simple
message: update and nothing more.

But framerate lags unpredictable.

Maybe there is good example or readme how to use operationthread

Thanx in advance


I have never seen problems like yours when using OperationThread/Operatons,
but on a second review I see that your OpenThread never sleeps, it just
churns away as effectively a spin lock on the CPU. If your machine doesn't
have sufficient cores to handle a thead using 100% of the CPU core then
you'll get frame stalls like you have.

Try sticking a OpenThreads::Thread::YieldCurrentThread() into your
operation.

Robert.


___
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] compile error in osgwrapper_osgUtil PrintVisitor

2009-03-20 Thread Csaba Halász
Hi Robert!

Another user reported this, but my nightly build also exhibits the same problem.
Details here: http://www.cdash.org/CDashPublic/viewBuildError.php?buildid=14829
As we don't really need wrappers, this is just for your information in
case you missed it.

-- 
Csaba
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] switch between two camera

2009-03-20 Thread Ben
I try to use nodemask but doesn't work.
Id do this : 
Code:

osgViewer::CompositeViewer viewer;
osgViewer::GraphicsWindowEmbedded* gw = new osgViewer::GraphicsWindowEmbedded;

osgViewer::View* vue2D = new osgViewer::View;
osgViewer::View* vue3D = new osgViewer::View;
viewer.addView(vue2D);
viewer.addView(vue3D);

vue2D-getCamera()-setGraphicsContext(gw );
vue2D-getCamera()-setProjectionMatrixAsPerspective(30.0f, width()/(double) 
height(), 1.0, 1000.0);
vue2D-getCamera()-setViewport(new osg::Viewport(0,0,width(),height() ));
vue2D-setCameraManipulator(new osgGA::TrackballManipulator);


vue3D-getCamera()-setGraphicsContext(gw );
vue3D-getCamera()-setProjectionMatrixAsPerspective(30.0f, width()/(double) 
height(), 1.0, 1000.0);
vue3D-getCamera()-setViewport(new osg::Viewport(0,0,width(),height() ));
vue3D-setCameraManipulator(new osgGA::TrackballManipulator);



Code:

// to switch vue3D OFF and vue2D on
vue2D-getCamera()-setNodeMask(0X);
vue3D-getCamera()-setNodeMask(0);




--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=8852#8852





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Multithreadingcrash due toosgDb::Registry::instance()

2009-03-20 Thread Paul Speed
I remember the first time I heard about the double-checked locking 
problem five years ago or more and then wasting an afternoon trying to 
understand what the heck was going on.  I was never the same again.


I sometimes long for those halcyon days when the universe was a simpler 
place. :)


-Paul

J.P. Delport wrote:

Hi all,

for those interested in instruction order issues, these videos might be 
interesting (search google video):


* Herb Sutter - Machine Architecture: Things Your Programming Language 
Never Told You


* IA Memory Ordering

There is quite a bit of work going into the next C++ standard to address 
some of these issues. Sutter  others have written a lot about it in the 
last few months, a search should send you down the rabbit hole.


cheers
jp

I-Nixon, Anthony D wrote:

Thanks for the pointer Paul.  The points you raise do apply to C++ as
well, and it seems the consensus is that it is not possible to implement
the double-checked locking pattern in portable C++ safely.

See Scott Meyer's and Andrei Alexandrescu's paper here
http://www.aristeia.com/Papers/DDJ_Jul_Aug_2004_revised.pdf 
If Scott Meyer's says it can't be done, I tend to believe him :-)



From Scott's paper:


In many cases, initializing a singleton resource during single-threaded
program startup
(e.g., prior to executing main) is the simplest way to offer fast,
thread-safe
singleton access.

So the best thing to do is to advertise in large bold letters somewhere
in the doco (and FAQ) that if you are going to use multithreading, all
instances need to be accessed before threading starts.

Anthony


-Original Message-
From: Paul Speed [mailto:psp...@progeeks.com] Sent: Friday, 20 March 
2009 2:21 AM

To: OpenSceneGraph Users
Subject: Re: [osg-users] Multithreadingcrash due 
toosgDb::Registry::instance()


Just a note for those of us who have been bitten by double check 
locking issues in Java, this technique is highly dependent on the 
threading and data architecture in use.  There are subtle issues 
between when a thread commits its local state and the possibility for 
the compiler to reorder statements.  This was less of an issue on 
single-core boxes but comes up in multi-core where the local thread 
state may not be committed.  I can't be sure but there may have also 
been some subtle statement reordering issues with respect to the 
compiler not knowing that your guard release _must_ be run after the 
instance_ = new Singleton has _fully_ executed.


I don't know if these problems crop up in C++ but it certainly seems 
like they could depending on the threading implementation and 
compiler optimization strategy.


Worst case for a singleton pattern is that you might get a race 
condition where two instances are created.  There are other 
double-checked locking situations that are much more insidious.


-Paul

Paul Melis wrote:

Robert Osfield wrote:
2009/3/17 Schmidt, Richard richard.schm...@eads.com 
mailto:richard.schm...@eads.com


http://www.cs.wustl.edu/~schmidt/PDF/DC-Locking.pdf
http://www.cs.wustl.edu/%7Eschmidt/PDF/DC-Locking.pdf


Could you explain what the above document is all about...
I just read it an it describes a pattern where you use a mutex to 
guard access to the singleton's _instance value, but in such a way 
that the mutex is only needed when _instance == NULL, i.e.


class Singleton
{
public:
   static Singleton *instance (void)
   {
// First check
if (instance_ == 0)
   {
  // Ensure serialization (guard constructor 

acquires lock_).

 GuardMutex guard (lock_);
 // Double check.
 if (instance_ == 0)
  instance_ = new Singleton;
   }
return instance_;
// guard destructor releases lock_.
   }
private:
   static Mutex lock_;
   static Singleton *instance_;
};

This should give you thread-safe access to Singleton-instance() at 
all times combined with correct initialization.


Quite neat actually,
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-opensce

negraph.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] OSX Cmake/Xcode path problems under Debug

2009-03-20 Thread Eric Sokolowsky
When I build OSG (latest svn) with Xcode (generated by Cmake), I've
noticed some problems when compiling with the Debug configuration. I'm
trying to fix these, but if anybody has some clue how to force Cmake to
work better, please chime in.

1. I submitted a patch (not yet committed) that will use the
OSG_DEBUG_POSTFIX (by default: d) when loading plugins, but this
depends on _DEBUG being defined at compile time. However, _DEBUG is not
being defined. Thus, plugins are not being loaded unless I put in a
symbolic link from the name OSG is expecting to the name it is actually
given.

2. Under my build directory (I am doing out of source builds), the
libraries are built in the directory: build/lib/Debug, and the plugins
are built in the directory: build/lib/osgPlugins-2.9.1/Debug. This
causes problems when testing (without installing) because osg doesn't
try to to add the intermediate Debug directory. It would be really nice
if the two paths above were build/lib/Debug and
build/lib/Debug/osgPlugins-2.9.1. Anyone know how to get cmake to do this?

-Eric
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] transforming normals

2009-03-20 Thread Can Hosgor
Hi,

I'm writing a simple nodevisitor to compute the lightmap of a given node. This 
nodevisitor treats transforms and geodes specially, so that each vertex in the 
geometry is multiplied with the most recent transform matrix in order to obtain 
world coordinates. So far the above code works well except that i don't know 
how to transform the normals. Can I obtain the normal matrix directly from the 
transformation matrix, if so how?

Thank you,
Can

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=8857#8857





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] transforming normals

2009-03-20 Thread Paul Melis

Paul Melis wrote:

Can Hosgor wrote:
I'm writing a simple nodevisitor to compute the lightmap of a given 
node. This nodevisitor treats transforms and geodes specially, so 
that each vertex in the geometry is multiplied with the most recent 
transform matrix in order to obtain world coordinates. So far the 
above code works well except that i don't know how to transform the 
normals. Can I obtain the normal matrix directly from the 
transformation matrix, if so how?   
If M is your transformation matrix then (M^-1)^T transforms your 
normals (that's the transposed inverse of M).
You might have to rescale your normals so they become unit length again, 
after using the above matrix


Paul
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] FFmpeg plugin

2009-03-20 Thread Carlos Sanches
:(
ok.
I downloaded,  compiled and instaled zlib-1.2.3
built ffmpeg from svn again with new zlib installed
in osg i changed the directories of zlib to the new zlib in ccmake
cmakelist.txt
in OpenSceneGraph-2.9.1 directory:
./configure
make clean
make

the example was built again but .
running example with ./osgmovie -e ffmpeg video.avi   or .mpg
the movie runs but the same error apears.

Warning: dynamic library '/usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so'
exists, but an error occurred while trying to open it:
/usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so: undefined symbol:
inflateInit_
image-s()640 image-t()=480 aspectRatio=1
Transparent movie, enabling blending.

My sistem is Ubuntu 8.04
videocard  nvidia 8800 gtx
motherboard P5N-T DELUXE
Intel(R) Core(TM)2 Quad CPUQ6600  @ 2.40GHz

say me if you need more information .
i realy need to play movies with ffmpeg.

tks














2009/3/20 Robert Osfield robert.osfi...@gmail.com

 Hi Carlos,

 What happens when you run:

osgmovie -e ffmpeg a_video.mpg

 Is it still reporting that it can't load the plugin?

 I suspect that you are still hitting against the plugin not loading
 correctly.  The inflatInit method is still being reported as not found and
 this function is from zlib then ffmpeg is built without linking against zlib
 which is needs.  Linking against zlib ourselves in our ffmpeg could a
 solution.

 It's odd that you're having problems wheras others aren't.  What is the
 exact spec of your system?

 Robert.

 2009/3/20 Carlos Sanches ces...@gmail.com

 ok , now i m using svn version of ffmpeg.
 bow the example runs but the message still apear

 I put the the lines in main function of my program::

 std::string libName =  
 osgDB::Registry::instance()-createLibraryNameForExtension(ffmpeg);
 osgDB::Registry::instance()-loadLibrary(libName);

 but looks like that its using xine yet .
 and the old error continues.


 *** glibc detected *** ./OSG: free(): invalid pointer: 0x0b1f8fc7 ***
 === Backtrace: =
 /lib/tls/i686/cmov/libc.so.6[0xb73e9a85]
 /lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0xb73ed4f0]
 /usr/local/lib/osgPlugins-2.9.1/osgdb_xine.so[0xb7f7c823]
 /usr/lib/libxine.so.1[0xb58484d8]
 === Memory map: 

 Why my ffmpeg is not in use ?
 I have to modify something in osgDB ?







 2009/3/20 Robert Osfield robert.osfi...@gmail.com

 HI Carlos,

 Our plugin doesn't contain any inflateInit_ or inflate method of any
 kind, so the missing sybmol must be coming from ffmpeg itself.  I haven't
 see this error myself when building from various versions of ffmpeg so
 perhaps it's version 0.5 that has gone astray.

 Have a look in ffmpeg itself for the inflateInit_ method.  Another thing
 you could try is using the svn version of ffmpeg, or the ffmpeg libs pulled
 down from the Ubuntu repositories.

 Robert.


 2009/3/19 Carlos Sanches ces...@gmail.com

 Ok , I did it .
 now I m trying to run de example:
  osgmovie -e ffmpeg

 this error occours

 Warning: dynamic library
 '/usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so' exists, but an error
 occurred while trying to open it:
 /usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so: undefined symbol:
 inflateInit_
 Usage: ./osgmovie [options] filename ...
 Options:
 ...





 2009/3/19 Adrian Egli OpenSceneGraph (3D) 3dh...@gmail.com

 I am working with windows, no problem there, but here my settings.
 Variable Name: FFMPEG_LIBAVCODEC_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVCODEC
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVCODEC_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avcodec-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVDEVICE_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVDEVICE
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVDEVICE_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avdevice-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVFORMAT_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVFORMAT
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVFORMAT_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avformat-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVUTIL_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVUTIL
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVUTIL_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avutil-49.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBSWSCALE_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/libswscale
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBSWSCALE_LIBRARIES
 

Re: [osg-users] transforming normals

2009-03-20 Thread Paul Melis

Can Hosgor wrote:
I'm writing a simple nodevisitor to compute the lightmap of a given node. This nodevisitor treats transforms and geodes specially, so that each vertex in the geometry is multiplied with the most recent transform matrix in order to obtain world coordinates. So far the above code works well except that i don't know how to transform the normals. Can I obtain the normal matrix directly from the transformation matrix, if so how? 
  
If M is your transformation matrix then (M^-1)^T transforms your normals 
(that's the transposed inverse of M).


Paul
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] switch between two camera

2009-03-20 Thread Lingyun Yu
Hi ben,

where did you put your code? I put them in the updatecallback function,
that's why mine will change every frame.

Yun

2009/3/20 Ben ben.poul...@gmail.com


 benbao wrote:
  I try to use nodemask but doesn't work.
  Id do this :
  Code:
 
  osgViewer::CompositeViewer viewer;
  osgViewer::GraphicsWindowEmbedded* gw = new
 osgViewer::GraphicsWindowEmbedded;
 
  osgViewer::View* vue2D = new osgViewer::View;
  osgViewer::View* vue3D = new osgViewer::View;
  viewer.addView(vue2D);
  viewer.addView(vue3D);
 
  vue2D-getCamera()-setGraphicsContext(gw );
  vue2D-getCamera()-setProjectionMatrixAsPerspective(30.0f,
 width()/(double) height(), 1.0, 1000.0);
  vue2D-getCamera()-setViewport(new osg::Viewport(0,0,width(),height()
 ));
  vue2D-setCameraManipulator(new osgGA::TrackballManipulator);
 
 
  vue3D-getCamera()-setGraphicsContext(gw );
  vue3D-getCamera()-setProjectionMatrixAsPerspective(30.0f,
 width()/(double) height(), 1.0, 1000.0);
  vue3D-getCamera()-setViewport(new osg::Viewport(0,0,width(),height()
 ));
  vue3D-setCameraManipulator(new osgGA::TrackballManipulator);
 
 
 
  Code:
 
  // to switch vue3D OFF and vue2D on
  vue2D-getCamera()-setNodeMask(0X);
  vue3D-getCamera()-setNodeMask(0);
 
 
 


 sorry it's work, but only the view on top is updated by mouse manipulator.

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=8854#8854





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




-- 
Cheers,
Yun
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OpenCL: democracy for GPU computing?

2009-03-20 Thread Martin Beckett
Yes I would much prefer a cross platform well supported API than be forced to 
buy NVidia (and have to tell my customers to).
But at the moment a lot of the OSG demos do not render properly on any other 
cards (at least on Windows) just because of the poor OpenGL drivers - so I'm 
not holding my breath for them to all correctly implement the OpenCL spec.

If GPGPU is going to become mainstream then we do need something like OpenCL 
(else DirectX will do it!). At the moment it doesn't matter - the application 
is generally so specialised that requiring a particular board isn't a problem.
But an industry wide spec for something which is technically complex and only 
used in niche areas needs a strong driving force behind it. OpenGL really took 
off because of SGI not a loose industry-wide steering group.

Still - you never know it might all work out :-)

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=8862#8862





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] ShadowMap Required OpenGL Extensions

2009-03-20 Thread Ben Axelrod
My application checks for the existence of some OpenGL extensions before 
allowing ShadowMap to be turned on.  So far, I have been using this test:

if (GL_EXT_framebuffer_object 
   (GL_ARB_fragment_program || GL_EXT_fragment_program) 
   (GL_ARB_fragment_program_shadow || GL_EXT_fragment_program_shadow))
{
  //enable ShadowMap
}

Note that I am using the 'fixed function fallback' by calling clearShaderList() 
after init() but before first frame.

However, I have come across a graphics card that passes this test, yet does not 
render shadows properly.

This graphics card has these key extensions:
GL_EXT_framebuffer_object
GL_ARB_fragment_program
GL_ARB_fragment_program_shadow
GL_ARB_fragment_shader

As far as I can tell, the only extensions this card does NOT have, that my 
other card (which renders shadows fine) does is:
GL_ARB_texture_non_power_of_two
GL_ATI_texture_mirror_once
GL_EXT_clip_volume_hint
GL_EXT_texture_mirror_clamp

Does ShadowMap require any of these extensions?

Also, FYI, the graphics card in question has many more extensions that my 
working card does not have:
GL_ARB_fragment_shader
GL_ARB_half_float_pixel
GL_ARB_multisample
GL_ARB_pixel_buffer_object
GL_ARB_shader_objects
GL_ARB_shading_language_100
GL_ARB_texture_rectangle
GL_ARB_transpose_matrix
GL_ARB_vertex_buffer_object
GL_ARB_vertex_shader
GL_S3_s3tc
GL_EXT_compiled_vertex_array
GL_EXT_Cg_shader
GL_EXT_framebuffer_blit
GL_EXT_framebuffer_multisample
GL_EXT_gpu_program_parameters
GL_EXT_packed_depth_stencil
GL_EXT_pixel_buffer_object
GL_EXT_point_parameters
GL_EXT_stencil_two_side
GL_EXT_texture_compression_s3tc
GL_EXT_texture_cube_map
GL_EXT_texture_filter_anisotropic
GL_EXT_texture_lod
GL_EXT_texture_sRGB
GL_EXT_timer_query
GL_IBM_rasterpos_clip
GL_KTX_buffer_region
GL_NV_copy_depth_to_color
GL_NV_depth_clamp
GL_NV_fence
GL_NV_float_buffer
GL_NV_fog_distance
GL_NV_fragment_program
GL_NV_fragment_program_option
GL_NV_framebuffer_multisample_coverage
GL_NV_half_float
GL_NV_multisample_filter_hint
GL_NV_occlusion_query
GL_NV_packed_depth_stencil
GL_NV_pixel_data_range
GL_NV_point_sprite
GL_NV_primitive_restart
GL_NV_register_combiners
GL_NV_register_combiners2
GL_NV_texture_compression_vtc
GL_NV_texture_env_combine4
GL_NV_texture_expand_normal
GL_NV_texture_shader
GL_NV_texture_shader2
GL_NV_texture_shader3
GL_NV_vertex_array_range
GL_NV_vertex_array_range2
GL_NV_vertex_program
GL_NV_vertex_program1_1
GL_NV_vertex_program2
GL_NV_vertex_program2_option
GL_SUN_slice_accum


Thanks,
-Ben
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] compile error in osgwrapper_osgUtil PrintVisitor

2009-03-20 Thread Robert Osfield
Hi Csaba,

Thanks for the note.  I'm now reproduce the build error at my end and
working on a fix.

Robert.

On Fri, Mar 20, 2009 at 2:47 PM, Csaba Halász csaba.hal...@gmail.comwrote:

 Hi Robert!

 Another user reported this, but my nightly build also exhibits the same
 problem.
 Details here:
 http://www.cdash.org/CDashPublic/viewBuildError.php?buildid=14829
 As we don't really need wrappers, this is just for your information in
 case you missed it.

 --
 Csaba
 ___
 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] FFmpeg plugin

2009-03-20 Thread Robert Osfield
HI Carlos,

As I don't see any of these problems, I'm afraid there isn't much I can do
apart from make suggestions for you to try out.  Right now it looks like
you'll need to add the zlib library into the build of other ffmpeg or our
plugin.

Robert.

2009/3/20 Carlos Sanches ces...@gmail.com

 :(
 ok.
 I downloaded,  compiled and instaled zlib-1.2.3
 built ffmpeg from svn again with new zlib installed
 in osg i changed the directories of zlib to the new zlib in ccmake
 cmakelist.txt
 in OpenSceneGraph-2.9.1 directory:
 ./configure
 make clean
 make

 the example was built again but .
 running example with ./osgmovie -e ffmpeg video.avi   or .mpg
 the movie runs but the same error apears.

 Warning: dynamic library '/usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so'
 exists, but an error occurred while trying to open it:
 /usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so: undefined symbol:
 inflateInit_
 image-s()640 image-t()=480 aspectRatio=1
 Transparent movie, enabling blending.

 My sistem is Ubuntu 8.04
 videocard  nvidia 8800 gtx
 motherboard P5N-T DELUXE
 Intel(R) Core(TM)2 Quad CPUQ6600  @ 2.40GHz

 say me if you need more information .
 i realy need to play movies with ffmpeg.

 tks















 2009/3/20 Robert Osfield robert.osfi...@gmail.com

 Hi Carlos,

 What happens when you run:

osgmovie -e ffmpeg a_video.mpg

 Is it still reporting that it can't load the plugin?

 I suspect that you are still hitting against the plugin not loading
 correctly.  The inflatInit method is still being reported as not found and
 this function is from zlib then ffmpeg is built without linking against zlib
 which is needs.  Linking against zlib ourselves in our ffmpeg could a
 solution.

 It's odd that you're having problems wheras others aren't.  What is the
 exact spec of your system?

 Robert.

 2009/3/20 Carlos Sanches ces...@gmail.com

 ok , now i m using svn version of ffmpeg.
 bow the example runs but the message still apear

 I put the the lines in main function of my program::

 std::string libName =  
 osgDB::Registry::instance()-createLibraryNameForExtension(ffmpeg);
 osgDB::Registry::instance()-loadLibrary(libName);

 but looks like that its using xine yet .
 and the old error continues.


 *** glibc detected *** ./OSG: free(): invalid pointer: 0x0b1f8fc7 ***
 === Backtrace: =
 /lib/tls/i686/cmov/libc.so.6[0xb73e9a85]
 /lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0xb73ed4f0]
 /usr/local/lib/osgPlugins-2.9.1/osgdb_xine.so[0xb7f7c823]
 /usr/lib/libxine.so.1[0xb58484d8]
 === Memory map: 

 Why my ffmpeg is not in use ?
 I have to modify something in osgDB ?







 2009/3/20 Robert Osfield robert.osfi...@gmail.com

 HI Carlos,

 Our plugin doesn't contain any inflateInit_ or inflate method of any
 kind, so the missing sybmol must be coming from ffmpeg itself.  I haven't
 see this error myself when building from various versions of ffmpeg so
 perhaps it's version 0.5 that has gone astray.

 Have a look in ffmpeg itself for the inflateInit_ method.  Another thing
 you could try is using the svn version of ffmpeg, or the ffmpeg libs pulled
 down from the Ubuntu repositories.

 Robert.


 2009/3/19 Carlos Sanches ces...@gmail.com

 Ok , I did it .
 now I m trying to run de example:
  osgmovie -e ffmpeg

 this error occours

 Warning: dynamic library
 '/usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so' exists, but an error
 occurred while trying to open it:
 /usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so: undefined symbol:
 inflateInit_
 Usage: ./osgmovie [options] filename ...
 Options:
 ...





 2009/3/19 Adrian Egli OpenSceneGraph (3D) 3dh...@gmail.com

 I am working with windows, no problem there, but here my settings.
 Variable Name: FFMPEG_LIBAVCODEC_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVCODEC
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVCODEC_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avcodec-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVDEVICE_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVDEVICE
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVDEVICE_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avdevice-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVFORMAT_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVFORMAT
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVFORMAT_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avformat-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVUTIL_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVUTIL
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVUTIL_LIBRARIES
 Description: Path to 

Re: [osg-users] GraphicsContext problem

2009-03-20 Thread Lingyun Yu
nobody had the same thing?

On Fri, Mar 20, 2009 at 12:20 PM, Lingyun Yu lingyun.yu...@gmail.comwrote:

 Hi guys,

 I want to use OpenGL to render the interface, but use OSG to render in a
 region. And in this region I use OSG manipulator, but in the rest of the
 interface I use others. I don't know if it is possible, if it is, how to do?

 Thanks in advance.
 --
 Cheers,
 Yun




-- 
Cheers,
Yun
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] GraphicsContext problem

2009-03-20 Thread Robert Osfield
Hi Yun,

Have a look through the osg-users archives, there has been plenty discussed
about OpenGL/OSG integration.  It's a bit tricky due to state management, so
if you can I'd recommend just using OSG all the way as it'll lead to better
performance and an easier life alround.

Robert.

2009/3/20 Lingyun Yu lingyun.yu...@gmail.com

 nobody had the same thing?


 On Fri, Mar 20, 2009 at 12:20 PM, Lingyun Yu lingyun.yu...@gmail.comwrote:

 Hi guys,

 I want to use OpenGL to render the interface, but use OSG to render in a
 region. And in this region I use OSG manipulator, but in the rest of the
 interface I use others. I don't know if it is possible, if it is, how to do?

 Thanks in advance.
 --
 Cheers,
 Yun




 --
 Cheers,
 Yun

 ___
 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] LocalParticleSystem and ModularEmitter.cpp

2009-03-20 Thread Michael Dorsett

Hi all,


Some background first:
I've upgraded my code from 2.4 to 2.8.

I have a queue of ParticleEffects contained by osg::PositionAttitudeTransform's 
that get moved around. So whoever was the last effect to move, gets put into a 
new position and reset to look as if it's a totally new effect. 

An alternative method would be to delete the oldest when adding a new one and a 
preset limit is reached. However, this is what I did to just reuse the 
previously created effect.

If you don't use LocalParticleSystem, you'll get a smoke trail (from the old to 
new pos) for smoke (which in this case we don't want) or a fire trail or 
whatever. 



This issue I've noticed in 2.8:
When you use a LocalParticleSystem on an Effect in 2.8, the Effects just sit at 
the origin (which is not what happened before). It seems to happen due to a 
change in ModularEmitter.cpp. It seems the code was changed to support 
Earth-centric coordinate system. The full comment on the change is:

From Tim Moore, his submission fixes a bug when the ModularEmitter and 
ParticleSystem are in different frames of reference. Specifically, it supports 
the case where the ParticleSystem is not in the world frame. One way this can 
come up is if your world coordinate system is Earth-centric; the float 
coordinates of particles don't have enough precision to avoid terrible jitter 
and other rendering artifacts, so it's convenient to root the particle systems 
in a local Z-up coordinate system that gets moved around from time to time.


So, is there a way to get ParticleEffects with setUseLocalParticleSystem(true) 
to behave like the use too?

Thanks,
Mike Dorsett


  
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] VPB osgTerrain basic functionality

2009-03-20 Thread Dario Filipovic

Hi all!

I was wondering can someone give me a few hints on what
to look for in VPB in sense of its functionality. I not sure for
instance what happens when you push a image file trough osgdem. From
what i see as a result it seems that heightmap image and texture get
fragmented and put into hierarchical structure of nodes with different
LOD(TerrainTiles). Files with different LOD are then used in paging
mechanism to dynamicly load generated terrain fragments at runtime.Is
this so? Does it mean that there are no algorithms such as ROAM used?
ALso,
i would like to be sure of what does osgTerrain do. Ive tried to read
sources (Im not an experienced programmer ;)) and from what i see
TerrainTechnique is used as an interface for real culling and updating
functionality of terrain node, Locator is used as a coordinate system
manager. osgTerrain seems to be a wrapper around a HeightField, and
what ive seen from osgTerrain example it does not include any LOD
functionality.

Im sorry for swamping with questions and toughts,
but there is little or no documentation about this, and understanding
things by reading sources is very time-consuming. Im generaly
interested in abstract models that are used in osgTerrain and VPB, more
precisely in basic functionality guidelines, so i could at least make
my way trough sources faster. 

Many thanks! :)

_
View your Twitter and Flickr updates from one place – Learn more!
http://clk.atdmt.com/UKM/go/137984870/direct/01/___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] VRML Normal Issue

2009-03-20 Thread Ben Axelrod
I have noticed a very strange issue regarding VRML file rendering.  This issue 
happens in OSG viewer version 2.6, with openVRML version 0.14.3.

Please view the two attached vrml files and observe very different shading on 
the 2 cubes.  The only difference between the files is that in goodbox.vml, the 
coordinate indices are used only once per triangle.  In badbox.wrl, the 8 
vertices are reused for multiple triangles.  You can see that in goodbox.vml, I 
duplicated the vertices so that they would be used only once.  For example, for 
index '0', I copied it and made it also index 8 through 12, then used those new 
indices in the coordIndex[] definition.

I think that the vrml parser tries to interpolate vertex vectors from the 
triangles they belong to.  If a vertex belongs to two ore more triangles which 
are not co-planar then the vertex vector is something in between the different 
surface normals of the different triangles. And because normal vectors along a 
triangle surface are interpolated from the vertex normals, this leads to a 
gradient along the triangle surface (because the vertex normals are not 
pointing in the same direction). Hence, if only co-planar triangles share their 
points the problem disappears.

Are there some VRML flags to prevent this behavior?  Is this a bug in the VRML 
parser?  If so, is this part of OSG or openVRML?

Thanks,
-Ben


goodbox.wrl
Description: goodbox.wrl


badbox.wrl
Description: badbox.wrl
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [build] Preprocessor macros / OSX

2009-03-20 Thread Hartwig Wiesmann
Hi,

what is the official preprocessor macro to define the OSX platform? It seems 
to me that only __APPLE__ is used. Therefore, there is no distinction between 
Cocoa and Carbon? 

Thank you.

Hartwig

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=8871#8871





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] FFmpeg plugin

2009-03-20 Thread Ulrich Hertlein

Hi Carlos,

On 21/3/09 3:17 AM, Carlos Sanches wrote:

the example was built again but .
running example with ./osgmovie -e ffmpeg video.avi   or .mpg
the movie runs but the same error apears.

Warning: dynamic library
'/usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so' exists, but an error
occurred while trying to open it:
/usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so: undefined symbol:
inflateInit_


You could try to run 'ldd osgdb_ffmpeg.so' and also on the various ffmpeg libraries to try 
and find out where (or if) they're looking for zlib.


Cheers,
/ulrich

PS: Could you *please* *not* copy the entire mail thread in your replies?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] How to build osgdem

2009-03-20 Thread vijay kalivarapu
Hi,

I did successfully build OSG2.8, but neither the 'bin' directory or the 
'share/OpenSceneGraph/bin' directory has the executable 'osgdem'. I have been 
looking at various posts that talk about using osgdem to load .dem files, but I 
don't seem to find it.

I do have 'gdal' installed and built OSG with gdal support as well. Can anyone 
tell me what might I be missing?

Another sub question - Can osgdem load dted files (dt0, dt1, etc) ?


Thank you,
Vijay.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=8874#8874





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to build osgdem

2009-03-20 Thread Mark Yantek
Hi Vijay,

OSGDEM is part of the VirtualPlanetBuilder project.

You can find it here

http://www.openscenegraph.org/projects/VirtualPlanetBuilder

OSGDEM will generate .IVE files from your .dem/.dt files. After you have
.IVE files you can use OSGVIEWER to view them.

Good Luck

- Mark


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of vijay
kalivarapu
Sent: Friday, March 20, 2009 3:45 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] How to build osgdem

Hi,

I did successfully build OSG2.8, but neither the 'bin' directory or the
'share/OpenSceneGraph/bin' directory has the executable 'osgdem'. I have
been looking at various posts that talk about using osgdem to load .dem
files, but I don't seem to find it.

I do have 'gdal' installed and built OSG with gdal support as well. Can
anyone tell me what might I be missing?

Another sub question - Can osgdem load dted files (dt0, dt1, etc) ?


Thank you,
Vijay.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=8874#8874





___
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] Build Error on Windows

2009-03-20 Thread Mark Sciabica

Hello all,

I'd like to report a build error I encountered on Windows using CMake 
2.4 and default CMAKE_INSTALL_PREFIX. The default value for the install 
prefix is C:/Program Files/OpenSceneGraph (without the quotes). The 
space in the path appears to confuse CMake when generating the project 
file for osgDB. The problematic CMake source line is:


   
ADD_DEFINITIONS(-DOSG_DEFAULT_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}/${OSG_PLUGINS})


CMake splits this line at the space, creating an output line of  
-DOSG_DEFAULT_LIBRARY_PATH=C:/Program plus an additional compiler 
option of Files/OpenSceneGraph/lib/osgPlugins-2.8.0. The compiler 
tries to compile this as a file and throws an error. Putting quotes 
around the string for the CMAKE_INSTALL_PREFIX option fixes the problem.


In addition to noting this build problem, I would like to question the 
desirability of storing the install path in the binary. The users of my 
software certainly won't be installing OSG in a fixed path determined at 
the time I compile the software, so best case here is a useless check of 
a nonexistent directory. Worst case is that another build of OSG is in 
that directory with plugins built with incompatible compiler options, 
leading to a crash. I suggest removing this osg default library path or 
having an option to disable it (preferably with disabled being the default).


Regards,

Mark
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] how to draw ms3d model

2009-03-20 Thread su hu
Hi all,

In our application, hundreds of human animated models should be loaded into
scene. We use ms3d format models.

Now we do it as follow:

1. load models
2. create a osg::Geode and add it to scene
3. add a osg::Drawable to this Geode
4. add a osg::NodeCallback to this Geode
5. calculate and update models in the NodeCallback
6. draw models in drawImplementation of the Drawable (using OpenGL).

Maybe there is better way to render ms3d model.  Could you please give me
some advice? Thanks for your helps.


Su Hu
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org