Re: [osg-users] Render to texture (ping pong) - textures cleared after 2 iterations

2010-04-07 Thread J.P. Delport

Hi,

On 08/04/10 08:46, J.P. Delport wrote:

Hi,

I think the problem is the multiple attach calls on the camera. You have
to somehow clear the previous attachments and it's a bit tricky at the
moment, you have to mess with RenderStage. See here:

http://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/54990/focus=55025


another option is to make n cameras for your n output textures and 
switch between them using osg::Switch nodes. Then just wire up the 
correct textures as input for the next stage.


jp




rgds
jp

On 07/04/10 23:06, Luciano Pica wrote:

Hi,
I'm currently implementing parts of a distributed rendering framework
which uses OSG amongst other render nodes. Rendering, compositing (on
CPU) and displaying assembled frame buffers already works. One current
task is to move the composition of tiles/objects from CPU to GPU using
OSG.
I try to achieve this using 2 render target textures for ping pong
rendering like in the osggameoflife example, the current target attached
to the camera, the last target bound to a screen aligned quad facing the
camera. Tiles that yet have to be composited are bound to a smaller quad
in front of the screen aligned quad, thus the old rtt plus the new tile
are rendered to the current RTT. After each tile the textures are
swapped. For object composition based on depth this approach has to be
modified later, but the basic setup is the same. When the full frame is
assembled a second camera is used to read back the assembled frame
buffer.
All this works fine for the first two tiles, but then both RTTs are
cleared (completely black - not even clear color) before
rendering/composition continues. To narrow down the problem i tried the
same approach with more than 2 textures, but to my surprise it still
cleared all textures after two tiles and then again after every single
tile until all textures have been used once. Afterwards the pattern
repeated itself.
If only two tiles need to be composited the textures get cleared before
read back, for some other amounts of tiles a composited image with one
or two visible tiles is read back, the rest of the frame is just black.
Setting the OSGNOTIFYLEVEL to info or even debug did not reveal any
errors. The incoming and outgoing frame buffers aren't the problem
either, as reading back into such buffers works for our OSGRenderNode
and displaying such buffers on a screen aligned quad works for our
OSGDisplayNode as well.

Does anyone have any idea why my RTTs get cleared regularly? Hopefully
someone here can help me with this problem.

I'm using OSG 2.8.2 (with animationnode and ply plugin from the dev
branches) under Ubuntu 9.04 (64bit) with two NVidia 9600GT (each with
its own X screen to distribute render nodes to GPUs, but the
AssemblyNode is set to screen 0). I have attached the (in my opinion)
relevant code fragments below. I could attach the full source code for
this node if required, but unfortunately i cannot provide the rest of
the framework and its dependencies for testing as it is too large and
i'm not even sure whether i would be allowed to do that ;).

Best regards and thanks in advance,
Luciano


The following code is used for initializing images/textures and cameras:

//initialize images/textures
m_image = new osg::Image; //for read back after composition
m_tile_image = new osg::Image; //holds the newest tile to be composited
m_clear_image[0] = new osg::Image; //empty images used to
m_clear_image[1] = new osg::Image; //initialize rtts
m_image_tex = new osg::TextureRectangle; //tile texture
m_render_texture[0] = new osg::TextureRectangle; //rtt1
m_render_texture[1] = new osg::TextureRectangle; //rtt2

//m_type currently is GL_RGB
//m_x/y_resolution is the full frame resolution
//m_tile_width/height is the tile resolution
m_image->allocateImage(m_x_resolution, m_y_resolution, 1, m_type,
GL_UNSIGNED_BYTE); //full frame resolution
m_tile_image->allocateImage(m_tile_width, m_tile_height, 1, m_type,
GL_UNSIGNED_BYTE); //tile resolution
m_clear_image[0]->allocateImage(m_x_resolution, m_y_resolution, 1,
m_type, GL_UNSIGNED_BYTE);
m_clear_image[1]->allocateImage(m_x_resolution, m_y_resolution, 1,
m_type, GL_UNSIGNED_BYTE);

//tile texture
m_image_tex->setTextureSize(m_tile_width, m_tile_height);
m_image_tex->setInternalFormat(m_type);
m_image_tex->setImage(m_tile_image.get());

//RTTs
m_render_texture[0]->setTextureSize(m_x_resolution, m_y_resolution);
m_render_texture[0]->setInternalFormat(m_type);
m_render_texture[0]->setImage(m_clear_image[0].get());
m_render_texture[0]->setUnRefImageDataAfterApply(false);
m_render_texture[1]->setTextureSize(m_x_resolution, m_y_resolution);
m_render_texture[1]->setInternalFormat(m_type);
m_render_texture[1]->setImage(m_clear_image[1].get());
m_render_texture[1]->setUnRefImageDataAfterApply(false);

//set up camera to always show our textured quad without any rotation.
//FRAME_BUFFER is used for debug display, using FBO results in the same
texture clearing problem
{
m_tile_camera = new osg

[osg-users] Why can't I been added in user email list?

2010-04-07 Thread Rogerz Li
Hi,

I subscribed the applicant for several times.
But still not get any reply, even the confirming email.
What's wrong here?

Thank you!

Cheers,
Rogerz

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





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


Re: [osg-users] Fwd: Re: Color array optimization

2010-04-07 Thread Vincent Bourdier

Hi,

Thanks for your answers, I just made it and it runs well.

Regards,
   Vincent.

Le 07/04/2010 20:45, Jason Daly a écrit :

Ulrich Hertlein wrote:

Hi Tim,

On 7/04/10 15:12 , Tim Moore wrote:
   

 osg::Optimizer attempts to optimize for performance, not memory.
 The optimization you're proposing will have a negative impact on
 OpenGL performance.

How do you figure? Vincent would like to replace BIND_PER_VERTEX colors
with a BIND_OVERALL color where possible. That is a very common thing to
do in OSG and is, as I understand it, well supported even in OpenGL 3.0+
and OpenGL ES 2.0.
 


Looking at that again, I may have confused that with BIND_PER_PRIMITIVE.
   


Yes, BIND_PER_PRIMITIVE is bad.  BIND_OVERALL is fine.  I don't know 
of any Optimizer settings that do this, but it shouldn't be hard to 
write one.


--"J"


___
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] Ray intersection with ellipsoid model

2010-04-07 Thread John Vidar Larring

Hi Luc,

> I'd like to compute the intersection between a ray and an ellipsoid
> model object. I think that the best idea will be to compute the 4x4
> transformation that distorts a sphere into the ellipsoid model.
> However, I wonder how can I extract this matrix from the ellipsoid
> model ?

I've been offline for a couple of months with a home renovation project, 
and as I was scanning through the mail list (3000+) I saw you had not 
received an answer yet.


I've used distorted sphere method myself, and it is fairly simple. If 
you already have a raySphereIntersect routine, you can wrap it in 
something like the following:


bool rayEarthIntersect(osg::Vec3d origin, osg::Vec3d ray, osg::Vec3d& 
intersection)

