Re: [osg-users] osg crashes when remove child

2013-03-08 Thread lucie lemonnier
David,
I don't have access to the viewer frame functions because I use a wrapper c# to 
c++ (I created a dll c++ with osg functions that I call in my wpf (c#) 
application).

Thank you!
lucie

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





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


Re: [osg-users] osg crashes when remove child

2013-03-08 Thread lucie lemonnier
Paul,
The DataVariance for root is also DYNAMIC.
The ThreadingModel is not set, when I display the variable : 
std::cout  threading model :  _viewer-getThreadingModel();
It returns 2 - ThreadPerContext.

Thank you!

lucie

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





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


Re: [osg-users] osg crashes when remove child

2013-03-08 Thread lucie lemonnier
With SingleThreaded, osg also crashes with the same error.

lucie

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





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


[osg-users] wglGetCurrentContext vs osg::GraphicsContext::createGraphicsContext

2013-03-08 Thread Anders Backman
Hi all.

I have a small problem where I
use  osg::GraphicsContext::createGraphicsContext to create a context for a
window-widget (in .NET), but I also use another piece of software that
use wglGetCurrentContext  to check for context.
But wglGetCurrentContext() returns null for the context that OSG creates.

My init method:

bool GraphicsWindow::initOSG( HWND hwnd)
{
  if (m_viewer.valid())
return true;

  m_viewer = new osgViewer::Viewer();
  m_viewer-setThreadingModel( osgViewer::ViewerBase::SingleThreaded );
  m_root = new osg::Group;
  m_viewer-setSceneData( m_root.get() );


  m_traits = new osg::GraphicsContext::Traits();
  m_traits-inheritedWindowData = new
osgViewer::GraphicsWindowWin32::WindowData( hwnd );
  m_traits-setInheritedWindowPixelFormat = true;
  m_traits-doubleBuffer = true;
  m_traits-windowDecoration = true;
  m_traits-sharedContext = NULL;
  m_traits-supportsResize = true;

  RECT rect;
  ::GetWindowRect( hwnd, rect );
  m_traits-x = 0;
  m_traits-y = 0;
  m_traits-width = rect.right - rect.left;
  m_traits-height = rect.bottom - rect.top;

  m_graphicsContext = osg::GraphicsContext::createGraphicsContext(
m_traits.get() );

   m_viewer-getCamera()-setGraphicsContext( m_graphicsContext.get() );
   m_viewer-getCamera()-setViewport( new osg::Viewport( 0, 0,
m_traits-width, m_traits-height ) );
   m_viewer-getCamera()-setProjectionMatrixAsPerspective(30.0f,
static_castdouble(m_traits-width)/static_castdouble(m_traits-height),
1.0f, 1.0f);


  m_viewer-realize();

  m_viewer-frame();


  assert(wglGetCurrentContext()); // Fails


I have tried m_graphicsContext-makeCurrent();

wglGetCurrentContext STILL returns null...

I know that I'm missing something, question is what?


/Anders

-- 
__
Anders Backman, HPC2N
90187 Umeå University, Sweden
and...@cs.umu.se http://www.hpc2n.umu.se
Cell: +46-70-392 64 67
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osg-submissions] OSC plugin, VS2010 64-bit

2013-03-08 Thread Anders Backman
I would REEEALLLY like a developer release with this fix, otherwise 3.1.4
is not available for anyone with VS2010 (and probably VS2012).

Any dates for such release? (3.1.5)


/A


On Fri, Feb 8, 2013 at 7:45 PM, Jan Ciger jan.ci...@gmail.com wrote:



 On Wed, Feb 6, 2013 at 10:20 AM, Robert Osfield 
 robert.osfi...@gmail.comwrote:

 Thanks Stephan for the fix and Paul for the testing.  Fix now merged
 and checked into svn/trunk.



 The same plugin doesn't compile for Android, it seems that the oscpack
 library it is using has issues with Android endianness:

 In file included from
 C:/R/Dependencies/OpenSceneGraph-ARM/source/src/osgPlugins/osc/osc/OscReceivedElements.cpp:34:0:
 C:/R/Dependencies/OpenSceneGraph-ARM/source/src/osgPlugins/osc/osc/OscHostEndianness.h:77:10:
 error: #error please edit OSCHostEndianness.h to configure endianness

 I suggest disabling the plugin for Android for the time being.

 Jan

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




-- 
__
Anders Backman, HPC2N
90187 Umeå University, Sweden
and...@cs.umu.se http://www.hpc2n.umu.se
Cell: +46-70-392 64 67
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osg-submissions] OSC plugin, VS2010 64-bit

