[osg-users] Osg and threads

2011-01-13 Thread Vincent Bourdier

Hi all,

Currently working on a way to manage the memory efficiently, I would 
like to know what are the osg threads running ?


I mean there are some threads in the databasePager, depending on the 
rendering threading mode there are threads for the render, the cull, or 
whatever...


Did I miss something important ?
What are the osg threads ?

I would like to be able to make some king of pause on all treads to be 
able to allocate the whole available memory for the process without 
having some crash because a thread would be working (and so allocating 
memory) during this operation.


Thanks for your help.

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


Re: [osg-users] Improper rotation

2011-01-13 Thread Axel Spirtaat
Hi Tom,
thanks a lot for your answer!


Tom Pearce wrote:
 
 In the step where you're calculating m, it looks like you're applying the 
 rotation to the original matrix, which includes a translation already.
 


Yes, this is (perhap) what i want. I try to be less ambiguous: my scene is a 
small room with a table at the center. The table, how you can see in pics has 8 
rods, The table is translated by (0, 0, -309) to be placed on the floor
My goal is to rotate a rdd using the mouse wheel: when i pick  scroll up on a 
rod it should rotate the related rod by +angle (the variable rotation in code) 
on Y axis (-rotation if i scroll down). 
This is why (in my reasoning) i use the original matrix for rotate: i should 
not know how much rotated is the rod. The rod only need to be rotated on its Y 
axis, it should not be translated 


Tom Pearce wrote:
 
 I'm not sure why you say that the rotation and translation is formally right 
 - the final translation should be equal to the original translation if you're 
 rotating about a local axis, but it isn't.
 

I said formally right because reading the output it seems that the rod is 
positioned right, but i'm not sure of this, since visually the rod is bad 
positioned after the rotation. Sincerely, more time I spend on this issue, more 
I feel confused :-))
However, to understand better how rods have to work (for rotating) , look some 
seconds of the following video:
http://www.youtube.com/watch?v=p06NT8M5cKU

PS: excuse my archaic English!

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





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


[osg-users] Incomplete TIFF plugin (tiled images)

2011-01-13 Thread Sukender
Hi all,

Thanks to the TIFF error ouput (See corresponding submission, a few minutes 
ago), I found that current TIFF plugin does not read tiled images properly.
Has anyone worked on this? I found several functions like TIFFIsTiled(), 
TIFFReadTile()/TIFFReadRGBATile(), and tileContigRoutine/tileSeparateRoutine 
typedefs. However, I lack information about tiling to modify the plugin 
accordingly.

Can anyone tell me anything interesting about it?
Thanks.

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] libtiff update

2011-01-13 Thread Sukender
Hi all,

I tried to update libtiff to 4.0.0beta6 (I thought my tiled images issue it 
was a matter of version - See corresponding post), but unfortunately the 
libtiff strangely fails to make a==a be true at some point (SeekOK) on 
Win32 MSVC9 (test uses a 64 bit integer comparison inside a macro - works well 
only if you truncate to an int).

Did anyone try to update the libtiff for osgPlugin TIFF?
Thank you.

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] libtiff update

2011-01-13 Thread Torben Dannhauer
Hi Sukender

I haven't tried it, but if a new libtiff version is available, I'll update the 
MSVC9 3rdparty package.


Cheers,
Torben

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





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


Re: [osg-users] Display a triad in a viewport corner

2011-01-13 Thread Antoine Rennuit
I need to clean things here and there but when it is all finished this would be 
a pleasure.

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





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


Re: [osg-users] Need Help ! How to get Camera Position inside shaders

2011-01-13 Thread David Callu
Hi Lait,

If you want the camera position in world coordinate, you have to pass it
yourself.
OSG, like OpenGL only work in Eye Coordinate inside the shader.

HTH
David Callu


2011/1/13 Laith Dhawahir laithbasildot...@gmail.com

 Heey Guys,
 I hope you will fine,
 anyway, i have question about how i can get the camera position inside
 shader from open scene graph do i must pass it, or open scene graph already
 do that.

 Thank you!

 Cheers,
 Laith

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





 ___
 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] multiple tex gen modes in a single scene

2011-01-13 Thread Robert Osfield
Hi Paul,