{
double p = ellipsoid.getRadiusPolar();
double e = getRadiusEquator();

// Create a matrix composed the 3 axis multiplied by respective
// radii. OSG is z-axis up, thus multply z-axis with polar radius
// and x & y axis with equator radius
osg::Matrixd ellipsoid_scale(e, 0, 0, 0,
 0, e, 0, 0,
 0, 0, p, 0,
 0, 0, 0, 1);

osg::Matrixd invert_scale(osg::Matrixd::inverse(ellipsoid_scale));

// Apply inverse ellipsoid scale to transform origin and ray
origin = invert_scale.postMult(origin);
ray = invert_scale.postMult(ray);

// Use the transformed ray vector and origin point to do
// intersection test with a sphere with center at 0,0,0 and radius=1
osg::Vec3d intersection;
if(raySphereIntersect(origin, ray, osg::Vec3d(0,0,0), 1.0, 
interection))

{
// Transform intersection point to original ellipsoid
intersection = ellipsoid_scale.postMult(intersection);
return true;
}
else
return false;
}

Best regards,
John

Luc Claustres wrote:

Hi,

I'd like to compute the intersection between a ray and an ellipsoid model 
object. I think that the best idea will be to compute the 4x4 transformation 
that distorts a sphere into the ellipsoid model. However, I wonder how can I 
extract this matrix from the ellipsoid model ?

Any other (simple) idea is also welcome...

Thank you!

Cheers,
Luc

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





___
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] :) Video Capture Handler for osg::View

2010-04-07 Thread J.P. Delport

Hi,

On 08/04/10 03:41, David Glenn wrote:


mgb_osg wrote:

Easiest way is probably just to write N jpegs named image000.jpg to
imageN.jpg and then use virtualdub to convert them into a movie in
whatever format you want.




Since I'm using Linux, I'm thinking of using somthing like ffmpeg
(that was segested to me) or something else. I'm not sure that
vertualdub has ben ported to Linux yet - I think not!


You can use mencoder to make jpegs/other images into a video. E.g.

mencoder mf://*.jpg -mf w=512:h=512:fps=30:type=jpg -ovc lavc -oac copy 
-o my.avi


Add other options as required.

rgds
jp




mgb_osg wrote:


Writing an MJPG movie, where each frame is just a jpeg, isn't much
harder.




Yea, I did something like that back in art school when I did my
animation project years ago!

The only thing I'm worrying about is that I'm not just thinking about
making 20 sec. of video. I'm sure that it will be tested to up to an
hour.

One of the things I have to worry about is the frame rate. I don't
need to go any more than 30/sec. for what I need it for. I have to
add a delay timer for the refresh rate.

Next I have to freeze the frame size to something like 740X480 for
standard NTSC format.

D Glenn

 D Glenn (a.k.a David Glenn) - Join the Navy
and See the World ... from your Desk!

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





___ 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


Re: [osg-users] Render to texture (ping pong) - textures cleared after 2 iterations

2010-04-07 Thread J.P. Delport

Hi,

I think the problem is the multiple attach calls on the camera. You have 
to somehow clear the previous attachments and it's a bit tricky at the 
moment, you have to mess with RenderStage. See here:


http://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/54990/focus=55025

rgds
jp

On 07/04/10 23:06, Luciano Pica wrote:

Hi,
I'm currently implementing parts of a distributed rendering framework
which uses OSG amongst other render nodes. Rendering, compositing (on
CPU) and displaying assembled frame buffers already works. One current
task is to move the composition of tiles/objects from CPU to GPU using OSG.
I try to achieve this using 2 render target textures for ping pong
rendering like in the osggameoflife example, the current target attached
to the camera, the last target bound to a screen aligned quad facing the
camera. Tiles that yet have to be composited are bound to a smaller quad
in front of the screen aligned quad, thus the old rtt plus the new tile
are rendered to the current RTT. After each tile the textures are
swapped. For object composition based on depth this approach has to be
modified later, but the basic setup is the same. When the full frame is
assembled a second camera is used to read back the assembled frame buffer.
All this works fine for the first two tiles, but then both RTTs are
cleared (completely black - not even clear color) before
rendering/composition continues. To narrow down the problem i tried the
same approach with more than 2 textures, but to my surprise it still
cleared all textures after two tiles and then again after every single
tile until all textures have been used once. Afterwards the pattern
repeated itself.
If only two tiles need to be composited the textures get cleared before
read back, for some other amounts of tiles a composited image with one
or two visible tiles is read back, the rest of the frame is just black.
Setting the OSGNOTIFYLEVEL to info or even debug did not reveal any
errors. The incoming and outgoing frame buffers aren't the problem
either, as reading back into such buffers works for our OSGRenderNode
and displaying such buffers on a screen aligned quad works for our
OSGDisplayNode as well.

Does anyone have any idea why my RTTs get cleared regularly? Hopefully
someone here can help me with this problem.

I'm using OSG 2.8.2 (with animationnode and ply plugin from the dev
branches) under Ubuntu 9.04 (64bit) with two NVidia 9600GT (each with
its own X screen to distribute render nodes to GPUs, but the
AssemblyNode is set to screen 0). I have attached the (in my opinion)
relevant code fragments below. I could attach the full source code for
this node if required, but unfortunately i cannot provide the rest of
the framework and its dependencies for testing as it is too large and
i'm not even sure whether i would be allowed to do that ;).

Best regards and thanks in advance,
Luciano


The following code is used for initializing images/textures and cameras:

//initialize images/textures
m_image = new osg::Image; //for read back after composition
m_tile_image = new osg::Image; //holds the newest tile to be composited
m_clear_image[0] = new osg::Image; //empty images used to
m_clear_image[1] = new osg::Image; //initialize rtts
m_image_tex = new osg::TextureRectangle; //tile texture
m_render_texture[0] = new osg::TextureRectangle; //rtt1
m_render_texture[1] = new osg::TextureRectangle; //rtt2

//m_type currently is GL_RGB
//m_x/y_resolution is the full frame resolution
//m_tile_width/height is the tile resolution
m_image->allocateImage(m_x_resolution, m_y_resolution, 1, m_type,
GL_UNSIGNED_BYTE); //full frame resolution
m_tile_image->allocateImage(m_tile_width, m_tile_height, 1, m_type,
GL_UNSIGNED_BYTE); //tile resolution
m_clear_image[0]->allocateImage(m_x_resolution, m_y_resolution, 1,
m_type, GL_UNSIGNED_BYTE);
m_clear_image[1]->allocateImage(m_x_resolution, m_y_resolution, 1,
m_type, GL_UNSIGNED_BYTE);

//tile texture
m_image_tex->setTextureSize(m_tile_width, m_tile_height);
m_image_tex->setInternalFormat(m_type);
m_image_tex->setImage(m_tile_image.get());

//RTTs
m_render_texture[0]->setTextureSize(m_x_resolution, m_y_resolution);
m_render_texture[0]->setInternalFormat(m_type);
m_render_texture[0]->setImage(m_clear_image[0].get());
m_render_texture[0]->setUnRefImageDataAfterApply(false);
m_render_texture[1]->setTextureSize(m_x_resolution, m_y_resolution);
m_render_texture[1]->setInternalFormat(m_type);
m_render_texture[1]->setImage(m_clear_image[1].get());
m_render_texture[1]->setUnRefImageDataAfterApply(false);