2013-03-08 Thread Robert Osfield
Hi Anders,

On 8 March 2013 10:48, Anders Backman ande...@cs.umu.se wrote:
 I would REEEALLLY like a developer release with this fix, otherwise 3.1.4 is
 not available for anyone with VS2010 (and probably VS2012).

 Any dates for such release? (3.1.5)

I have a client deadline to meet today, but once this is done I'll
have a chance to catch up with submissions and make a dev release.

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


[osg-users] disabling state

2013-03-08 Thread Trajce Nikolov NICK
Hi community,

I have a graph with some node where I have set a shader with override. What
is the way down in the subgraph to disable this shader?

Thanks

Nick

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


Re: [osg-users] disabling state

2013-03-08 Thread Trajce Nikolov NICK
The answer is to set an empty osg::Program with
osg::StateAttribute::PROTECTED.

Thanks Wojtek

Nick

On Fri, Mar 8, 2013 at 12:36 PM, Trajce Nikolov NICK 
trajce.nikolov.n...@gmail.com wrote:

 Hi community,

 I have a graph with some node where I have set a shader with override.
 What is the way down in the subgraph to disable this shader?

 Thanks

 Nick

 --
 trajce nikolov nick




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


[osg-users] FFmpeg visual studio 2010 x64 deadlock

2013-03-08 Thread Sebastian Messerschmidt

Hi folks,

I found a problem when using ffmpeg 0.8 (from***ffmpeg*.zeranoe.com/builds/)
with Visual Studio 2010 x64 and osg 3.1.3.

When trying to play the stream from my webcam the FFmpegDecoder::open 
blocks in


 if (av_find_stream_info(p_format_context)  0)
throw std::runtime_error(av_find_stream_info() failed);
(around line 127 in FFmpegDecoder.cpp)

as a minimal example:
osgmovie 0 -e ffmpeg -O format=vfwcap frame_rate=25

Playback of normal videos is working.

Anyone else tried the 0.8 version in this environment?

cheers
Sebastian

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


Re: [osg-users] [osg-submissions] OSC plugin, VS2010 64-bit

2013-03-08 Thread Anders Backman
Grrreat!

/Anders

On Fri, Mar 8, 2013 at 12:00 PM, Robert Osfield robert.osfi...@gmail.comwrote:

 Hi Anders,

 On 8 March 2013 10:48, Anders Backman ande...@cs.umu.se wrote:
  I would REEEALLLY like a developer release with this fix, otherwise
 3.1.4 is
  not available for anyone with VS2010 (and probably VS2012).
 
  Any dates for such release? (3.1.5)

 I have a client deadline to meet today, but once this is done I'll
 have a chance to catch up with submissions and make a dev release.

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




-- 
__
Anders Backman, HPC2N
90187 Umeå University, Sweden
and...@cs.umu.se http://www.hpc2n.umu.se
Cell: +46-70-392 64 67
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Per-view / per-camera effect control

2013-03-08 Thread Janna Terde
Hi Robert,

Thank you for the quick reply!

What I am trying to do is to modify the scene graph (for example modify the 
transformation matrix of the node or uniform of the node). 
I've tried doing it in the cull callback or camera pre draw callback but it 
seems at this point it is already too late.

For example, I have a scene graph with the node in it. I would like to modify 
the transformation matrix of that node and this transformation matrix needs to 
be computed based on the camera, per view. 