Eye linear glTexGen is positional state, i.e. it's value depends on
the current modelview matrix, so has to be treated by the OSG like
other positional state like glLight and glClipPlane. All positional
state has to be positioned by a positional state node, and for
glTexGen this is TexGenNode.

During the cull traversal the OSG collects the positional state and
binds the TexGen/Light/ClipPlane to modelview matrix at that point in
traversal, this binding is done via the PositionalStateContainer, and
there is one of these per RenderStage.  During the draw traversal the
positional state is then applied prior to the traversal of the
RenderStage, and fixes each positional state in the appropriate place.
  While this technique doesn't properly fix the state as required, it
does limit you to one position, per stage, you can't have two eye line
tex gens/lights/clip planes applied on two separate subgraphs.

Object linear TexGen isn't positional state so can be applied in the
normal way and you have multiple of these per stage without problem.

To have multiple Eye linear TexGen/TexGenNode's you'll need to break
the scene up into multiple RenderStage and use the clear mask set to 0
on the subsequent stages so that each stage overlays correctly on the
previous one.  Other approaches are to write a custom TexGen that you
push/pop a custom modelview matrix.  I'm afraid both approaches are
rather hacky.

Robert.

On Thu, Jan 13, 2011 at 2:28 AM, Paul Martz pma...@skew-matrix.com wrote:
 Hi all -- Has anyone ever successfully used multiple TexGen modes (say,
 EYE_LINEAR and OBJECT_LINEAR) on different objects in the same scene? What
 is the recommended way to do this in OSG?

 The TexGenNode has a pointer to a TexGen, and the TexGen has the mode. I
 assume I should create two TexGens, one OBJECT_LINEAR and one EYE_LINEAR,
 and two TexGenNodes to reference them, and add the two TexGenNodes to the
 scene graph. Then, I assume I should attach the same two TexGens as
 StateAttributes to different Node's StateSets as needed.

 I am running into some issues with this. If it sounds like I'm doing
 everything right, I'll post a small example that fails, or dig into the OSG
 code. More than likely, I'm doing something wrong here, so I just wanted to
 ask what the intended usage is.

 Thanks,
 --
  -Paul Martz      Skew Matrix Software
                   http://www.skew-matrix.com/
 ___
 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] Need Help ! How to get Camera Position inside shaders

2011-01-13 Thread Robert Osfield
Hi Laith,

In OpenGL the camera position is always at 0,0,0, and the scene is
transformed into cameras coordinates by the modelview matrix.

So... one has to ask are you wanting to do calculations in the
eye/camera coordinates, world coordinates or local object coordinates?
 You can transform the camera position into world or local object
coordinates by multipling by the inverse of the view or modelview
matrices respectively.

Robert.

On Thu, Jan 13, 2011 at 6:34 AM, Laith Dhawahir
laithbasildot...@gmail.com wrote:
 Heey Guys,
 I hope you will fine,
 anyway, i have question about how i can get the camera position inside shader 
 from open scene graph do i must pass it, or open scene graph already do that.

 Thank you!

 Cheers,
 Laith

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





 ___
 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 and threads

2011-01-13 Thread Vincent Bourdier

Hi Robert,

First of all thanks for your answer, I didn't know about the
Viewer::startThreading/stopThreading() and this sounds interesting

I know that my request seems to be a very strange way to manage memory 
by pausing threads ... But I am not (completely) crazy. The datas amount 
I have to manage is the reason why I need to be sure, before loading a 
file, that I have enought memory including a fixed amount that I reserve 
for the rest of the code... so I need to saturate memory for a little 
while to be sure of the amount I can use, and for that I need to stop 
other threads to be sure they won't crash because of bad_alloc errors 
that are not managed.


Thanks, I'll have a look at the things you gave to me.

Regards,
Vincent.

Le 13/01/2011 11:32, Robert Osfield a écrit :

Hi Vincent,

The OSG threads that will run automatically are the DatabasePager when
you have paged databases and any viewer threads.  There is a viewer
method for getting the threads.

However, the threads are designed to be arbitrarily paused, you can
start and stop the viewer threads via
Viewer::startThreading/stopThreading() but this creates and destroys
threads so not quite what you are after.

However, I'm kinda perplexed how you think you might be managing
memory more efficiently by pausing threads and doing stuff and then
un pausing.  I can't help but feel that you need to take a step back
and work out what you mean by managing memory efficiently, there are
lots of different ways of doing this, but given no information about
what you mean and you actual motivation for this others like myself
can't really point you in the right direction, the best I can say is
from the sound of it you are currently looking in the wrong place.