//set up camera to always show our textured quad without any rotation.
//FRAME_BUFFER is used for debug display, using FBO results in the same
texture clearing problem
{
m_tile_camera = new osg::Camera();
m_tile_camera->setGraphicsContext(gc.get());
m_tile_camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER)
m_tile_camera->setClearMask(GL_DEPTH_BUFFER_BIT);
m_tile_camera->setClearColor(osg::Vec4(0.0f, 0.0f, 1.0f

Re: [osg-users] AutoTransform

2010-04-07 Thread John Vidar Larring

Hi Sunil,

>  I would like to know as to what is the difference between
> /ROTATE_TO_SCREEN/ /ROTATE_TO_CAMERA/ in the AutoTransform class.

ROTATE_TO_SCREEN will rotate the sub-graph to "face" the view plane, 
while ROTATE_TO_CAMERA will rotate the sub-graph to "face" the camera's 
eye point.


Check out the osgautotransform example: 
http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph/trunk/examples/osgautotransform/osgautotransform.cpp


> I was also wondering if there is some inbuilt feature to place an 
axis  > in the corner of the screen indicating the world axis .. as is 
common

> in most cad applications...

Not that i know of, but look at osgautotransform example above:)

Best regards,
John

Sunil S Nandihalli wrote:

Hello Everybody,
 I would like to know as to what is the difference between

/ROTATE_TO_SCREEN/ /ROTATE_TO_CAMERA/ 
in the AutoTransform class. I was also wondering if there is some 
inbuilt feature to place an axis in the corner of the screen indicating 
the world axis .. as is common in most cad applications..

Thanks in advance...
Sunil.

--
This email was Anti Virus checked by Astaro Security Gateway. 
http://www.astaro.com


--
This message has been scanned for viruses and
dangerous content by *MailScanner* , and is
believed to be clean.




___
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] Help for control of Text Labels on HUD type display OFF/ON/BLINK and text

2010-04-07 Thread tim paige
Hi, tim
This is just a note from tim to yourself...
Just checking on the basics you want to accomplish...

You have some persistent data in the form of labels that you would like to 
enable or disable depending on mode/state or a certain menu configuration.

You would also like to enable/disable an individual text lable in that group 
and you presumed that you might be able to do that with osg::switch.

While you found you could enable/disable the whole group when a geode 
containing multiple text lables was added to a switch and even that disabliing 
all children in a group was also a possibility... you found that you could not 
add a text to a switch nor find a way to enable/disable one text child as part 
of a parent geode, which you further assumed was the correct kind of place to 
add a text child as a drawable 

So you wonder how enable/disable text from rendering at will without deleting 
the object or replacing the text with spaces or non-text, because you'd like to 
re-use the group of labels next time that page of information is used. 

Maybe it should just be re-drawn from scratch, but you're wondering how to do 
it, h???

How to do that same thing like setSingleChildON() or setChildValue() or the 
like when those functions aren't available or want a different type of pointer 
(like a node*) when you have a text added to a geode as a drawable? What makes 
text different than those other things you've been switching ON/OFF like 
graphics models and the like?

good luck with that... I can't help you at this time, but... 
hang in there... simple things may come to those who wait...

Have fun!

Cheers,
tim

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





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


Re: [osg-users] :) Video Capture Handler for osg::View

2010-04-07 Thread Martin Beckett
You might struggle to output 30fps with many video codecs
Just writing jpegs should be ok.  640x480 apprx 70k * 30fps = 2MB/s
Of course that is 10,000 frames/hour!

Martin

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





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


Re: [osg-users] :) Video Capture Handler for osg::View

2010-04-07 Thread David Glenn

mgb_osg wrote:
> Easiest way is probably just to write N jpegs named image000.jpg to 
> imageN.jpg and then use virtualdub to convert them into a movie in whatever 
> format you want.
> 


Since I'm using Linux, I'm thinking of using somthing like ffmpeg (that was 
segested to me) or something else. I'm not sure that vertualdub has ben ported 
to Linux yet - I think not!


mgb_osg wrote:
> 
> Writing an MJPG movie, where each frame is just a jpeg, isn't much harder.
> 


Yea, I did something like that back in art school when I did my animation 
project years ago! 

The only thing I'm worrying about is that I'm not just thinking about making 20 
sec. of video. I'm sure that it will be tested to up to an hour.

One of the things I have to worry about is the frame rate. I don't need to go 
any more than 30/sec. for what I need it for. I have to add a delay timer for 
the refresh rate.  

Next I have to freeze the frame size to something like 740X480 for standard 
NTSC format.

D Glenn


D Glenn (a.k.a David Glenn) - Join the Navy and See the World ... from your 
Desk!

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





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


[osg-users] Possible wrong rotation in osgSim::ScalarBar

2010-04-07 Thread Murray Curtis

G'day

I'm implementing a display using the osgSim::scalarbar.  When I set
the orientation to vertical the geode disappears.

In osgSim::ScalarBar::createDrawables() the vertical rotate matrix is:

  matrix = osg::Matrix::rotate(osg::DegreesToRadians(90.0f),1.0f,0.0f,0.0f) * 
osg::Matrix::translate(_position);

which I understand to rotate around the X axis.  But the verticies are
laid out on the XY plane so shouldn't the rotation be around the Z axis?
Like this:

  matrix = osg::Matrix::rotate(osg::DegreesToRadians(90.0f),0.0f,0.0f,1.0f) * 
osg::Matrix::translate(_position);

This change fixed it for me.  Am I right or have I completely missed something 
here?



On a related note; in examples/osgscalarbar.cpp there is a curious comment:
osg::Matrixd matrix(osg::Matrixd::scale(1000,1000,1000) * 
osg::Matrixd::translate(120,10,0));
 // I've played with these values a lot and it seems to work, but I have no 
idea why

I'm guessing the comment refers to the large values for scale, but (I think) 
thats
just because the default width for the bar is only 1.0


Cheers
Murray
Tag Systems
Melbourne
Australia


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


[osg-users] Render to texture (ping pong) - textures cleared after 2 iterations

2010-04-07 Thread Luciano Pica

Hi,
I'm currently implementing parts of a distributed rendering framework 
which uses OSG amongst other render nodes. Rendering, compositing (on 
CPU) and displaying assembled frame buffers already works. One current 
task is to move the composition of tiles/objects from CPU to GPU using OSG.
I try to achieve this using 2 render target textures for ping pong 
rendering like in the osggameoflife example, the current target attached 
to the camera, the last target bound to a screen aligned quad facing the 
camera. Tiles that yet have to be composited are bound to a smaller quad 
in front of the screen aligned quad, thus the old rtt plus the new tile 
are rendered to the current RTT. After each tile the textures are 
swapped. For object composition based on depth this approach has to be 
modified later, but the basic setup is the same. When the full frame is 
assembled a second camera is used to read back the assembled frame buffer.
All this works fine for the first two tiles, but then both RTTs are 
cleared (completely black - not even clear color) before 
rendering/composition continues. To narrow down the problem i tried the 
same approach with more than 2 textures, but to my surprise it still 
cleared all textures after two tiles and then again after every single 
tile until all textures have been used once. Afterwards the pattern 
repeated itself.
If only two tiles need to be composited the textures get cleared before 
read back, for some other amounts of tiles a composited image with one 
or two visible tiles is read back, the rest of the frame is just black.
Setting the OSGNOTIFYLEVEL to info or even debug did not reveal any 
errors. The incoming and outgoing frame buffers aren't the problem 
either, as reading back into such buffers works for our OSGRenderNode 
and displaying such buffers on a screen aligned quad works for our 
OSGDisplayNode as well.