I've tried to use cull callback or camera pre-draw callback to compute 
transformation matrix and set it for the node. It seems that at this point when 
I set transformation for the node in the cull callback of the first camera it 
will actually affect the second view (second camera). As if I would be setting 
it in a post-draw callback. 
Also not sure how thread-safe is that.


Thank you!

Cheers,
Janna

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





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


Re: [osg-users] osg crashes when remove child

2013-03-08 Thread David Callu
I Lucie

You probably run OSG and  GUI in 2 different thread, and you try to
manipulate OSG data from GUI thread.

You have created the dll C++ that wrappe OSG. So you can modify it.

You need an asynchronous mechanism to say to OSG add node or remove
node or anything else
 like a queue of 'action' fill by GUI and done by OSG.
 ex : GUI create a custom object AddNode that contain a list of file to
add, put it in queue action, then OSG will does,
 at the good time (before event pass), look in queue action and process
action find.

or

You need a synchronisation mechanism in osgViewer::ViewerBase::frame like a
mutex locked before the even pass and unlocked after the cull/draw pass,
and you have to export, from the C++ dll, some function that does action
you want (add node/remove node/...).
this function must lock the mutex before process any action, so you are
sure that your action is not done during even/update/cull pass.


first solution is more complex but your application (GUI thread) will never
be stopped by OSG thread. Their work in asynchronous mode.
The second is perhaps more simple but if OSG take 5 second to do the
action, GUI will freeze during 5 second. Their work in synchronous mode.


HTH
David



2013/3/8 lucie lemonnier lucielemonn...@hotmail.fr

 With SingleThreaded, osg also crashes with the same error.

 lucie

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





 ___
 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] Per-view / per-camera effect control

2013-03-08 Thread Robert Osfield
Hi Janna,

On 8 March 2013 15:32, Janna Terde brja...@gmail.com wrote:
 Thank you for the quick reply!

 What I am trying to do is to modify the scene graph (for example modify the 
 transformation matrix of the node or uniform of the node).
 I've tried doing it in the cull callback or camera pre draw callback but it 
 seems at this point it is already too late.

 For example, I have a scene graph with the node in it. I would like to modify 
 the transformation matrix of that node and this transformation matrix needs 
 to be computed based on the camera, per view.

 I've tried to use cull callback or camera pre-draw callback to compute 
 transformation matrix and set it for the node. It seems that at this point 
 when I set transformation for the node in the cull callback of the first 
 camera it will actually affect the second view (second camera). As if I would 
 be setting it in a post-draw callback.
 Also not sure how thread-safe is that.

With a transform that is dynamically changing it's state there will be
threading issues, it might not be an issue about the application
crashing, rather just that objects can end up in the wrong place
because different threads are all contending for control over the same
data.

A custom osg::Transform could avoid this issue by not storing any
state locally but simply computing the matrix on the fly.  When
creating your MyTransform class you'd need to override the following
Transform methods:

virtual bool computeLocalToWorldMatrix(Matrix
matrix,NodeVisitor*) const;
virtual bool computeWorldToLocalMatrix(Matrix
matrix,NodeVisitor*) const;

Have a look at how the other Transform subclasses manage these methods
to see it's done - look at osg::MatrixTransform,
osg::PositionAttitudeTransform and osg::AutoTransform.  The matrix in
the above method is the modelview matrix that you'll need to modify
and the NodeVisitor* will be the visitor that is calling the compute
method, a dynamic_castosgUtil::CullVisitor* will allow you to get
access to the CullVisitor's state.  Using this approach you can
dynamically compute the required modelview matrix and avoid any
threading issue.

The only part that will need some kind of state setting would be for
the bounding volume of the MyTransform class as it's position/size in
space will be moving around so you'll need to decide whether to simply
disable culling for this node and not set the bounding volume, or
compute a bounding volume that will encompass all the possible
positions/sizes to prevent it from being culled prematurely.

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


Re: [osg-users] Per-view / per-camera effect control