Robert.

On Thu, Jan 13, 2011 at 8:14 AM, Vincent Bourdier
vincent.bourd...@gmail.com  wrote:

Hi all,

Currently working on a way to manage the memory efficiently, I would like to
know what are the osg threads running ?

I mean there are some threads in the databasePager, depending on the
rendering threading mode there are threads for the render, the cull, or
whatever...

Did I miss something important ?
What are the osg threads ?

I would like to be able to make some king of pause on all treads to be
able to allocate the whole available memory for the process without having
some crash because a thread would be working (and so allocating memory)
during this operation.

Thanks for your help.

Regards,
Vincent.
___
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] Another texty disappearing...

2011-01-13 Thread Antoine Rennuit
Hi all,

I displayed a triad in a scene at the tip of which vectors I binded the axes 
names as text x, y and z. The text displays all good when I rotate the 
triad so long as the text is in front of the triad's origin. When the axes 
labels go behind the origin, the text suddenly disappears. Any idea what could 
cause this problem?

Thanks,

Antoine.

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





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


Re: [osg-users] Need Help ! How to get Camera Position inside shaders

2011-01-13 Thread Frederic Bouvier
Hi Laith,

OSG defines the osg_ViewMatrixInverse uniform. You have to add

uniform mat4 osg_ViewMatrixInverse;

in your shader to use it and find the camera location in world coordinates.

Otherwise, there is the gl_ModelViewMatrixInverse uniform if you want to 
transform the camera position from eye coordinates (0,0,0) into local
object coordinates.

Regards,
-Fred

- Robert Osfield robert.osfi...@gmail.com a écrit :

 Hi Laith,
 
 In OpenGL the camera position is always at 0,0,0, and the scene is
 transformed into cameras coordinates by the modelview matrix.
 
 So... one has to ask are you wanting to do calculations in the
 eye/camera coordinates, world coordinates or local object
 coordinates?
  You can transform the camera position into world or local object
 coordinates by multipling by the inverse of the view or modelview
 matrices respectively.
 
 Robert.
 
 On Thu, Jan 13, 2011 at 6:34 AM, Laith Dhawahir
 laithbasildot...@gmail.com wrote:
  Heey Guys,
  I hope you will fine,
  anyway, i have question about how i can get the camera position
 inside shader from open scene graph do i must pass it, or open scene
 graph already do that.
 
  Thank you!
 
  Cheers,
  Laith
 
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=35600#35600
 
 
 
 
 
  ___
  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] gelGlShaderInfoLog returning false

2011-01-13 Thread Sergey Polischuk
Hi,

osg by default initialize most of opengl related objects just before actual 
use, so before first frame your shaders likely to be not compiled\linked yet.
afaik you can use osgUtil::GLObjectsVisitor with appropriate options on your 
scene to prepare all gl stuff before first frame, but be sure to call 
viewer.realize() first to initialize gl context.

Cheers,
Sergey

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





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


Re: [osg-users] Improper rotation

2011-01-13 Thread Sergey Polischuk
Hi,

Basically what you need to do is translate rod to (0,0,0), apply rotation that 
u need, and translate back to original position.
If your math is right and you still haven't expected results i'd say that your 
model has static transforms removed and translated to vertices coords, so 
center of your rod in local coords is not gonna be (0,0,0), and hence you will 
get wrong results with rotations, since your math assume that center of your 
rod in local coords is (0,0,0) to do proper rotation.
You can try use like model bbox or bounding sphere center in local model coords 
and transform model to that coords instead of (0,0,0) before rotation or 
re-export your model without flatten static transforms optimization.

Cheers,
Sergey

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





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


Re: [osg-users] PERSPECTIVE --FIELD OF VIEW

2011-01-13 Thread Sergey Polischuk
Hi,

aspect is fovx/fovy, so you setup fovy as u need, and aspect as fovx / fovy.

Cheers,
Sergey

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





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


[osg-users] [build] PR0020 Eerror During Compilation

2011-01-13 Thread H. Can ALBASAN
Hi,

During the first Build solution procedure of OpenSceneGraph-2.9.10, using 
MSVS2008, there is this same error for two plugins:


Code:
39Plugins osg serializer osgmanipulator : error PRJ0020 : Tool 'Linker', 
Property 'Manifest File' contains invalid file name 
'osgdb_serializers_osgmanipulator.dir\Debug\osgdb_serializers_osgmanipulatord.dll.intermediate.manifest'.

81Plugins osg deprecated osganimation : error PRJ0020 : Tool 'Linker', 
Property 'Manifest File' contains invalid file name 
'osgdb_deprecated_osganimation.dir\Debug\osgdb_deprecated_osganimationd.dll.intermediate.manifest'.



I am guessing the reason might be the long path. But if it was, it should have 
been a problem for more people!! 

However, as a result, the dll.intermediate.manifest files are not generated, 
and hence the dll's themselves; and this naturally causes another error during 
the build of the INSTALL project, since it can't find the dll's. 

Any suggested workarounds for this issue are quite appreciated. 

I am thinking of disabling the manifest generation to be able to create the 
dlls, osgdb_serializers_osgmanipulatord.dll and 
osgdb_deprecated_osganimationd.dll,  but I don't know if it will be a 
compromise for the integrity of the library or a potential cause for errors may 
be when I have to use these plugins..

Thank you!

Cheers,
Can[/code]

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





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


Re: [osg-users] multiple tex gen modes in a single scene

2011-01-13 Thread Paul Martz

On 1/13/2011 3:27 AM, Robert Osfield wrote:

Object linear TexGen isn't positional state so can be applied in the
normal way and you have multiple of these per stage without problem.


Ah! Thanks, this was my problem. I mistakenly thought OpenGL transformed the 
object planes by the modelview matrix, and I was trying to set up an OSG scene 
graph to do that. My mistake. So I use TexGenNode to transform the eye planes, 
and for OBJECT_LINEAR I just attach the TexGen to a StateSet like any other 
StateAttribute. This works great!


(Sheesh, I go off an code in shaders for a couple years, and I forget everything 
I ever knew about the FFP...)


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


Re: [osg-users] Question about camera autoComputeHomePosition

2011-01-13 Thread Nan WANG
Do you know how to set a projection referential camera?
off-axis camera?

Thank you!

Cheers,
Dromouse

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





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


[osg-users] [QUESTION]How Projection Referential Cameras Work in OSG?

2011-01-13 Thread Nan WANG
Hi, everyone:


I am trying to setup a VR system using OSG. Current, I want to learn how 
projection referential cameras work in OSG.

One of the key features of the visualization component is the ability to use 
off-axis cameras (a.k.a Asymmetric frustum)

The main idea of the projection referential cameras is to easily represent the 
displays of the VR installation inside the composition.

As we know that the usual camera's viewing frustum is defined by: it position, 
orientation, field of view, aspect ratio and N/F clip plane...

Projection Referential Cameras sets of a 3D plane in the composition as the 
projection referential of the camera. This 3D Plane is symbolized according to 
the actual dimensions and positions of a real screen. The viewing frustum of a 
projection referential camera is defined by: it position, it clipping 
plane(n/f) and 3D plane projection referential.