Does anyone have any idea why my RTTs get cleared regularly? Hopefully 
someone here can help me with this problem.


I'm using OSG 2.8.2 (with animationnode and ply plugin from the dev 
branches) under Ubuntu 9.04 (64bit) with two NVidia 9600GT (each with 
its own X screen to distribute render nodes to GPUs, but the 
AssemblyNode is set to screen 0). I have attached the (in my opinion) 
relevant code fragments below. I could attach the full source code for 
this node if required, but unfortunately i cannot provide the rest of 
the framework and its dependencies for testing as it is too large and 
i'm not even sure whether i would be allowed to do that ;).


Best regards and thanks in advance,
Luciano


The following code is used for initializing images/textures and cameras:

//initialize images/textures
m_image = new osg::Image; //for read back after composition
m_tile_image = new osg::Image; //holds the newest tile to be composited
m_clear_image[0] = new osg::Image; //empty images used to
m_clear_image[1] = new osg::Image; //initialize rtts
m_image_tex = new osg::TextureRectangle; //tile texture
m_render_texture[0] = new osg::TextureRectangle; //rtt1
m_render_texture[1] = new osg::TextureRectangle; //rtt2

//m_type currently is GL_RGB
//m_x/y_resolution is the full frame resolution
//m_tile_width/height is the tile resolution
	m_image->allocateImage(m_x_resolution, m_y_resolution, 1, m_type, 
GL_UNSIGNED_BYTE); //full frame resolution
	m_tile_image->allocateImage(m_tile_width, m_tile_height, 1, m_type, 
GL_UNSIGNED_BYTE); //tile resolution
	m_clear_image[0]->allocateImage(m_x_resolution, m_y_resolution, 1, 
m_type, GL_UNSIGNED_BYTE);
	m_clear_image[1]->allocateImage(m_x_resolution, m_y_resolution, 1, 
m_type, GL_UNSIGNED_BYTE);


//tile texture
m_image_tex->setTextureSize(m_tile_width, m_tile_height);
m_image_tex->setInternalFormat(m_type);
m_image_tex->setImage(m_tile_image.get());

//RTTs
m_render_texture[0]->setTextureSize(m_x_resolution, m_y_resolution);
m_render_texture[0]->setInternalFormat(m_type);
m_render_texture[0]->setImage(m_clear_image[0].get());
m_render_texture[0]->setUnRefImageDataAfterApply(false);
m_render_texture[1]->setTextureSize(m_x_resolution, 
m_y_resolution);

m_render_texture[1]->setInternalFormat(m_type);
m_render_texture[1]->setImage(m_clear_image[1].get());
m_render_texture[1]->setUnRefImageDataAfterApply(false);

//set up camera to always show our textured quad without any rotation.
//FRAME_BUFFER is used for debug display, using FBO results in the same 
texture clearing problem

{
m_tile_camera = new osg::Camera();
m_tile_camera->setGraphicsContext(gc.get());
m_tile_camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER)
m_tile_camera->setClearMask(GL_DEPTH_BUFFER_BIT);
m_tile_camera->setClearColor(osg::Vec4(0.0f, 0.0f, 1.0f, 1.0f));

m_tile_camera->setRefere

Re: [osg-users] Color array optimization

2010-04-07 Thread Martin Beckett
Don't know if it applies to OSG, but a common speedup with OpenGL used to be to 
sort by vertex color so you draw all the vertex of the same color at once.

That might be out of date with modern cards and VBOs but shouldn't be too 
difficult to implement.

Martin

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





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


[osg-users] [ANN] OpenSceneGraph on Twitter

2010-04-07 Thread Roland Smeenk
OpenSceneGraph can be found on twitter here:
http://twitter.com/OpenSceneGraph

Currently it is fed by the OpenSceneGraph developer blog:
http://blog.openscenegraph.org/

I can also add feeds manually like I just did with the OSG 2.8.3 release.

kind regards,

Roland Smeenk

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





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


Re: [osg-users] Support vendor specific 3D APIs - any interest here?

2010-04-07 Thread Wojciech Lewandowski


Hi Jan,

Have you seen most recent NVAPI release specs Christian mentioned about ? 
There is definitely more interesting stuff for Direct3D game developers. 
Some of the stereovison stuff in there, seems useful only when accessed from 
inside Direct3D application.  Unfortunately this does not help us much in 
OpenGL.


Cheers,
Wojtek

--
From: "Jan Ciger" 
Sent: Wednesday, April 07, 2010 7:30 PM
To: "OpenSceneGraph Users" 
Subject: Re: [osg-users] Support vendor specific 3D APIs - any interest 
here?



-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello,

On 2010-04-06 14:30, Wojciech Lewandowski wrote:


That was my impression as well. 3D stereoscopic api seems to be created
for Direct3D developers to check if  Stereo is running and
override/modify its parameters. The API is probably used to provide
native 3D Vision support from a DirectX game. I guess its used by
recently advertrised S3D aware Unreal.


Not really - the API is intended for tools like the NVIDIA control
panel, allowing you to tweak settings of the driver. It has nothing to
do with stereo as such, it actually predates the 3D Vision glasses by
quite a bit. It is used by the NVIDIA tools.


I am curiouse if  NVAPI gives access to shutter glasses. If shutter
control is possible and possible is 120 hz refresh rate through display
settings, one could try emulate 3D stereo effect by alternate eye view
rendering. But thats a quite tricky solution either.


No, there are, if I recall correctly, only 3 functions allowing you to
change anything stereo-related: turn stereo on/off, set the eye
separation and set the focal distance (the distance of the eye from the
image plane). That is all.

The rest of the API is not related to 3D at all.

Regards,

Jan
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFLvMFCn11XseNj94gRApEUAKDLdYBt52hVHa6M5vc4RjLd9geV/wCgqFhb
Vg3qUrRa4OKn4pcUZKcWqSk=
=VjSL
-END PGP SIGNATURE-
___
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 QT example

2010-04-07 Thread Ben Cain

mgb_osg wrote:
> Not sure if it's what you mean but you can easily create multiple OSGWidget 
> windows with the same osg scene data in each of them and have different views 
> into the same model in different windows.
> 

There are issues thut must be addressed: multi-threading, thread-safety, Qt 
keyboard mapping, and context management.  The Delta3D dtQt plug-in provides a 
wrapper for these issues.  I was wondering if someone had a simple example 
using these (or similar).

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





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


Re: [osg-users] Fwd: Re: Color array optimization

2010-04-07 Thread Jason Daly

Ulrich Hertlein wrote:

Hi Tim,

On 7/04/10 15:12 , Tim Moore wrote:
  

osg::Optimizer attempts to optimize for performance, not memory.
The optimization you're proposing will have a negative impact on
OpenGL performance.

