[osg-users] qt + osgviewer::viewer

2009-09-25 Thread Miguel Lokida
Hi,

I have created a widget qosgv that inherits from QWidget and osgViewer::Viewer.
When I use this widget in my application, My scene appears normally.

But, When I use the method setVisible(bool) and that I put true and false,

My scene has completly disappeared from the qosgv widget (I only have the 
default background color of the osgviewer::viewer). 
On the other side, the scene graph always contains the scene.

Why this happens ? Do I have forgotten to activ something when using setVisible 
?

Thank you!

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





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


Re: [osg-users] Rendering Optimizations Not Working

2009-09-25 Thread Robert Osfield
HI Brian,

You don't really provide enough information on what the complex app
is doing to make any judgement on what is going on.  The best I can
suggest is that it sounds like you are breaking starte sorting and
lazy state updating in some way, and in doing so are causing the draw
dispatch and likely the draw down on the GPU to be heavily overloaded.

The fix... don't break state sorting and lazy state updating.

Robert.

On Thu, Sep 24, 2009 at 10:12 PM, Brian R Hill bhil...@csc.com wrote:

 Folks,

 I'm rendering a scene with 3 different objects instanced 500 times each.

 When I run it in osgviewer is achieves 1000 hz, when I run it in a simple
 osgViewer::Viewer based app it runs at 1000 hz, when I run it in a more
 complex osgViewer::Viewer based app it runs at 30 hz. All the additional
 time is in the draw process.

 I used bugle to capture the opengl output (bugle is fantastic!) from the 3
 apps and the first two outputs were practically identical - the 3 objects
 graphics state are setup once, followed by 500 glLoadMatrix and glCallList
 calls.

 3 x (graphics setup, 500 x (matrix, calllist))
 3 graphics state changes

 The more complex app is completely different, the objects are drawn in
 arbitrary order with their graphics state updated every time.

 3 x (500 x (graphics, matrix, calllist))
 1500 graphics state changes

 All apps call osgUtil::Optimizer::optimize on the scene.

 I'm digging through the complex app to see if there's a
 disable_rendering_optimizations call.

 Does anyone know what would cause this type of behavior?

 Thanks,

 Brian



 This is a PRIVATE message. If you are not the intended recipient, please
 delete without copying and kindly advise us by e-mail of the mistake in
 delivery.
 NOTE: Regardless of content, this e-mail shall not operate to bind CSC to
 any order or other contract unless pursuant to explicit written agreement
 or government initiative expressly permitting the use of e-mail for such
 purpose..

 ___
 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] keyboard differences between OSG 2.8.2 vs 2.8.1

2009-09-25 Thread Robert Osfield
Hi Jim,

On Fri, Sep 25, 2009 at 2:24 AM, Jim Brooks jimbl...@gmail.com wrote:
 On OSG 2.8.2, square brackets [] and parentheses() return the same values.
 OSG 2.8.1 returns different values as expected.
 Confirmed using my program and osgkeyboard.
 I'm using a USA keyboard on Debian 5 Lenny.

I believe a bug fix in GraphicsWindowX11 in 2.8.2 revealled this bug.
It's already fixed in svn/trunk and the OSG-2.8 branch.

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


Re: [osg-users] Paged LOD for osg terrain

2009-09-25 Thread Robert Osfield
Hi Brett,

On Fri, Sep 25, 2009 at 5:53 AM, Brett Thomas Lee
brettle...@hotmail.com wrote:
 My requirements are terrain rendering on gpu and texturing should be 
 compatible.

All but software rendering is done on the GPU so it's a bit
confusing still what you are actually curious about.

Is that you want CLOD implemented down on the GPU?

Are you looking for static geometry/LOD?

Basically all the terrain rendering that OSG does or that users
combines rendering of geometry for terrain and texturing for draping
imagery and overlays on top.  But this is what all graphics toolkits
will do anyway so there really isn't much to explain, until become a
bit more specific about what you are after.

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


Re: [osg-users] [osgPlugins] Loading animation in OSG

2009-09-25 Thread alessandro terenzi
Is it possible to try the FBX importer?

Kind regards.
Alessandro

On 9/24/09, Michael Platings mplati...@gmail.com wrote:
 Hi Pradeep
 I have written an importer for the FBX format which supports animation. I've
 sent it to the submissions list so it's waiting review by Robert before it
 gets into the trunk, but you can get it and add it to your own version
 yourself. The email is Re: [osg-submissions] FBX plugin from the 21st
 August.
 -Michael

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