[Image: http://i53.tinypic.com/33v29ab.jpg ]
3D sprite can be considered as projection ref~

Now the frustum can be asymmetric, as opposed to the usual cameras frustums.

Anybody knows how to setup this kind of projection referential camera using 
python or OpenGL in OSG?
... 

Thank you!

Cheers,
Dromouse[/img]

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





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


[osg-users] different rendering states for different passes?

2011-01-13 Thread Peter Amstutz
Hello all, I have a bit of a knotty problem and was hoping for some
advice.  I am using OSG 2.8.3.

I am using osgShadow::LightSpacePerspectiveShadowMapVB, which renders
the scene in two passes; the prerender stage renders the shadow map, the
main state renders the scene.  My understanding is that the behavior of
the two passes is controlled by setting different shader programs at the
scene root, which sets the default shader program for the whole scene.

However, I am also using shader programs at some of my leaf nodes.  I
would like it to accept shadows, so it needs to read the shadowTexture
uniform.  However, this uniform is only available on the main drawing
pass, not the prerender pass (since the purpose of the prerender pass is
to generate the shadow texture).  The problem I am encountering is the
fact that my shader program does not have a way to distinguish between
executing the prerender pass and the main pass, and attempts to read the
(non-existent) shadowTexture uniform in the prerender pass, which causes
a GL error and results in the node not showing up at all.

I know the solution is to use different shaders for different passes,
but I haven't figured out the right way to set up OSG to do this at the
leaf.  Can anyone point me in the right direction?

-- 
Peter Amstutz
Senior Software Engineer
Technology Solutions Experts
Natick, MA
02131

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


Re: [osg-users] Osg and threads

2011-01-13 Thread Vincent Bourdier

Hi,

I'm still having issues with that...
I use a composite viewer with only one view.

I tried to call startThreading/stopThreading() but it does nothing...
I also tried getAllThreads(...) to get for each thread its thread ID, 
and it returns me only one thread with ID to 0...  even if I know that 
there is 2 threads running for the rendering...


I know I'm not supposed to disturb the rendering threads, but if I 
cannot get them there is no risk at all...

Did I miss something ?

Thanks.

Regards,
Vincent.

Le 13/01/2011 11:49, Vincent Bourdier a écrit :

Hi Robert,

First of all thanks for your answer, I didn't know about the
Viewer::startThreading/stopThreading() and this sounds interesting

I know that my request seems to be a very strange way to manage memory 
by pausing threads ... But I am not (completely) crazy. The datas 
amount I have to manage is the reason why I need to be sure, before 
loading a file, that I have enought memory including a fixed amount 
that I reserve for the rest of the code... so I need to saturate 
memory for a little while to be sure of the amount I can use, and for 
that I need to stop other threads to be sure they won't crash because 
of bad_alloc errors that are not managed.


Thanks, I'll have a look at the things you gave to me.

Regards,
Vincent.

Le 13/01/2011 11:32, Robert Osfield a écrit :

Hi Vincent,

The OSG threads that will run automatically are the DatabasePager when
you have paged databases and any viewer threads.  There is a viewer
method for getting the threads.

However, the threads are designed to be arbitrarily paused, you can
start and stop the viewer threads via
Viewer::startThreading/stopThreading() but this creates and destroys
threads so not quite what you are after.

However, I'm kinda perplexed how you think you might be managing
memory more efficiently by pausing threads and doing stuff and then
un pausing.  I can't help but feel that you need to take a step back
and work out what you mean by managing memory efficiently, there are
lots of different ways of doing this, but given no information about
what you mean and you actual motivation for this others like myself
can't really point you in the right direction, the best I can say is
from the sound of it you are currently looking in the wrong place.

Robert.

On Thu, Jan 13, 2011 at 8:14 AM, Vincent Bourdier
vincent.bourd...@gmail.com  wrote:

Hi all,

Currently working on a way to manage the memory efficiently, I would 
like to

know what are the osg threads running ?

I mean there are some threads in the databasePager, depending on the
rendering threading mode there are threads for the render, the cull, or
whatever...

Did I miss something important ?
What are the osg threads ?

I would like to be able to make some king of pause on all treads 
to be
able to allocate the whole available memory for the process without 
having

some crash because a thread would be working (and so allocating memory)
during this operation.

Thanks for your help.

Regards,
Vincent.
___
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] PERSPECTIVE --FIELD OF VIEW

2011-01-13 Thread Steven Powers
I'll clarify this a little more...

fovX = fovY * Aspect

Normally you want the Aspect (or aspect ratio) field of view to equal the 
aspect ratio of the viewport.

Hope that helps

Cheers,
Steven

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





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


Re: [osg-users] [QUESTION]How Projection Referential Cameras Work in OSG?

2011-01-13 Thread Sergey Polischuk
Hi,

You can setup this type of projection as long as u can set projection matrix 
for camera, there are nothing special in them. You can get matrix for 
assymetric frustum projection with osg::Matrix::frustum().
There are support for stereoscopic stuff in osg, so osg can manage stereo 
cameras for you, all you need is provide parameters like eye separation, screen 
distance,  screen plane distance in scene coords (called fusion distance in 
osg) etc... Check osgviewer --help-env

Cheers,
Sergey

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





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


Re: [osg-users] different rendering states for different passes?

2011-01-13 Thread Wojciech Lewandowski

Hi Peter,