How do you figure? Vincent would like to replace BIND_PER_VERTEX colors
with a BIND_OVERALL color where possible. That is a very common thing to
do in OSG and is, as I understand it, well supported even in OpenGL 3.0+
and OpenGL ES 2.0.



Looking at that again, I may have confused that with BIND_PER_PRIMITIVE.
  


Yes, BIND_PER_PRIMITIVE is bad.  BIND_OVERALL is fine.  I don't know of 
any Optimizer settings that do this, but it shouldn't be hard to write one.


--"J"

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


Re: [osg-users] Support vendor specific 3D APIs - any interest here?

2010-04-07 Thread Jan Ciger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello,

On 2010-04-06 14:30, Wojciech Lewandowski wrote:

> That was my impression as well. 3D stereoscopic api seems to be created
> for Direct3D developers to check if  Stereo is running and
> override/modify its parameters. The API is probably used to provide
> native 3D Vision support from a DirectX game. I guess its used by
> recently advertrised S3D aware Unreal.

Not really - the API is intended for tools like the NVIDIA control
panel, allowing you to tweak settings of the driver. It has nothing to
do with stereo as such, it actually predates the 3D Vision glasses by
quite a bit. It is used by the NVIDIA tools.

> I am curiouse if  NVAPI gives access to shutter glasses. If shutter
> control is possible and possible is 120 hz refresh rate through display
> settings, one could try emulate 3D stereo effect by alternate eye view
> rendering. But thats a quite tricky solution either.

No, there are, if I recall correctly, only 3 functions allowing you to
change anything stereo-related: turn stereo on/off, set the eye
separation and set the focal distance (the distance of the eye from the
image plane). That is all.

The rest of the API is not related to 3D at all.

Regards,

Jan
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFLvMFCn11XseNj94gRApEUAKDLdYBt52hVHa6M5vc4RjLd9geV/wCgqFhb
Vg3qUrRa4OKn4pcUZKcWqSk=
=VjSL
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Newbie questions...

2010-04-07 Thread Ku Krapox
(the link of the tutorial)

http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/KeyboardHandler

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





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


Re: [osg-users] Newbie questions...

2010-04-07 Thread Ku Krapox
Hi Ulrich ,

Thanks for your reply!

My problems with callbacks are solved.

As for the keyboard handling, well, I think you're right, the addFunction 
method doesn't seem to belong to any osg class... but it's not part of my 
framework either!
Actually I just followed the "official" Keyboard Handler tutorial...
(Talking about this, I don't know if it's me but I find these tutorials quite 
poor and confusing... :?)


Anyway, if you have any idea... :) 


Cheers,
Ku

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





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


Re: [osg-users] 2.8.3 released!

2010-04-07 Thread Paul Martz

Robert Osfield wrote:

I've update the SpreadingTheNews wiki page with your entries for
opengl.org and khronos.org having been done, there are lots more to
do.  Community now is your time to dive in an post the news to your
favourite sites, just add (done) to each site you pass the news on to:

   
http://www.openscenegraph.org/projects/osg/wiki/Community/Tasks/SpreadingTheNews


Sheesh, forgot about that.

Yes, I'll echo Robert's plea for community help in pushing this out, and thanks 
to everyone in advance.


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


Re: [osg-users] Add a color node in the scenegraph?

2010-04-07 Thread Paul Martz

Vincent Bourdier wrote:

Hello,

You should try just adding a material on each PAT.
If I'm right, material will overpass the color of the geode... If anyone 
can confirm :-[


That will work if lighting is on. If lighting is off, set a BlendColor at each 
PAT and then configure blending on the Drawable to reference the blend color.



Le 07/04/2010 11:33, Benjamin GODIN a écrit :

Hello,

I have a scene with one object but represented many times.
My graph is something like that :
[Image: http://img576.imageshack.us/img576/1522/osg.png ]

I want to give different colors to the different objects. The method 
I've found is setColor on a ShapeDrawable but that means I need to 
create many instances of this object.


Is there any way I can add the color in the scene graph (as a node)?

Thanks. :)[/img]



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


Re: [osg-users] Support vendor specific 3D APIs - any interest here?

2010-04-07 Thread Jan Ciger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 2010-04-05 14:48, Christian Buchner wrote:
> Hi,
> 
...
> But nVidia have created a proprietary API (NVAPI) with which it is
> possible to display pretty much anything with shuttered glasses. Would
> there be any interest to fit OpenSceneGraph with a capability to
> render to 3DVision enabled displays with non-Quadro graphics cards?

Actually that particular API is of little use. You can control the same
settings with it that you have in the nVidia control panel, but no
rendering is done through it. So you can set up things like eye
separation or control the fans of your GPU, but that is all you can do
with it. Furthermore, the documentation of that API is really bad :(

Your program still has to use Direct3D for rendering if you want to
benefit from the drivers - enabling stereo using NVAPI will do nothing
with OpenGL rendering, because the driver will not modify the camera
matrices for you as it does for Direct3D (which has no support for
stereo of its own).

So, unless NVIDIA decides to make a stereo-capable OpenGL driver for
their non-Quadro cards (extremely unlikely), this is not going to help
you one iota.

Regards,

Jan

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFLvLyen11XseNj94gRAqI0AJwI/HOCbP/bviIXNjoB1gRjB3RTbwCfVVCH
A96nVcHGIwW058G20lIHCHk=
=jCFX
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] 2.8.3 released!

2010-04-07 Thread Chris 'Xenon' Hanson
On 4/7/2010 9:57 AM, Robert Osfield wrote:
>
> http://www.openscenegraph.org/projects/osg/wiki/Community/Tasks/SpreadingTheNews

  I hit Digg and Reddit and posted it to my Twitter, Facebook and Linkedin 
pages. I'm
s social media! ;)

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"There is no Truth. There is only Perception. To Perceive is to Exist." - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] 2.8.3 released!

2010-04-07 Thread Jean-Sébastien Guay

Hi all,


I've update the SpreadingTheNews wiki page with your entries for
opengl.org and khronos.org having been done, there are lots more to
do.  Community now is your time to dive in an post the news to your
favourite sites, just add (done) to each site you pass the news on to:


http://www.openscenegraph.org/projects/osg/wiki/Community/Tasks/SpreadingTheNews


Did vroot.org as usual since I know the webmaster. Should be approved 
and show up on the main page soon.


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


Re: [osg-users] 2.8.3 released!

2010-04-07 Thread Robert Osfield
Hi Paul, et. al,

On Tue, Apr 6, 2010 at 4:58 PM, Paul Martz  wrote:
>> I understand how much effort goes into corralling everyone, reviewing
>> and merging fixes, doing testing - kudos.
>
> It's a lot of work. I've been tracking my hours on this and it's like two
> full 40 hour weeks of effort. I should be thanking you, though, as I know
> you put in 10 times this much. So, thanks, and keep up the good work.

For minor point releases two full weeks is probably around about usual
cost, pretty daunting.  It's hard work, but I kinda enjoy the process
of getting a release out the door, working cooperatively with lots of
different people is rewarding.

> Excellent, thanks. Looks great! I'll push the press release out to
> opengl.org and khronos.org ASAP. I think the webmaster is in the U.K. so I
> want to get it there before he signs off for the night.