2013-03-08 Thread Janna Terde
Hi Robert,

This is interesting however I am not completely sure if this can solve all my 
problems. What I am trying to do is to create a general solution for per-view 
control. I have different effects which require per-view control. For example 
different post-effects need per-view uniforms, light-halo effect requires its 
node to adjust transformation scale on per-view / per-camera basis. Effect like 
mirror requires per-view computation to update RTT camera.

So the solution I am looking for needs to be general for all such cases. 

However I can see the threading is one issue. The other issue is that even in 
the single threaded mode I am failing to update the matrix transform (to set 
per-view scale) of the node at the correct time. As I mention previously 
setting matrix for the matrix transform node is affecting next view but not the 
current view (using cull callback). However setting uniform for the same node 
works fine (only in the single threaded mode).

Currently I am trying to understand why setting matrix for the node (in cull 
callback) is not working correctly even in the single threaded mode. 

However the final solution needs to address multi-threading. 


Thank you!

Cheers,
Janna

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





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


Re: [osg-users] Per-view / per-camera effect control

2013-03-08 Thread Robert Osfield
Hi Janna,

It should be possible to make the MyTransform proposal pretty general
purpose, as I don't know the specifics of what type of transform you
want I can't say for sure, but it's how I'd tackle the task.  Without
know more specifics of the how you plan to make the computation I can
really provide much further guidance.

W.r.t modifying the transform matrix within a cull callback, this is
probably down to the cull callback effectively being a traversal
override callback that is called to handle the traversal of the nodes
subgraph and will be called after the CullVisitor grabs the matrix and
puts it on the rendering backends modelview matrix stack.

Robert.

On 8 March 2013 17:30, Janna Terde osgfo...@tevs.eu wrote:
 Hi Robert,

 This is interesting however I am not completely sure if this can solve all my 
 problems. What I am trying to do is to create a general solution for per-view 
 control. I have different effects which require per-view control. For example 
 different post-effects need per-view uniforms, light-halo effect requires its 
 node to adjust transformation scale on per-view / per-camera basis. Effect 
 like mirror requires per-view computation to update RTT camera.

 So the solution I am looking for needs to be general for all such cases.

 However I can see the threading is one issue. The other issue is that even in 
 the single threaded mode I am failing to update the matrix transform (to set 
 per-view scale) of the node at the correct time. As I mention previously 
 setting matrix for the matrix transform node is affecting next view but not 
 the current view (using cull callback). However setting uniform for the same 
 node works fine (only in the single threaded mode).

 Currently I am trying to understand why setting matrix for the node (in cull 
 callback) is not working correctly even in the single threaded mode.

 However the final solution needs to address multi-threading.


 Thank you!

 Cheers,
 Janna

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





 ___
 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] Using OpenSceneGraph with 3rd party window libraries

2013-03-08 Thread Sergey Kurdakov
Hi Randall,

so, I can only  guess, what goes wrong (I'm sorry).

but , in case there are several windowing libraries, they could run in
separate threads

http://msdn.microsoft.com/en-us/library/ms810439.aspx - so that their even
loops are not intersected, the communication
should be async this way, but then other ( non osg ) thread window messages
should not touch handleNativeWindowingEvent

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


[osg-users] [vpb] Latest VPB Snapshot

2013-03-08 Thread Conan Doyle
Hi,
I would like to download a snapshot of the latest VPB. I work in a facility 
that blocks access to outside svn servers, so downloading a snapshot is 
basically my only choice.  I did find v0.9.0 dev release, but I see that there 
appears to be numerous later versions.  Where would I find a new version for 
download?

CD

... 


Thank you!

Cheers,
Conan

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





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


[osg-users] osgconv --compressed-dxt5

2013-03-08 Thread Trajce Nikolov NICK
hi community,

what has happened to osgconv? I remember it was working in the older
versions well. Now it says something like rgb plugin can not export
compressed images. osgconv was the way how to optimize openflight with huge
rgb textures into something like osg with dxt. Any hints?

Thanks

Nick

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