Re: [osg-users] osgOcean collision detection

2009-09-25 Thread Kim Bale
Hi Jan,

My apologies for not replying earlier, I haven't been checking
osg-users as much as I possibly should have. It appears that I've
missed quite a few osgOcean posts.

 BTW, is there a reason why is the size of the screen hardwired to
 1024x768? Do the shaders expect this? Or why is it so? It took me a while to
 figure out why it doesn't draw correctly on our wall.

J-S pretty much answered this one- the screen resolution is only
required for setting up the FBOs involved in the fullscreen effects.
However, this can be changed using:

/** Sets the current screen size, needed to initialise the God Ray and
DOF frame buffers.
 * Default is 1024x768.
*/
   inline void OceanScene::setScreenDims( osg::Vec2s size ){
   _screenDims = size;
   _isDirty = true;
}

Setting that will cause the FBO textures to be resized and rebound at
the desired resolution on the next pass of the update visitor. You
could easily bind this function to a callback which calls it when the
screen resolution changes.


Back to the original problem with collision detection. As J-S said,
direct access to the vertices is not currently supported. However you
should be able to get access to the geometry by adding some simple
accessors. To be honest I haven't thought about collision detection
much as it wasn't an original requirement for me, but I can see that
it would be a valuable addition and i'll try and give you some
pointers.

The vertices and normals involved in the current frame are stored
within the Vec3Arrays called _activeVertices and _activeNormals in
FFTOceanSurface. Whenever the animation frame or LOD level changes the
entire vertex and normal arrays are updated from precomputed LOD and
animation frames stored in a 2D vector called _oceanTiles - where
they're stored in the format _oceanTiles[frame][lodlevel] .

These two arrays are then assigned to a series of custom osg::Geometry
objects called MipmapGeometry which are basically just osg::Geometry
objects with some extra member variables added.

The MipmapGeometry class stores the current LOD level of the patch and
the primitives that define the geometry for each of the ocean patches.
These objects are then stored within a 2D std::vector called
_oceanGeom. There is in fact a private inline function that will
returns a raw pointer to the desired patch:

/**
* Convenience method for retrieving mipmap geometry from _oceanGeom.
*/
inline FFTOceanSurface::MipmapGeometry* getTile( unsigned int x,
unsigned int y ){
   return _oceanGeom.at(y).at(x).get();
}

Like I say I haven't thought about collision detection much, but my
initial thoughts are that you could use the bounding boxes of the
mipmap geometries as a quick way to find the patch in which the
collision occurs and the test the triangles within that patch. The
animation, of course complicates things somewhat. If you're planning
on doing accurate collision detection you should be able to get access
all the vertices involved for the frames at the current LOD from the
_mipmapData container.

I hope that helps a bit, if you have any further questions don't
hesitate to ask and I'll try and be more diligent with my replies.

Regards,


Kim.







2009/9/25 Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com:
 Hi Jsn,

 I will have a look at it tomorrow.

 Excellent, let me know if you have any questions though Kim C. Bale is more
 familiar with the actual algorithms so for some questions I might have to
 defer to him.

 BTW, is there a reason why is the size of the screen hardwired to
 1024x768? Do the shaders expect this? Or why is it so? It took me a while to
 figure out why it doesn't draw correctly on our wall.

 I think it's two things:

 a) preference on Kim's part (the example was coded like that when he first
 posted the code)
 b) all the post-render cameras for the RTT effects (DOF, glare, distortion)
 need to know the resolution of the screen, and I don't recall if/how they
 get this info, but I think he may have hard-coded it to 1024x768 to avoid
 having to pass the resolution all over the place. This can be changed.
 Remember that oceanExample is just that - an example. The API in the
 osgOcean lib should allow you to use it in any way, not just in the way
 oceanExample uses it.

 Bear in mind that osgOcean came from his own project, so the API was made
 for the way he used it. Then I came in and I had some other requirements for
 the API, so I made it evolve that way. It may well be that our two sets of
 requirements still don't cover all possible uses (in fact the opposite would
 be surprising) so if you need the API to evolve in some other way, it won't
 be a problem! :-)

 J-S
 --
 __
 Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 

Re: [osg-users] osgOcean collision detection

2009-09-25 Thread Jan Ciger
Hi Kim (and Jean-Sebastien),

Kim Bale kcb...@googlemail.com wrote:
 Hi Jan,
 
 My apologies for not replying earlier, I haven't been checking
 osg-users as much as I possibly should have. It appears that I've
 missed quite a few osgOcean posts.