Great, spotted to opengl.org link.   Mattias Helsing has provide
binaries for VS8, so I've posted these on the downloads page as well.

I've update the SpreadingTheNews wiki page with your entries for
opengl.org and khronos.org having been done, there are lots more to
do.  Community now is your time to dive in an post the news to your
favourite sites, just add (done) to each site you pass the news on to:

   
http://www.openscenegraph.org/projects/osg/wiki/Community/Tasks/SpreadingTheNews

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


Re: [osg-users] WriteImageFile black

2010-04-07 Thread Thomas PATTOU

Chris 'Xenon' Hanson wrote:
> 
> Do you KNOW the pixel format of your display for sure? It could be something 
> odd that
> most plugins can't handle without conversion.
> 


I'm pretty sure it's good, using GL_RGB; even if that was not the case, I also 
tried some GL_RGBA, GL_BGRA,...

Anyways, after tracing a bit (very hard, I only have release build because of 
osgART ), I found out that when I was trying to write to file, I actually had 
the good dimensions but the graphic context I was trying to write was NULL, so 
no plugin in the world (let's say universe  :D ) can managed to fix that ;)

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





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


Re: [osg-users] WriteImageFile black

2010-04-07 Thread Chris 'Xenon' Hanson
On 4/7/2010 8:44 AM, Thomas PATTOU wrote:
> Unfortunately, I tried today with others formats (png, tga, bmp), and either 
> I got some plugin problems (plugin not found whereas it actually IS at the 
> right place), 

  Well, that's suspicious by itself.

> or I ended with the same black rectangle.

  probably need to trace through one of the simpler plugins and see if it's 
getting fed
black imagery somehow, or if it's botched up in conversion or something.

  Do you KNOW the pixel format of your display for sure? It could be something 
odd that
most plugins can't handle without conversion.

> Thanks anyways.

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"There is no Truth. There is only Perception. To Perceive is to Exist." - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] WriteImageFile black

2010-04-07 Thread Jean-Sébastien Guay

Hi Thomas,


Unfortunately, I tried today with others formats (png, tga, bmp), and either I 
got some plugin problems (plugin not found whereas it actually IS at the right 
place), or I ended with the same black rectangle.


I suspect what was happening was that the plugin didn't support writing 
(only reading) but the error message was the generic "plugin not found"...



I just want to thank again  [Arrow] Skylark, because I actually managed to 
derive the ScreenCaptureHandler (not even needed to look at your code) to make 
it behave how I want. Mine is now taking sequential screenshots during a given 
time whenever I press the corresponding key.


Glad I could help!

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] PagedLOD

2010-04-07 Thread Vincent Bourdier

Hi all,

I'm currently working with a huge set of PagedLOD nodes and I would like 
to neutralize some of them, forcing the HIGH level to be loaded while I 
didn't tell him to restore the LOD previous state.


My code is based on the rangeList  : there is only 2 children (Low and 
High levels) and I modify the range list from

[0 , 400] [400, 1e20]
to
[0 , 0] [0, 1e20]
using a nodeVisitor traversion the PagedLOD nodes.

But, there are still some Low level nodes visible in the scene...

I would like to be sure they won't be loaded and that the High level 
will be.

How can I do that ?

Thanks.

Regards,
   Vincent

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


Re: [osg-users] WriteImageFile black

2010-04-07 Thread Thomas PATTOU

sumit wrote:
> Hi Thomas,
> 
> Your way capturing screenshot is working on my system at least. Probably
> there is problem with the plug-in. Set OSG_NOTIFY_LEVEL=DEBUG, and see
> whether you are getting any errors or warnings, also try to play with
> different formats. This particular format may not be supported by your
> plug-in.
> 
> Cheers,
> Sumit
> 


Unfortunately, I tried today with others formats (png, tga, bmp), and either I 
got some plugin problems (plugin not found whereas it actually IS at the right 
place), or I ended with the same black rectangle.
Thanks anyways.


I just want to thank again  [Arrow] Skylark, because I actually managed to 
derive the ScreenCaptureHandler (not even needed to look at your code) to make 
it behave how I want. Mine is now taking sequential screenshots during a given 
time whenever I press the corresponding key.

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





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


[osg-users] osg::Refererenced issue with osgAnimation : writing UniqueIDs at _refCount of min 2

2010-04-07 Thread Peter Wrobrl
Hi,

The FileWrite Systems puts an entry of UniqueIds into osg files only if the 
_refCount of a referenced object is equal or greater then 2. Those Ids are 
required in osgAnimation Skinning System, so that the linkVisitor can link 
bones, skeletton and rigGeomtry.

Usually all the bones in a skeletton have a _refCount of 1, if their 
ref_pointer have been destroyed, so no IDs in file.

Is there any clean sollution to this issue, or do I have to traverse the scene 
graphe and increase the _refCounter manually before writting out ?

Thank you!

Cheers,
PP !!!

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





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


Re: [osg-users] Static linking with user pulgins AND dynamic OSG?

2010-04-07 Thread Sukender
Forgot to mention: under MSVC, I've put /OPT:NOREF to avoid symbols from being 
excluded when linking static libs.

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/

- "Sukender"  a écrit :

> Hi Laurens, hi all,
> 
> Hum, could you give me a hint, please? If I write:
>   class BBB : public osgDB::ReaderWriter {... blah blah blah ...};
>   REGISTER_OSGPLUGIN(bbb, BBB)
> in "bbb.cpp" (in my main exe), then the "BBB" reader/writer is
> constructed and added to the registry when process loads.
> 
> However if I put that .cpp in a static lib, which is linked to my main
> exe, then the "BBB" reader/writer is never built (nor added to the
> registry).
> As far as I know, static libs are roughly a bunch of objects! Were's
> the difference?
> 
> And of course, using USE_OSGPLUGIN() doesn't work.
> 
> 
> BTW, The feature you're mentioning seems interesting. Is there any
> chance you release the code, under a licence or another?
> Cheers,
> 
> Sukender
> PVLE - Lightweight cross-platform game engine -
> http://pvle.sourceforge.net/
> 
> - "Laurens Voerman"  a écrit :
> 
> > Hi Sukender,
> >
> > my modified dds reader is able to skip reading high res mipmaps from
> > the
> > dds file.
> > For the version you are using, I am guessing that your link errors
> > might
> > originate in compliling the static plugin lib with
> OSG_LIBRARY_STATIC
> > defined. And/Or linking the plugin with the osg libs.
> > Mixing debug and release versions will also create confusing link
> > errors.
> >
> > Of course the USE_OSGPLUGIN(ext1) must be mirrored by a
> > REGISTER_OSGPLUGIN(ext1,myReaderWriterExtention1)
> >
> > Laurens.
> >
> > Sukender wrote:
> > > Hi Laurens,
> > >
> > > This is what I mean. Glad to see it can work! But I have:
> > > - A static lib
> > > - No dllexport stuff
> > > - Two USE_PLUGIN() in the main exe
> > >
> > > And I have linker errors.
> > > Any idea?
> > >
> > > BTW, what your modified plugin does? I had problems with DDS (saw
> > some 3rd-party apps read RGB as BGR and vice-versa).
> > > Cheers,
> > >
> > > Sukender
> > > PVLE - Lightweight cross-platform game engine -
> > http://pvle.sourceforge.net/
> > >
> > > - "Laurens Voerman"  a écrit :
> > >
> > >> Hi Sukender,
> > >> I'm very confused about Robert's reply, because it's working fine
> > for
> > >>
> > >> me. I am using a modified dds reader linked into my app, which
> > takes
> > >> precedence over any osgdb_dds.dll because it registers on
> startup.
> > >> This
> > >> can be done by simply adding the (modified) ReaderWriterDDS.cpp
> to
> > the
> > >>
> > >> project producing the executable, in this version there is no
> need
> > for
> > >>
> > >> USE_PLUGIN() - it will cause a link error.
> > >> If you compile the plugin into a static link lib, you need the
> > >> USE_PLUGIN() and link to the lib.
> > >>
> > >> This can work because the plugins I am using are not exporting
> any
> > >> symbols, so there is no __declspec(dllexport) stuff in the way.
> > >>
> > >> Laurens.
> > >>
> > >> Robert Osfield wrote:
> > >>> Hi Sukender,
> > >>>
> > >>> On Tue, Apr 6, 2010 at 10:15 AM, Sukender 
> > wrote:
> >  Hi all,
> > 
> >  I found several ressources(*) about static linking but didn't
> > found
> > >> an answer to my question: can I combine "dynamic OSG/OT" +
> "dynamic
> > >> OSG plugins" + "static custom (= user) plugins"? If yes, how?
> > >>> I can't see how this would work as it seems to be there would be
> a
> > >>> conflict between what version of core libraries that the dynamic
> > vs
> > >>> static plugins would need to link to.
> > >>>
> > >>> If you want dynamic linking then use it everywhere.
> > >>>
> > >>> 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 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
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Static linking with user pulgins AND dynamic OSG?