For situation like yours I would recommend overwriting 
osgShadow::LightSpacePerspectiveShadowMapVB and its internal ViewData class. 
Internal ViewData contains all the resources you need including 
shadowCamera. You may then add your own uniform or change any states used 
for shadow map prerender or final render. See 
StandardShadowMap::ViewData::init method to learn what states are set by 
these ShadowTechniques. Btw, if you look there you, will notice that shadow 
prerender pass overrides any program with fixed pipeline NULL program. So 
unless you set you shaders with PROTECTED attribute you may not need the 
uniform.


I think we already wrote about overriding ViewDependentShadowTechniques in 
the past. If you look carefully you would find posts with neccessary example 
code.


Cheers,
Wojtek




-Oryginalna wiadomość- 
From: Peter Amstutz

Sent: Thursday, January 13, 2011 4:48 PM
To: OpenSceneGraph Users
Subject: [osg-users] different rendering states for different passes?

Hello all, I have a bit of a knotty problem and was hoping for some
advice.  I am using OSG 2.8.3.

I am using osgShadow::LightSpacePerspectiveShadowMapVB, which renders
the scene in two passes; the prerender stage renders the shadow map, the
main state renders the scene.  My understanding is that the behavior of
the two passes is controlled by setting different shader programs at the
scene root, which sets the default shader program for the whole scene.

However, I am also using shader programs at some of my leaf nodes.  I
would like it to accept shadows, so it needs to read the shadowTexture
uniform.  However, this uniform is only available on the main drawing
pass, not the prerender pass (since the purpose of the prerender pass is
to generate the shadow texture).  The problem I am encountering is the
fact that my shader program does not have a way to distinguish between
executing the prerender pass and the main pass, and attempts to read the
(non-existent) shadowTexture uniform in the prerender pass, which causes
a GL error and results in the node not showing up at all.

I know the solution is to use different shaders for different passes,
but I haven't figured out the right way to set up OSG to do this at the
leaf.  Can anyone point me in the right direction?

--
Peter Amstutz
Senior Software Engineer
Technology Solutions Experts
Natick, MA
02131

___
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] NVidiaTextureTools integration moved from VPB to OSG

2011-01-13 Thread Robert Osfield
Hi All,

Back in September last year Fabien Lavignotte submitted support for
using NVidiaTexureTools SDK within VPB for compressing and generating
of mipmaps, this support neatly removes the need for a graphics
contexts to be required by VPB.  At the time I mentioned my desire to
see this type of functionality migrated into the core OSG as plugin.
Today I made it so :-)

To integrate NVTT with the I have introduced a new
osgDB::ImageProcessor interface class, that is equivalent to existing
osgDB::ReaderWriter class, but for plugins to implement image
processing for us instead of loading.  You can access any available
ImageProcessor implementation via osgDB::Registry via :

   osgDB::ImageProcessor* imageProcessor =
osgDB::Registry::instance()-getImageProcessor();

With the method the Registry will return the first available
ImageProcessor that has been registered with it, and if it doesn't
have available yet it'll try to load the nvtt plugin, and if this
succeeds it'll return ImageProcessor that it implements.  This design
allows applications to remain decoupled from NVTT, and allow other
implementations to be added down the line.

The NVTT plugin is only compiled if your have NVTT SDK installed on
your system, so there isn't any new dependency added to the OSG in
it's default build.

Now the NVTT support is integrated into OSG, VPB now longer needs to
explicitly link to NVTT, so I've replaced the previously hardwired
code to now use the new ImageProcessor interface provided by osgDB.
I've been testing VPB builds using the new mechanism and so far all
looks to be working as before.  The nice thing is that VPB is no
longer coupled to NVTT so there isn't any optional compile paths
required, VPB can determine at runtime whether it has access to an
ImageProcessor implementation and can fallback to using the old GL
context based compression code when none is available.

All these changes are now checked into svn/trunk of OSG and VPB
(you'll need to update both).

Wider testing would be appreciated ;-)

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


Re: [osg-users] [ANN] New book published - OpenSceneGraph 3.0 Beginner's Guide

2011-01-13 Thread Nan WANG
Hello dear OSG-community,

Later i will buy it ~Thanks Rui

Best regards,
Dromouse

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





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


Re: [osg-users] NVidiaTextureTools integration moved from VPB to OSG

2011-01-13 Thread Torben Dannhauer
Hi Robert,

does it work with Nvidia texture tools 2 (newest release) ?


Thank you!

Cheers,
Torben

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





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