No problem :)

 
  BTW, is there a reason why is the size of the screen hardwired to
  1024x768? Do the shaders expect this? Or why is it so? It took me a
  while to figure out why it doesn't draw correctly on our wall.
 
 J-S pretty much answered this one- the screen resolution is only
 required for setting up the FBOs involved in the fullscreen effects.
 However, this can be changed using:
 
 /** Sets the current screen size, needed to initialise the God Ray and
 DOF frame buffers.
  * Default is 1024x768.
 */
inline void OceanScene::setScreenDims( osg::Vec2s size ){
_screenDims = size;
_isDirty = true;
 }

Ah, OK - I have missed this function. I saw that the variables are initialized 
in the constructors but that there wasn't a way to pass new screen dimension 
to them (would be a good addition to the constructor, IMO).

 Setting that will cause the FBO textures to be resized and rebound at
 the desired resolution on the next pass of the update visitor. You
 could easily bind this function to a callback which calls it when the
 screen resolution changes.

Good, that will help. I more-or-less need to call this only on setup, but at 
least it saves me hacking in an extra constructor.

 
 
 Back to the original problem with collision detection. As J-S said,
 direct access to the vertices is not currently supported. However you
 should be able to get access to the geometry by adding some simple
 accessors. To be honest I haven't thought about collision detection
 much as it wasn't an original requirement for me, but I can see that
 it would be a valuable addition and i'll try and give you some
 pointers.

What I need is rather simple - I need an object to bob on the surface of the 
waves, so basically I just need the current height at a given x,y position. 

...

 Like I say I haven't thought about collision detection much, but my
 initial thoughts are that you could use the bounding boxes of the
 mipmap geometries as a quick way to find the patch in which the
 collision occurs and the test the triangles within that patch. The
 animation, of course complicates things somewhat. If you're planning
 on doing accurate collision detection you should be able to get access
 all the vertices involved for the frames at the current LOD from the
 _mipmapData container.

I think that is even an overkill for me - I just need the height to be able to 
attach an object to the surface of the wave. But thanks for the pointers, I am 
going to have a closer look at it today.


Regards,

Jan


signature.asc
Description: This is a digitally signed message part.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Is the osgOcean Linux bug still present?

2009-09-25 Thread Kim Bale
Hi Pierre, Anthousis,

Thanks for further narrowing this bug down. Unfortunately I haven't
used (or even come into contact) with an ATI card for quite some time,
so I won't be able to test this. However, I do remember a while back
that Robert tested osgOcean with an ATI 4670 and that worked with his
linux distro although I'm unsure whether that was 32 or 64bit.

I'm going to take the plunge and install Ubuntu on my 32bit laptop
this weekend and see what happens. Although, having never used linux
actually getting it to compile at all might be a challenge in itself.
:)

So yes if anyone with a linux box and an ATI card would like to raise
their hand on this one that would be great.

Regards,

Kim.



2009/9/20 Pierre BOURDIN bour...@imerir.com:
 Hi Anthousis Andreadis ,
 I had already sent a report going the same way as yours, using Debian 
 Ubuntu distribution...
 So it confirms it is a 32bit only bug.

 The next step would be to test with non-nvidia hardware to know if it is
 related to nvidia graphic card only ?

 I don't have any recent/decent ATI graphic card to conduct some tests...

 If someone with a 32bit linux box and an ati card could make a test it would
 be a great help.

 Cheers,
 Pierre.

 2009/9/17 Anthousis Andreadis anthou...@gmail.com

 Hi Kim,

 Update on the linux bug issue with the squary waves.
 Two days ago i compiled the osgOcean v1.0 (not the repository) and i found
 out that i had the bug that has been described in previous mails. My system
 is RHEL 4 and the GC a Quadro 5500 with the latest drivers and
 OpenSceneGraph 2.8.0 and for FFT's i used fftss lib. The same problem exists
 with the svn version of osgOcean. After a lot of tries i found out that
 32bit compilation causes the problem. On the same system with 64bit
 compilation the problem is solved.

 If the other guys with the same problem can test both 32bit and 64bit we
 could get closer to the source of the problem.

 Regards
 Anthousis Andreadis
 ___
 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] qt + osgviewer::viewer

2009-09-25 Thread Miguel Lokida
I have discovered that the aspectRatio from the frustum of the perspective 
projection matrice was NAN.
So I have looked at the width and height of my qosgv widget  and the width is 
at zero (but the height is ok).