2010-04-07 Thread Sukender
Hi Laurens, hi all,

Hum, could you give me a hint, please? If I write:
  class BBB : public osgDB::ReaderWriter {... blah blah blah ...};
  REGISTER_OSGPLUGIN(bbb, BBB)
in "bbb.cpp" (in my main exe), then the "BBB" reader/writer is constructed and 
added to the registry when process loads.

However if I put that .cpp in a static lib, which is linked to my main exe, 
then the "BBB" reader/writer is never built (nor added to the registry).
As far as I know, static libs are roughly a bunch of objects! Were's the 
difference?

And of course, using USE_OSGPLUGIN() doesn't work.


BTW, The feature you're mentioning seems interesting. Is there any chance you 
release the code, under a licence or another?
Cheers,

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/

- "Laurens Voerman"  a écrit :

> Hi Sukender,
> 
> my modified dds reader is able to skip reading high res mipmaps from
> the
> dds file.
> For the version you are using, I am guessing that your link errors
> might
> originate in compliling the static plugin lib with OSG_LIBRARY_STATIC
> defined. And/Or linking the plugin with the osg libs.
> Mixing debug and release versions will also create confusing link
> errors.
> 
> Of course the USE_OSGPLUGIN(ext1) must be mirrored by a
> REGISTER_OSGPLUGIN(ext1,myReaderWriterExtention1)
> 
> Laurens.
> 
> Sukender wrote:
> > Hi Laurens,
> >
> > This is what I mean. Glad to see it can work! But I have:
> > - A static lib
> > - No dllexport stuff
> > - Two USE_PLUGIN() in the main exe
> >
> > And I have linker errors.
> > Any idea?
> >
> > BTW, what your modified plugin does? I had problems with DDS (saw
> some 3rd-party apps read RGB as BGR and vice-versa).
> > Cheers,
> >
> > Sukender
> > PVLE - Lightweight cross-platform game engine -
> http://pvle.sourceforge.net/
> >
> > - "Laurens Voerman"  a écrit :
> >
> >> Hi Sukender,
> >> I'm very confused about Robert's reply, because it's working fine
> for
> >>
> >> me. I am using a modified dds reader linked into my app, which
> takes
> >> precedence over any osgdb_dds.dll because it registers on startup.
> >> This
> >> can be done by simply adding the (modified) ReaderWriterDDS.cpp to
> the
> >>
> >> project producing the executable, in this version there is no need
> for
> >>
> >> USE_PLUGIN() - it will cause a link error.
> >> If you compile the plugin into a static link lib, you need the
> >> USE_PLUGIN() and link to the lib.
> >>
> >> This can work because the plugins I am using are not exporting any
> >> symbols, so there is no __declspec(dllexport) stuff in the way.
> >>
> >> Laurens.
> >>
> >> Robert Osfield wrote:
> >>> Hi Sukender,
> >>>
> >>> On Tue, Apr 6, 2010 at 10:15 AM, Sukender 
> wrote:
>  Hi all,
> 
>  I found several ressources(*) about static linking but didn't
> found
> >> an answer to my question: can I combine "dynamic OSG/OT" + "dynamic
> >> OSG plugins" + "static custom (= user) plugins"? If yes, how?
> >>> I can't see how this would work as it seems to be there would be a
> >>> conflict between what version of core libraries that the dynamic
> vs
> >>> static plugins would need to link to.
> >>>
> >>> If you want dynamic linking then use it everywhere.
> >>>
> >>> 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 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


[osg-users] AutoTransform

2010-04-07 Thread Sunil S Nandihalli
Hello Everybody,
 I would like to know as to what is the difference between

*ROTATE_TO_SCREEN* *ROTATE_TO_CAMERA*
in the AutoTransform class. I was also wondering if there is some inbuilt
feature to place an axis in the corner of the screen indicating the world
axis .. as is common in most cad applications..
Thanks in advance...
Sunil.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Fwd: Re: Color array optimization

2010-04-07 Thread Ulrich Hertlein
Hi Tim,

On 7/04/10 15:12 , Tim Moore wrote:
> osg::Optimizer attempts to optimize for performance, not memory.
> The optimization you're proposing will have a negative impact on
> OpenGL performance.
> 
> How do you figure? Vincent would like to replace BIND_PER_VERTEX colors
> with a BIND_OVERALL color where possible. That is a very common thing to
> do in OSG and is, as I understand it, well supported even in OpenGL 3.0+
> and OpenGL ES 2.0.

Looking at that again, I may have confused that with BIND_PER_PRIMITIVE.

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


Re: [osg-users] Static linking with user pulgins AND dynamic OSG?

2010-04-07 Thread Laurens Voerman

Hi Sukender,

my modified dds reader is able to skip reading high res mipmaps from the 
dds file.
For the version you are using, I am guessing that your link errors might 
originate in compliling the static plugin lib with OSG_LIBRARY_STATIC 
defined. And/Or linking the plugin with the osg libs.

Mixing debug and release versions will also create confusing link errors.

Of course the USE_OSGPLUGIN(ext1) must be mirrored by a 
REGISTER_OSGPLUGIN(ext1,myReaderWriterExtention1)


Laurens.

Sukender wrote:

Hi Laurens,

This is what I mean. Glad to see it can work! But I have:
- A static lib
- No dllexport stuff
- Two USE_PLUGIN() in the main exe

And I have linker errors.
Any idea?

BTW, what your modified plugin does? I had problems with DDS (saw some 
3rd-party apps read RGB as BGR and vice-versa).
Cheers,

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/

- "Laurens Voerman"  a écrit :


Hi Sukender,
I'm very confused about Robert's reply, because it's working fine for

me. I am using a modified dds reader linked into my app, which takes 
precedence over any osgdb_dds.dll because it registers on startup.
This 
can be done by simply adding the (modified) ReaderWriterDDS.cpp to the


project producing the executable, in this version there is no need for

USE_PLUGIN() - it will cause a link error.
If you compile the plugin into a static link lib, you need the 
USE_PLUGIN() and link to the lib.


This can work because the plugins I am using are not exporting any 
symbols, so there is no __declspec(dllexport) stuff in the way.


Laurens.

Robert Osfield wrote:

Hi Sukender,

On Tue, Apr 6, 2010 at 10:15 AM, Sukender  wrote:

Hi all,

I found several ressources(*) about static linking but didn't found

an answer to my question: can I combine "dynamic OSG/OT" + "dynamic
OSG plugins" + "static custom (= user) plugins"? If yes, how?

I can't see how this would work as it seems to be there would be a
conflict between what version of core libraries that the dynamic vs
static plugins would need to link to.

If you want dynamic linking then use it everywhere.

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 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] Add a color node in the scenegraph?

2010-04-07 Thread Vincent Bourdier

Hello,

You should try just adding a material on each PAT.
If I'm right, material will overpass the color of the geode... If anyone 
can confirm :-[


Regard,
Vincent

Le 07/04/2010 11:33, Benjamin GODIN a écrit :

Hello,

I have a scene with one object but represented many times.
My graph is something like that :
[Image: http://img576.imageshack.us/img576/1522/osg.png ]

I want to give different colors to the different objects. The method I've found 
is setColor on a ShapeDrawable but that means I need to create many instances 
of this object.

Is there any way I can add the color in the scene graph (as a node)?

Thanks. :)[/img]

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





___
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] Add a color node in the scenegraph?

2010-04-07 Thread Benjamin GODIN
Hello,

I have a scene with one object but represented many times.
My graph is something like that :
[Image: http://img576.imageshack.us/img576/1522/osg.png ]

I want to give different colors to the different objects. The method I've found 
is setColor on a ShapeDrawable but that means I need to create many instances 
of this object.

Is there any way I can add the color in the scene graph (as a node)?

Thanks. :)[/img]

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





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


[osg-users] WriteImageFile black

2010-04-07 Thread sumit
Hi Thomas,

Your way capturing screenshot is working on my system at least. Probably
there is problem with the plug-in. Set OSG_NOTIFY_LEVEL=DEBUG, and see
whether you are getting any errors or warnings, also try to play with
different formats. This particular format may not be supported by your
plug-in.

Cheers,
Sumit

Date: Mon, 05 Apr 2010 15:02:09 +
From: "Thomas PATTOU" 
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] WriteImageFile black
Message-ID: <1270479729.m2f.26...@forum.openscenegraph.org>
Content-Type: text/plain; charset=UTF-8

Hi everybody,

First, I want to state that I am aware there is already quite a few posts
about this. I read most of them, trying to understand what is wrong with my
application; now that this is said, I can also state that I did not find out
the solution.

Basically, I am trying to achieve the same thing as a lot of people, taking
a screenshot of my current view and writing it to file. I really tried a lot
of ways to get this working, in vain.
:

- I tried to use the ScreenCaptureHandler, but this doesn't allow me to
achieve what I want (I want to record several frames during a given period)
because of the fact that it only takes screenshots when you press a key.

- I tried to have a look at osgscreencapture, which is unfortunately too
complex for me to get it clearly.

- I tried the basic 

Code:
osg::Image* temp = new osg::Image();
temp->readPixels(0, 0,
viewer->getCamera()->getGraphicsContext()->getTraits()->width,
viewer->getCamera()->getGraphicsContext()->getTraits()->height, GL_RGB,
GL_UNSIGNED_BYTE);
osgDB::writeImageFile(*temp, toto.jpg);

 which gives me the result I have now (a black jpg file).

- I also tried to put that code in a handler derived from GUIEventHandler

Code:
bool ScreenshotHandler::handle(const osgGA::GUIEventAdapter&
ea,osgGA::GUIActionAdapter& aa)
{

osg::View* viewTest = aa.asView();


osg::Image* temp = new osg::Image();
temp->readPixels(0, 0,
viewTest->getCamera()->getGraphicsContext()->getTraits()->width,
viewTest->getCamera()->getGraphicsContext()->getTraits()->height, GL_RGB,
GL_UNSIGNED_BYTE);
osgDB::writeImageFile(*temp, "toto2.jpg");


return true;
}


 that I add to the viewer, but I still get the same problem.

I really am starting to be in a rush for this project, and getting depressed
by the complexity of getting a simple shot of the view.

Please help!


Thank you!

Cheers,
Thomas[/code]

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







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


Re: [osg-users] Static linking with user pulgins AND dynamic OSG?

2010-04-07 Thread Sukender
Hi Laurens,

This is what I mean. Glad to see it can work! But I have:
- A static lib
- No dllexport stuff
- Two USE_PLUGIN() in the main exe

And I have linker errors.
Any idea?

BTW, what your modified plugin does? I had problems with DDS (saw some 
3rd-party apps read RGB as BGR and vice-versa).
Cheers,

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/

- "Laurens Voerman"  a écrit :

> Hi Sukender,
> I'm very confused about Robert's reply, because it's working fine for
> 
> me. I am using a modified dds reader linked into my app, which takes 
> precedence over any osgdb_dds.dll because it registers on startup.
> This 
> can be done by simply adding the (modified) ReaderWriterDDS.cpp to the
> 
> project producing the executable, in this version there is no need for
> 
> USE_PLUGIN() - it will cause a link error.
> If you compile the plugin into a static link lib, you need the 
> USE_PLUGIN() and link to the lib.
> 
> This can work because the plugins I am using are not exporting any 
> symbols, so there is no __declspec(dllexport) stuff in the way.
> 
> Laurens.
> 
> Robert Osfield wrote:
> > Hi Sukender,
> > 
> > On Tue, Apr 6, 2010 at 10:15 AM, Sukender  wrote:
> >> Hi all,
> >>
> >> I found several ressources(*) about static linking but didn't found
> an answer to my question: can I combine "dynamic OSG/OT" + "dynamic
> OSG plugins" + "static custom (= user) plugins"? If yes, how?
> > 
> > I can't see how this would work as it seems to be there would be a
> > conflict between what version of core libraries that the dynamic vs
> > static plugins would need to link to.
> > 
> > If you want dynamic linking then use it everywhere.
> > 
> > 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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Camera Behavior

2010-04-07 Thread Alberto Luaces
"John Galt" writes:

> In the left window, the camera is supposed to be fixed at a point and only 
> rotate about Z axis. How ever it seems to me like the camera while rotating 
> about the Zaxis is also revolving in an orbit about the point (0,0,2).

That's the thing that I'm not sure about. Can you place three more dolls
at 90º, -90º and 180º to confirm that?

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