I dont't know yet why the width of my qosgv widget has changed and not the 
height but I think I am on the good way.

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





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


Re: [osg-users] [3rdparty] osgOcean collision detection

2009-09-25 Thread Dimitrios Filiagos
Hi Kim Bale,
   your hints are valuable. As I've seen so far I need to know the 
height on a specific point on sea surface. 
I wrote a function in FFTOceanSurface passing the x,y of a point. That function 
finds the corresponding ocean tile and retrives the closest vertice using the 
getVertex of OceanTile function. 
That way I can program my objects on the sea surface to maintain that height 
from the sea zero level on every frame.
I haven't done yet (actually it doesn't work so far) but I believe I am going 
to the right direction.
I' ll make a post when I have good news.
Thank you!

Cheers,
Dimitrios

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





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


Re: [osg-users] [3rdparty] osgOcean collision detection

2009-09-25 Thread Jean-Sébastien Guay

Hi Dimitrios,

I wrote a function in FFTOceanSurface passing the x,y of a point. That function finds the corresponding ocean tile and retrives the closest vertice using the getVertex of OceanTile function. 


That's good. We could add another function that would return a weighted 
average of the closest 4 points, which would be more accurate but also 
slower.


Finally we could also add a function that returns a 2D array of heights 
given an axis-aligned bounding box which is the (x1, y1, x2, y2) of 
where on the grid your object is. This would allow the collision 
detection to do what it wants with the points.


Those 3 functions would flesh out the API for one-way interaction (water 
- object).


As I told Jan, I'm not working on this right now, but will in the near 
future. Let me know if you get something working, we can share the 
workload that way :-)


J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Clarification on use of Manipulators in CAD-Style app

2009-09-25 Thread Andrew Thompson
Hi there, 

I am developing a CAD-Style application and am interested in using 
osgManipulator to provide picking, moving, rotating and scaling of objects. I 
just have a couple of questions with regard to the use of manipulators, and 
hope some of you can take the time to answer them for me. 

Firstly my application currently has a relatively flat scenegraph, where each 
Object in the CAD app is arranged as follows:


Code:

PositionAttitudeTransform
|
Geode
| 
Geometry




Then I have N Objects arranged as above in the scene that are a child of the 
root scene node (so a flat scene graph). 

From my understanding from reading the osgManipulator example, to manipulate 
an object I can use the following hierarchy:

[Image: 
http://i137.photobucket.com/albums/q217/andyb1979/manpulatorhierachy.png ]

In this diagram Geode is the object I want to manipulate, so I would replace 
that with the PAT from my 3D Object implementation, Selection wraps the 
object to manipulate, Dragger can go anywhere in the scene and the 
CommandManager links the Dragger to the Selection. 

So -- some questions on how I may use this in my app:

* Firstly, to select an object, I pick it. At this point should I create a 
Selection and place in-between my 3D object and SceneRoot? Or can selection be 
anywhere and just place the object as a child of that?

* Secondly can the dragger be anywhere in the scene hierachy or must it be a 
parent of the selection?

* Similarly, does the Selection have to be specifically put between my 3D 
object and the scene root (In a CAD-Style app I will be selecting/deselecting 
objects quite regularly)

* Say my object has a transform applied to it by its 
PositionAttitudeTransform. I need to somehow get that transform, apply to the 
dragger, then let the user manipulate it and apply the resultant transform to 
the PAT, removing the dragger/selection from the scene. Any ideas how this 
could work?

* Is there a way to get an event or call-back out for each translate, rotate, 
scale operation as I need to push these into an undo-redo stack

* Finally, could the above be modified to work with multiple objects in the 
same selection and how would I apply the Dragger transform to all of them 
before/after the event? 



Thanks for your time, any insights would be gratefully received. 

Andrew[/list]

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





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


Re: [osg-users] noob question about texture3d

2009-09-25 Thread Robert Osfield
Hi Otto,

Texture3D is no different to Texture1D, 2D etc, all just accept an
osg::Image which packs the raw byte data.  There are also standard
Texture methods for setting the filtering and wrapping, for examples
of these it best to look at the osgtexture2D example.

As for creating a 3D osg::Image, again this is much the same as a 2D
osg::Image, the only difference is the r dimension having a value that
isn't 1.   The osgvolume example has code that packs an osg::Image so
have a look at this.

Robert.

On Fri, Sep 25, 2009 at 12:48 PM, Otto Cologne schur...@gmx.de wrote:
 Hi,

 ok I give up. After a lot of trying and searching i still fail to create a 
 simple 3d texture from a raw byte array for example. Could anyone help me 
 with how to put something like


 Code:

 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
 glGenTextures(1, m_GLuint);
 glBindTexture(GL_TEXTURE_3D, m_GLuint);
 glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP);
 glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP);
 glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP);

 glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA, m_columns, m_rows, m_frames, 0, 
 GL_LUMINANCE, GL_UNSIGNED_BYTE,m_data);




 into osg code or point me towards some example code. The texture3d example 
 here doesn't really help.

 Any help would be greatly appreciated.
 ...

 Thank you!

 Cheers,
 rs

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





 ___
 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] Clarification on use of Manipulators in CAD-Style app

2009-09-25 Thread Robert Osfield
Hi Andrew,

In the svn/trunk version of the OSG I have refactored osgManipulator a
bit to make it more flexible and easier to use.  I would strongly
suggest having a look at it as the extra complexity of CommandManager
is no longer needed, also you no longer need to implement your own
event handling, as osgManipulator can now automatically pick up on
events.  There is also a new callback support that allows you to move
objects around in the scene to follow manipulators.

Robert.

On Fri, Sep 25, 2009 at 1:58 PM, Andrew Thompson andyb1...@yahoo.co.uk wrote:
 Hi there,

 I am developing a CAD-Style application and am interested in using 
 osgManipulator to provide picking, moving, rotating and scaling of objects. I 
 just have a couple of questions with regard to the use of manipulators, and 
 hope some of you can take the time to answer them for me.

 Firstly my application currently has a relatively flat scenegraph, where each 
 Object in the CAD app is arranged as follows:


 Code:

 PositionAttitudeTransform
 |
 Geode
 |
 Geometry




 Then I have N Objects arranged as above in the scene that are a child of 
 the root scene node (so a flat scene graph).

 From my understanding from reading the osgManipulator example, to manipulate 
 an object I can use the following hierarchy:

 [Image: 
 http://i137.photobucket.com/albums/q217/andyb1979/manpulatorhierachy.png ]

 In this diagram Geode is the object I want to manipulate, so I would replace 
 that with the PAT from my 3D Object implementation, Selection wraps the 
 object to manipulate, Dragger can go anywhere in the scene and the 
 CommandManager links the Dragger to the Selection.

 So -- some questions on how I may use this in my app:

 * Firstly, to select an object, I pick it. At this point should I create a 
 Selection and place in-between my 3D object and SceneRoot? Or can selection 
 be anywhere and just place the object as a child of that?

 * Secondly can the dragger be anywhere in the scene hierachy or must it be a 
 parent of the selection?

 * Similarly, does the Selection have to be specifically put between my 3D 
 object and the scene root (In a CAD-Style app I will be selecting/deselecting 
 objects quite regularly)

 * Say my object has a transform applied to it by its
 PositionAttitudeTransform. I need to somehow get that transform, apply to the 
 dragger, then let the user manipulate it and apply the resultant transform to 
 the PAT, removing the dragger/selection from the scene. Any ideas how this 
 could work?

 * Is there a way to get an event or call-back out for each translate, rotate, 
 scale operation as I need to push these into an undo-redo stack

 * Finally, could the above be modified to work with multiple objects in the 
 same selection and how would I apply the Dragger transform to all of them 
 before/after the event?



 Thanks for your time, any insights would be gratefully received.

 Andrew[/list]

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





 ___
 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] [osgPPU] Using osgPPU

2009-09-25 Thread Hadrien Thomas
Hi Art!

Thank you very much for the correct version!
I am sorry I didn't give my whole code, I was afraid it would have confused 
everyone. I also apologize to bother you with huge mistakes.

Everything works fine now thanks to you !

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





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


Re: [osg-users] Changing CopyOp

2009-09-25 Thread Michael Platings
 
 This change wouldn't be a clone() method, it'd be a
 shareASingleClone() method which is a totally different thing and in
the general case
 would not be safe or appropriate a replacement for clone().

Maybe I explained it incorrectly, the idea is simply that calling clone
should give you an exact clone of the argument, with all the
relationships between its child nodes intact. But I accept that it's a
big change, I'm glad I checked with you before I started relying on it
:)

As it stands, osgAnimation is compatible with cloning as it is:
relationships between nodes are inferred from their names. Issues with
COLLADA using non-unique IDs prompted me to suggest setting pointers to
identify related objects, but I can work around it another way.
Thanks for your quick response
-Michael

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

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
__

__
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Changing CopyOp

2009-09-25 Thread Cedric Pinson
Hi Robert 

I ll try to explain the situation about the cloning problem.
Cloning works as long as the animation manager relink target, this
operation is done automatically but can be done manually.
The problem Michael has encountered is that using collada reader it
seems to not possible to setup callback with name suitable for the
linker work. It means that without the linker the cloned update callback
are not relinked and then are not updated with the result of animation.
In order it works the linking operation (manually or automatically) must
be executed after a deep copy of a graph. 
The current operation of the clone operation is to duplicate the update
callback like other deep copy of objects.
Using a shallow copy for a deep copy will have side effect, like animate
two node instead of the copied node.

What is the linker and why ?
The linker is a nodevisitor, and is run from the animation manager (it's
an update callback) this visitor will traverse child and link what is
needed to be linked. It will do this operation if it's tagged 'need
relink', this state are set when a deep copy occur.
The linker will create the link between animation manager and Target in
update callback own by a node or other object. Those target can be
shared between different update callback (eg you can animate an osgText
or a color with the same target).
Once the linker has done its work, node or objects are updated correctly
corresponding to the animation and ready to be updated.

The linker to make its job needs a kind of convention about the update
callback name to be able to link with something eg:
If an animation contains a channel named diffuse, the update callback
that are 'compatible' with this channel will do something like that:

bool UpdateMaterial::link(osgAnimation::Channel* channel)
{
if (channel-getName().find(diffuse) != std::string::npos)
return channel-setTarget(_diffuse.get());
return false;
}

The same principle is used for other type. But if you want to skip this
behaviour and do your link by hand you will have to fix your link by
hand when you do a deep copy to maintain the shared target inside update
callback ...

That's the case of Michael, because the collada reader seems not able to
use the linker.


I hope it will helps to understand better, but if it's not enough clear
dont hesitate to ask. I will try to keep the doc of osgAnimation with
this kind of post in order people can understand how it works.

Cheers,
Cedric

-  
+33 659 598 614  Cedric Pinson mailto:cedric.pin...@plopbyte.net
http://www.plopbyte.net


On Fri, 2009-09-25 at 16:37 +0100, Robert Osfield wrote:
 HI Michael,
 
 On Fri, Sep 25, 2009 at 4:02 PM, Michael Platings
 mplati...@pixelpower.com wrote:
  While working on osgAnimation I've encountered the following problem: if an
  object is referenced multiple times in a scene graph, and the scene graph is
  deep cloned, the scene graph clone will contain a different copy of that
  object for each reference. I think so far this hasn't been a problem because
  having multiple copies of most objects doesn't matter other than taking up
  extra memory, but in osgAnimation meshes won't animate correctly if they're
  not linked to the right bones so this has become an issue.
 
  A solution to this could be to add a map of old objects to new objects into
  CopyOp, and in operator() only call clone() on an object if it hasn't
  already been cloned. I've implemented this and it works fine, but before I
  start to rely on this, would such a change be acceptable to you?
 
 This change wouldn't be a clone() method, it'd be a
 shareASingleClone() method which is a totally different thing and in
 the general case would not be safe or appropriate a replacement for
 clone().
 
 It sounds to me like osgAnimation's support for cloning is suspect, as
 one should be able to deep copy a subgraph with an animation and have
 it still work.  If it's not possible then a shallow copy should be
 enforced.  I'm not familiar with the internals of osgAnimation so l'll
 have to leave this to Cedric to consider.
 
 Cheers,
 Robert.
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 


signature.asc
Description: This is a digitally signed message part
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [osgCompute] PostProcessGL

2009-09-25 Thread Michael Guerrero
First of all, great work on bring CUDA to the OSG!  I'm just getting schooled 
up on it right now with the main goal being to duplicate what the PostProcessGL 
example in the sdk is doing.  According to their comments, this requires the 
following:

1 - render the scene to the framebuffer
2 - copy the image to a PBO (pixel buffer object)
3 - map this PBO so that its memory is accessible from CUDA
4 - run CUDA to process the image, writing to memory mapped from a second 
PBO
6 - copy from result PBO to a texture
7 - display the texture

I've mainly struggling with steps 1,2, and 3.  What's the best way to do this?

Michael Guerrero

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





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