[osg-users] create glass effect

2007-07-18 Thread [EMAIL PROTECTED]
Hi all, how can I create an effect that seems to the glass?

thank you.
Davide
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


R: RE: [osg-users] create glass effect

2007-07-18 Thread [EMAIL PROTECTED]
thank you, can you tell me how can I load theese shaders? 
I'm able to 
load only the shaders .frag and .vert used in osg examples.
I must 
download the HLSL or the CgFX shader?

Thank you
Davide


Messaggio 
originale
Da: [EMAIL PROTECTED]
Data: 18-lug-2007 
15.30
A: osg usersosg-users@openscenegraph.net
Ogg: RE: [osg-users] 
create glass effect


Hello Davide,

You can check out the Nvidia 
Shader Library for examples:

http://developer.download.nvidia.
com/shaderlibrary/webpages/shader_library.html


bill

-Original 
Message-
From: [EMAIL PROTECTED] on behalf of 
[EMAIL PROTECTED]
Sent: Wed 7/18/2007 9:03 AM
To: [EMAIL PROTECTED]
net
Subject: [osg-users] create glass effect
 
Hi all, how can I create 
an effect that seems to the glass?

thank you.
Davide
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.
net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.
net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


R: Re: [osg-users] problem applying textures to .flt models

2007-07-05 Thread [EMAIL PROTECTED]
Sorry, but I don't understand where I'm wrong.
I don't have a osg::
Geometry, I only have an osg::Node and I can't set the texture 
coordiantes ...

Thank you
Davide

Messaggio originale
Da: 
[EMAIL PROTECTED]
Data: 5-lug-2007 10.07
A: osg usersosg-
[EMAIL PROTECTED]
Ogg: Re: [osg-users] problem applying 
textures to .flt models

Hi,

You need texture coordinates.

Regards,
Brede

On 7/4/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Hi all, I can 
apply textures to geometry, shapes and models .3ds, but
 not to models 
.flt.
 The code I'm using is:

 // set up the texture
 state.
 osg::Texture2D* texture = new osg::Texture2D;

 texture-
setDataVariance(osg::Object::DYNAMIC); // protect from being
 
optimized away as static state.
 osg::Image* textureImage = 
osgDB::
 readImageFile((LPCTSTR)texturePath);

 if(!
textureImage){

 AfxMessageBox(Impssibile caricare la texture);
 return;
 }
 //
 Assign the texture 
to the image we read from file:
 texture-setImage
 
(textureImage);

 osg::StateSet* stateset = node-
 
getOrCreateStateSet();
 stateset-setTextureAttributeAndModes
(0,
 texture,osg::StateAttribute::ON);
 stateset-setMode( 
GL_LIGHTING, osg::
 StateAttribute::OFF );

 node-
setStateSet(stateset);

 How can I do?
 Thank you.
 
___
 osg-users mailing 
list
 osg-users@openscenegraph.net
 http://openscenegraph.
net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.
net/mailman/listinfo/osg-users
http://www.openscenegraph.org/



___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] problem applying textures to .flt models

2007-07-04 Thread [EMAIL PROTECTED]
Hi all, I can apply textures to geometry, shapes and models .3ds, but 
not to models .flt.
The code I'm using is:

// set up the texture 
state.
osg::Texture2D* texture = new osg::Texture2D;

texture-setDataVariance(osg::Object::DYNAMIC); // protect from being 
optimized away as static state.
osg::Image* textureImage = osgDB::
readImageFile((LPCTSTR)texturePath);

if(!textureImage){

AfxMessageBox(Impssibile caricare la texture);
return;
}
// 
Assign the texture to the image we read from file: 
texture-setImage
(textureImage);

osg::StateSet* stateset = node-
getOrCreateStateSet();
stateset-setTextureAttributeAndModes(0,
texture,osg::StateAttribute::ON);
stateset-setMode( GL_LIGHTING, osg::
StateAttribute::OFF );

node-setStateSet(stateset);

How can I do?
Thank you.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] CEGUI

2007-07-03 Thread [EMAIL PROTECTED]
Hi,
 I tried to run the osgcegui example, and no GUI was rendered.

All the GUI creation code was taken from CEGUI example (which works).
I didn't get any errors from CEGUI or OSG.

I also tried to set the renderGUI function as post callback of the camera with 
no better results.

any ideas?

is it something with the Zbuffer? or Z position of the GUI?

thanks,
 Guy.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] Loading shader .fx

2007-07-02 Thread [EMAIL PROTECTED]
Hi, how can I load shaders with .fx extension?

Thank you
Davide
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


R: Re: [osg-users] Loading shader .fx

2007-07-02 Thread [EMAIL PROTECTED]
I'm non 100% sure, but I think .fx shader language belongs to 
Microsoft.
I have some shader .fx that are very realistic and wonderful 
and I would like to apply them to some parts of my scene...



Messaggio originale
Da: [EMAIL PROTECTED]
Data: 2-lug-2007 
12.27
A: osg usersosg-users@openscenegraph.net
Ogg: Re: [osg-users] 
Loading shader .fx

On 7/2/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 
Hi, how can I load shaders with .fx extension?

The OSG core doesn't 
support .fx shaders.

I'm not 100% sure what .fx shaders exactly entail 
so I did a quick
search on .fx shaders on the net and got lots of links 
that aren't
particularly useful.   Is it part of Nidia's Cg, part of 
Direct3D?

Robert.
___
osg-
users mailing list
osg-users@openscenegraph.net
http://openscenegraph.
net/mailman/listinfo/osg-users
http://www.openscenegraph.org/



___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] viewer on two different workstation

2007-06-30 Thread [EMAIL PROTECTED]
Hello, in my application I have a CompositeViewer with two osgViewer::
View, it is possible display one View on a workstation and the other 
View on another workstation connected in the same LAN?
How can I do 
this?

thank you and sorry for my bad English :)
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] camera in camera and COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES Problem

2007-06-29 Thread [EMAIL PROTECTED]
hi,all
  I use camera in camera in osg2.0 under windowsxp.
  |cameraB
   root-- |
  |cameraC
   The cameraC uses relate cf.  The main camera(viewer.getCamera())'s 
near_far_mode uses  COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES.
   The cameraC's near_far_mode and viewport are not assigned explicitly.
   Th  cameraC's viewMatrix and projectMatrix is set to E.

   The Pseudo code:
   osgViewer::Viewer viewer;
   viewer.setSceneData(root);
...
   osg::NodePath np = cameraC-getParentalNodePaths()[0];
   bool result = viewer.computeIntersections(x,y,np, ...);
  
I found the result = false sometime. I debuged it found that because 
COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES,
the projection matrix was auto changed when the eyepoint was changed. 

  How can I do right computeIntersections with camera in camera ?  Or 
I missing somthing? 
  Or I should use slave camera , not camera in camera?
 
 
   
   

  




___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Reading from texture

2007-06-28 Thread [EMAIL PROTECTED]

- Original Message -
From: Robert Osfield [EMAIL PROTECTED]
To: osg users osg-users@openscenegraph.net
Sent: Tuesday, June 26, 2007 3:28 PM
Subject: Re: [osg-users] Reading from texture


 On 6/26/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  Thanks for the advice,
  After implementing it, I encountered 3 problems:
  1. There are minor differences of the data values between the two
  implementations (reading from the current texture, and attaching image)
  maybe images doesn't support half float precision?

 There is some half float support in the 2.0 version of osg::Image, but
 this might not coverage your usage.


I'm still working with OSG1.2. currently I don't have time for the porting
(even that I played a little with OSG2.0 on my free time :)). anyway, I will
try to compile the OSG2.0 image code with OSG1.2 and see what happens.

  2. The image was rescaled to power of 2. (300x300 --- 256x256) while
  textures sizes don't have to be power of two. (is there a way to define
  image that won't be a power of 2 and attach it to the FBO?)

 What makes you think the images are rescaled to a power of two when
 reading?  There isn't any such code.

I don't remember the exact words but OSG prompts in the console something
like rescaling (300x300) image to (256x256).

 There only code for rescaling to
 power of two happens when applying on non power of two image to a
 power of two texture.

I allocated both at the same code section using the same width and height.

 Note the OSG support non power of two texture
 where supported by OpenGL drivers, but by default this is switched off
 due to portability problems related to OpenGL driver saying non power
 of two is supported, but then implementing it in software...

 See osg::Texture::setResizeNonPowerOfTwoHint(bool);

I'll look for it.


  3. It run slower than binding the texture object and reading from
current
  texture.

 It shouldn't run slower, if it is then there is possible some issue
 along the way such as pixel formats being inconsistent.

Both are using GL_RGBA mode with GL_FLOAT as the type. The texture has
internal format of half float, I don't seem to remember setting the image to
half float but I did what I saw in one of the examples that show how to
attach image to texture and having the texture automaticlly updated when the
image is changed.
Could that be the problem? is it possible to set image internalFormat?
did you mean something else by pixel format?


 Robert.

thanks,
 Guy.
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/



___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Reading from texture

2007-06-28 Thread [EMAIL PROTECTED]
thanks I'll get on to it as soon as possible.
 btw, the setResizeNonPowerOfTwoHint(false) solved the rescaling.

thanks,
 Guy.

- Original Message -
From: Robert Osfield [EMAIL PROTECTED]
To: osg users osg-users@openscenegraph.net
Sent: Thursday, June 28, 2007 9:55 AM
Subject: Re: [osg-users] Reading from texture


 Hi,

 OSG-2.0 does support a wider range of pixel formats so rather than
 chase ghosts it would probably be best just upgrading.  Porting to 2.0
 should not be that difficult, if you use osgProducer there is the
 library still existing as its own separate project and works fine with
 2.0.  The core OSG has seen a number of changes, but most shouldn't
 effect backwards compatibility too much.

 Robert.

 On 6/28/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 
  - Original Message -
  From: Robert Osfield [EMAIL PROTECTED]
  To: osg users osg-users@openscenegraph.net
  Sent: Tuesday, June 26, 2007 3:28 PM
  Subject: Re: [osg-users] Reading from texture
 
 
   On 6/26/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Thanks for the advice,
After implementing it, I encountered 3 problems:
1. There are minor differences of the data values between the two
implementations (reading from the current texture, and attaching
image)
maybe images doesn't support half float precision?
  
   There is some half float support in the 2.0 version of osg::Image, but
   this might not coverage your usage.
  
 
  I'm still working with OSG1.2. currently I don't have time for the
porting
  (even that I played a little with OSG2.0 on my free time :)). anyway, I
will
  try to compile the OSG2.0 image code with OSG1.2 and see what happens.
 
2. The image was rescaled to power of 2. (300x300 --- 256x256)
while
textures sizes don't have to be power of two. (is there a way to
define
image that won't be a power of 2 and attach it to the FBO?)
  
   What makes you think the images are rescaled to a power of two when
   reading?  There isn't any such code.
 
  I don't remember the exact words but OSG prompts in the console
something
  like rescaling (300x300) image to (256x256).
 
   There only code for rescaling to
   power of two happens when applying on non power of two image to a
   power of two texture.
 
  I allocated both at the same code section using the same width and
height.
 
   Note the OSG support non power of two texture
   where supported by OpenGL drivers, but by default this is switched off
   due to portability problems related to OpenGL driver saying non power
   of two is supported, but then implementing it in software...
  
   See osg::Texture::setResizeNonPowerOfTwoHint(bool);
 
  I'll look for it.
 
  
3. It run slower than binding the texture object and reading from
  current
texture.
  
   It shouldn't run slower, if it is then there is possible some issue
   along the way such as pixel formats being inconsistent.
 
  Both are using GL_RGBA mode with GL_FLOAT as the type. The texture has
  internal format of half float, I don't seem to remember setting the
image to
  half float but I did what I saw in one of the examples that show how to
  attach image to texture and having the texture automaticlly updated when
the
  image is changed.
  Could that be the problem? is it possible to set image internalFormat?
  did you mean something else by pixel format?
 
  
   Robert.
 
  thanks,
   Guy.
   ___
   osg-users mailing list
   osg-users@openscenegraph.net
   http://openscenegraph.net/mailman/listinfo/osg-users
   http://www.openscenegraph.org/
  
 
 
  ___
  osg-users mailing list
  osg-users@openscenegraph.net
  http://openscenegraph.net/mailman/listinfo/osg-users
  http://www.openscenegraph.org/
 
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] Reading from texture

2007-06-26 Thread [EMAIL PROTECTED]
Hello all,
I've asked this before but didn't got replies so I bring the issue up again.
I'm having in my application more than one FBO and after the frame was
rendered
I want selectively read one of them.
I plan to use Image::readFromCurrentTexture to read the data from the
texture attached to the FBO.
The question is, if there are two textures attached to two different FBOs,
how do I know which one is bound in the context? how do I read it, or the
other image? or both?
I want to prevent expilcitly calling to bind since it appears to be time
consuming, and people here say it's unnecessary.

any information on the subject would be helpfull,
thanks,
 Guy.



___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Reading from texture

2007-06-26 Thread [EMAIL PROTECTED]
Thanks for the advice,
After implementing it, I encountered 3 problems:
1. There are minor differences of the data values between the two
implementations (reading from the current texture, and attaching image)
maybe images doesn't support half float precision?
2. The image was rescaled to power of 2. (300x300 --- 256x256) while
textures sizes don't have to be power of two. (is there a way to define
image that won't be a power of 2 and attach it to the FBO?)
3. It run slower than binding the texture object and reading from current
texture.

if there are other ideas, I'll be glad to hear.
thanks,
 Guy.
- Original Message -
From: Robert Osfield [EMAIL PROTECTED]
To: osg users osg-users@openscenegraph.net
Sent: Tuesday, June 26, 2007 11:34 AM
Subject: Re: [osg-users] Reading from texture


 Why not just attach osg::Image to the  FBO Camera in question and let
 the OSG automatically copy the image from the FBO after its written
 to.

 On 6/26/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  Hello all,
  I've asked this before but didn't got replies so I bring the issue up
again.
  I'm having in my application more than one FBO and after the frame was
  rendered
  I want selectively read one of them.
  I plan to use Image::readFromCurrentTexture to read the data from the
  texture attached to the FBO.
  The question is, if there are two textures attached to two different
FBOs,
  how do I know which one is bound in the context? how do I read it, or
the
  other image? or both?
  I want to prevent expilcitly calling to bind since it appears to be time
  consuming, and people here say it's unnecessary.
 
  any information on the subject would be helpfull,
  thanks,
   Guy.
 
 
 
  ___
  osg-users mailing list
  osg-users@openscenegraph.net
  http://openscenegraph.net/mailman/listinfo/osg-users
  http://www.openscenegraph.org/
 
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/



___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: Re: [osg-users] FBO Multipass shading

2007-06-25 Thread [EMAIL PROTECTED]
Hi Robert,

using the camera RTT mechanism was one of my last thoughts. Until yet i haven't 
any idea how i could control the render order for my passes. You have pushed me 
in the right way ;o) Thanks for the hint!

Best regards,
Christian  


- Original Message -
From: [EMAIL PROTECTED] Robert Osfield
To: osg-users@openscenegraph.net
Date: 25.06.2007 10:30:44
Subject: Re: [osg-users] FBO Multipass shading


 Hi Christain,
 
 The way I would do is is have a set of osg::Camera set up to do FBO
 RTT, each outputting a separate texture.  The rendering order
 (Camera::setRenderOrder) should be set to draw the first Camera in
 your sequence first and so on.
 
 A later tweak might be to try and use the same FBO in each Camera, but
 we will probably  have to add some extra set methods into osg::Camera
 to do this.
 
 Robert.
 
 On 6/25/07, [EMAIL PROTECTED]
 [EMAIL PROTECTED] wrote:
  Hello,
 
  after i've implemented and bind some simple single pass shader effects like 
  DOT3 per pixel lighting i want to bind some multi pass shader effects like 
  DOF or Motionblurr to my scene.
 
  To use this multi pass shader effects it's required to use the frame buffer 
  object (FBO) as render to texture target, where the result of a pass is the 
  input for the next pass. I've searched the mailing lists and examples to 
  find hints how i can realize this, but i can't find anything...
 
  One of my thoughts is to solve this problem using a self implemented draw 
  cullback mechanism, where i set the FBO rendering mechanismen via OpenGL 
  commands for each geometry...
 
  Is this the right idea? Or can i realize the effect in a better way?
 
  Thanks for any help,
  best regards
  Christian
 
 
 
  ___
  osg-users mailing list
  osg-users@openscenegraph.net
  http://openscenegraph.net/mailman/listinfo/osg-users
  http://www.openscenegraph.org/
 
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/
 



___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] a bug in toggleFullscreen

2007-06-25 Thread [EMAIL PROTECTED]
hi ,
   i found a bug in toggleFullscreen in  viewerEventHandlers.cpp.
I pressed 's' frist to show the stats, then I pressed 'f' to toggle to 
no fullscreen. I found that the 'Frame rate...' was disappeared. if we 
move the window a little, the 'frame rate...' appears again. This bug
also affect the hud picking.
 

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Blending for dummies :)

2007-06-24 Thread [EMAIL PROTECTED]
Thanks to everyone that helped on the issue,
I also had some more readings about it, but the problem I have is that the 
objects in the transparent bin are sorted by depth against each other but I 
need the vetices to be sorted.

I'm having a drawable which contains many vertices and is transparent, from 
some direction I see through the front of the object it's back correctly and 
from the other direction it doesn't look correct (even when disabling depth 
test, or setting depth mask to true/false), the problem is that the vertices 
aren't drawn in the correct order and so the source alpha and destination alpha 
are swapped. Is their a way to tell osg to sort the vertices of the drawable 
depending on the viewing angle? is it VERY slow? any ideas?

thanks,
 Guy.
  - Original Message - 
  From: Paul Martz 
  To: 'osg users' 
  Sent: Tuesday, June 19, 2007 7:22 PM
  Subject: RE: [osg-users] Blending for dummies :)


  Any geometries that blend against each other should be in separate Drawables, 
and their StateSet should have the render bin hint set to TRANSPARENT_BIN. OSG 
will then draw these Drawables after all opaque Drawables and in back to front 
order. There are other strategies too, but this is the simple common one.

  For more information, there are many OSG examples that demonstrate how to set 
up OSG for correct rendering of translucent objects. Also, check the archives, 
as this has been covered multiple times recently.

  Hope that helps,

  Paul Martz
  Skew Matrix Software LLC
  http://www.skew-matrix.com
  303 859 9466




From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL 
PROTECTED]
Sent: Tuesday, June 19, 2007 12:15 PM
To: osg users
Subject: [osg-users] Blending for dummies :)


Hello,
 I'm trying to activate blending in some node. I set in the stateset 
GL_BLEND on, and added osg::BlendFunc but it seems to work only from backward 
views. I tried to disable GL_DEPTH and GL_CULL with no better results. 
any ideas?

thanks,
 Guy.


--


  ___
  osg-users mailing list
  osg-users@openscenegraph.net
  http://openscenegraph.net/mailman/listinfo/osg-users
  http://www.openscenegraph.org/
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] Blending for dummies :)

2007-06-24 Thread [EMAIL PROTECTED]
I think the technique of seperating the object to CW  CCW direction applies
for convex geometry only. It would work if back faces also have multiple
layers along the viewing angle.
But I guess I'll live with it.
suppose I could afford the awefull time consumption of sorting the vertices
each frame, would the best place to put it is in the cull traversal as cull
callback?

thanks anyway for the replies I've learned much,
 Guy.


- Original Message -
From: Robert Osfield [EMAIL PROTECTED]
To: osg users osg-users@openscenegraph.net
Sent: Sunday, June 24, 2007 11:40 AM
Subject: Re: [osg-users] Blending for dummies :)


 Hi Guy,

 Sorting Geometry by depth on each frame would be very expensive for
 any other than trivial geometry.  You don't want to do, and the OSG
 doesn't support it either.

 Approaches you can take include:

   1) Break you geometry into smaller separate osg::Geometry so that
 the coarse grained
   depth sorting can work more efficiently.

2) Use a double pass approach where you draw the back faces first,
 then draw the
front faces.  You can achieve this by duplicating all your
 primitives, swapping the
primitives binding and then ordering them so the reverse
 binding are first then
the original bindings.  You also need to enable back face culling.

 Robert.



 On 6/24/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 
 
  Thanks to everyone that helped on the issue,
  I also had some more readings about it, but the problem I have is that
the
  objects in the transparent bin are sorted by depth against each other
but I
  need the vetices to be sorted.
 
  I'm having a drawable which contains many vertices and is transparent,
from
  some direction I see through the front of the object it's back correctly
and
  from the other direction it doesn't look correct (even when disabling
depth
  test, or setting depth mask to true/false), the problem is that the
vertices
  aren't drawn in the correct order and so the source alpha and
destination
  alpha are swapped. Is their a way to tell osg to sort the vertices of
the
  drawable depending on the viewing angle? is it VERY slow? any ideas?
 
  thanks,
   Guy.
 
  - Original Message -
  From: Paul Martz
  To: 'osg users'
  Sent: Tuesday, June 19, 2007 7:22 PM
  Subject: RE: [osg-users] Blending for dummies :)
 
 
  Any geometries that blend against each other should be in separate
  Drawables, and their StateSet should have the render bin hint set to
  TRANSPARENT_BIN. OSG will then draw these Drawables after all opaque
  Drawables and in back to front order. There are other strategies too,
but
  this is the simple common one.
 
 
  For more information, there are many OSG examples that demonstrate how
to
  set up OSG for correct rendering of translucent objects. Also, check the
  archives, as this has been covered multiple times recently.
   Hope that helps,
 
 
  Paul Martz
  Skew Matrix Software LLC
  http://www.skew-matrix.com
  303 859 9466
 
 
   
   From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of
  [EMAIL PROTECTED]
  Sent: Tuesday, June 19, 2007 12:15 PM
  To: osg users
  Subject: [osg-users] Blending for dummies :)
 
 
 
  Hello,
   I'm trying to activate blending in some node. I set in the stateset
  GL_BLEND on, and added osg::BlendFunc but it seems to work only from
  backward views. I tried to disable GL_DEPTH and GL_CULL with no better
  results.
  any ideas?
 
  thanks,
   Guy.
 
   
 
 
  ___
  osg-users mailing list
  osg-users@openscenegraph.net
  http://openscenegraph.net/mailman/listinfo/osg-users
  http://www.openscenegraph.org/
 
 
  ___
  osg-users mailing list
  osg-users@openscenegraph.net
  http://openscenegraph.net/mailman/listinfo/osg-users
  http://www.openscenegraph.org/
 
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/



___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Re: Re: Asking again about states in shaders, and texturing issues (Ulrich Hertlein)

2007-06-19 Thread [EMAIL PROTECTED]
Robert,
 thanks for the reply, but I don't undestand something.
I'm probably don't understand something about OSG or OpenGL, so I'll
describe the way I believe things works, and I'll be glad for corrections.

suppose I'm having several textures, than there possibly could be several
texture objects on the gpu, and after the frame is rendered, at most only
one of them could be the active/current/bound texture. and
readFromCurrentTexture will read only that texture. suppose I want to read
another texture, I do have to bind it, and only then call
readFromCurrentTexture. No?

thanks,
 Guy.

- Original Message -
From: Robert Osfield [EMAIL PROTECTED]
To: osg users osg-users@openscenegraph.net
Sent: Monday, June 18, 2007 11:37 AM
Subject: Re: [osg-users] Re: Re: Asking again about states in shaders,and
texturing issues (Ulrich Hertlein)


 When using osg::Camrea with FBO there is no need to do any expicit
 binding of texture objects, it will all done for your.  This applies
 to the rest of the OSG as well, you won't need to bind texture objects
 manually, this will all be done for you.  Only in very niche case
 where you are creating your own drawables that you might need to start
 manually binding textures.

 On 6/18/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  Hello,
   I have another small question regarding textures and texture objects.
 
  is there a possibility to know what is the current texture object that
is
  bound?
 
  I need it since I render to FBO and I want to read it using to
  Image::readFromCurrentTexture. In order to be sure that the Current
  Texture is the one attached to the FBO as the color buffer, I call the
bind
  of the osg::TextureObject that correspond to the ContextID.
  something like:
  texture.getTextureObject(contextID)-bind();
 
  The problem is that the call to the bind function, really slows down the
  rendering (from ~200Hz down to ~110Hz).
  I thought to check if the texture objects needs binding and only if so,
call
  the bind.
 
  thanks,
   Guy.
 
 
  ___
  osg-users mailing list
  osg-users@openscenegraph.net
  http://openscenegraph.net/mailman/listinfo/osg-users
  http://www.openscenegraph.org/
 
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] Blending for dummies :)

2007-06-19 Thread [EMAIL PROTECTED]
Hello,
 I'm trying to activate blending in some node. I set in the stateset GL_BLEND 
on, and added osg::BlendFunc but it seems to work only from backward views. I 
tried to disable GL_DEPTH and GL_CULL with no better results. 
any ideas?

thanks,
 Guy.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] Re: Re: Asking again about states in shaders, and texturing issues (Ulrich Hertlein)

2007-06-18 Thread [EMAIL PROTECTED]
Hello,
 I have another small question regarding textures and texture objects.

is there a possibility to know what is the current texture object that is
bound?

I need it since I render to FBO and I want to read it using to
Image::readFromCurrentTexture. In order to be sure that the Current
Texture is the one attached to the FBO as the color buffer, I call the bind
of the osg::TextureObject that correspond to the ContextID.
something like:
texture.getTextureObject(contextID)-bind();

The problem is that the call to the bind function, really slows down the
rendering (from ~200Hz down to ~110Hz).
I thought to check if the texture objects needs binding and only if so, call
the bind.

thanks,
 Guy.


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Pick

2007-06-13 Thread [EMAIL PROTECTED]
Ok...very clearnow I know the reason

Thanks so much for all your replies!!

- Original Message -
From: Andreas Goebel [EMAIL PROTECTED]
To: osg users osg-users@openscenegraph.net
Sent: Tuesday, June 12, 2007 8:20 PM
Subject: Re: [osg-users] Pick


 Robert Nitti schrieb:
 It's a silly little thing not even worth posting.  I build a flat list
 of drawables and geodes while looping through the list of hits.  If the
 address of a geode or drawable is the same as any previously inserted in
 the list, I reject it.

 I'm CERTAIN there is a more elegant way of doing this... but I didn't
 look much further than my nose, so...

 Hi,

 you could either use a std::set instead of a list, or use the std -
 algorithm unique which deletes doublettes from a list.

 The std::set is unsuitable in case you want to preserve the order of the
 hits (i.e. want to know which object comes first).

 Regards,

 Andreas

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Jeremy L.
 Moles
 Sent: Tuesday, June 12, 2007 1:33 PM
 To: osg users
 Subject: RE: [osg-users] Pick

 On Tue, 2007-06-12 at 11:56 -0400, Robert Nitti wrote:

 Hi --

 'Picking' creates an osg::LineSegment that will intersect your

 scene...

 all the way through.  So if you have (for example) a box shape, and

 you

 are picking one side, it's very possible (in fact, almost certain,
 unless you've done something special to prevent it) that the list of
 pick items will return the opposite side to you also; so you are

 correct

 Jeremy in saying that you can pick the same object twice.

 I've created my own post-filter to clean-up the list of drawables and
 geodes so that I don't treat them twice.


 Is this code you would have permission to post here or attach to a
 response? :) I'd be very interested to see optimized versions of such an
 operation...


 I hope this helps.

 Thanks


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Jeremy L.
 Moles
 Sent: Tuesday, June 12, 2007 10:59 AM
 To: osg users
 Subject: Re: [osg-users] Pick

 On Tue, 2007-06-12 at 16:52 +0200, [EMAIL PROTECTED] wrote:

 Dear All
 I implemented a Picking function...
 In order to debug the picking function I simply print in monitor the

 id of the picked drawable.

 The problem is that the picking function is called two time for each

 mouse click.

 I don't think your picking function is getting called twice--I think
 you're seeing the same object twice in your pick results, which is
 something I'm running into myself. I just started learning picking

 this

 weekend, so I'm not 100% sure what's going on, but perhaps someone

 else

 will be able to chime in and help us both.

 I originally suspected this had something to do with having a 2D HUD
 Camera in my scene, but I don't think that's it.

 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/



 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/



 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/


--
Leggi GRATIS le tue mail con il telefonino i-mode™ di Wind
http://i-mode.wind.it/


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] transparency

2007-06-12 Thread [EMAIL PROTECTED]
Dear All
I have a questions about transparency.
I set the transparency of some nodes by these commands:

osg::StateSet* state = MyNode-getOrCreateStateSet();
osg::ref_ptrosg::Material mat = new osg::Material;
mat-setAlpha( osg::Material::FRONT_AND_BACK, trasparence );//Potrei 
risparmiarlo(tanto ci pensa il trasformer)
state-setMode( GL_BLEND, osg::StateAttribute::OVERRIDE | 
osg::StateAttribute::ON );
state-setMode( GL_CULL_FACE, osg::StateAttribute::OVERRIDE | 
osg::StateAttribute::ON );
state-setAttribute( mat.get() );

What happen is that I can see the transparency if I overlap the drawable with 
some objects...but overlapping the same drawable with other objects it doesn’t 
work...it seems that there is an order...does it depend by the Bin 
concept?...how can avoid it?


--
Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom
http://click.libero.it/infostrada

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] Light

2007-06-12 Thread [EMAIL PROTECTED]
Dear All

I added to my scene two light nodes.

Now, when i reset the camera position by the space bar, it obviously take in 
account also the light nodes.

How can avoid it?...how can i exclude the lights when i reset the position?

Thanks


--
Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom
http://click.libero.it/infostrada


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] Re:Light

2007-06-12 Thread [EMAIL PROTECTED]
Hi Paul

Sorry...My mail was not clear...
I dont want to move the light nodesbut instead reset the camera position.

Yes I'm using osgViewer...

I have some drawables in the middle of my scene.
Then i have some lights far then these drawables.

When i press the spacebar my camera go far away then my drawable...becouse it 
also include the lights in the windows.

How can I automatically reset the camera position in order to have only the 
drawable inside my windows?

Hope its better now

Thanks Paul

Do you mean you're using osgviewer? If so, spacebar the camera
position -- it doesn't affect the transformation of individual objects in
your scene.

If you want your light to move independently of the rest of your scene,
based on some key press, you'll need to add your own event handler to
capture your key press and modify the appropriate transformation matrices
accordingly.

Hope that helps,
   -Paul


--
Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom
http://click.libero.it/infostrada

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Re: Re: Asking again about states in shaders, andtexturing issues (Ulrich Hertlein)

2007-06-07 Thread [EMAIL PROTECTED]
Hi again,
thanks, now with this information it changes all my perspective about the
textures (I'm less concerned :) ).

the example I was talking about was GLSL example, and I think it worked only
because probably the default value for the uniform sampler is zero and the
texture unit in the stateset was zero.

thanks a lot,
 Guy.

- Original Message -
From: Ulrich Hertlein [EMAIL PROTECTED]
To: osg users osg-users@openscenegraph.net
Sent: Thursday, June 07, 2007 11:53 AM
Subject: Re: [osg-users] Re: Re: Asking again about states in shaders,
andtexturing issues (Ulrich Hertlein)


 Hi Guy,

 Guy Lifchitz wrote:
  ... Thanks for answering. I looked at the samples. Please help me verify
that I understand
  correctly the texturing process: 1. The samplers uniforms are only
integers for the texture unit.
 
 Yes.

  2. When creating osg::Texture{nD} object the actual glGenTexture
function is called and the
  object is created on the graphics card.

 Exactly. The osg::Texture objects contain the OpenGL texture IDs.
 (Actually a list of IDs, one for each context.)

  3. When binding texture to stateset you only state the texture unit.

 You state the texture unit that the osg::Texture should be bound to.

  4. When rendering, the stateset binds the texture object using the id
generated with the
  osg::Texture object, and bind it to the texture unit set with for that
object in the stateset.
 
  am I right?

 Yes.

  To use the texture in the shader I need to add uniform with the sampler
name I'm using in the
  shader and set it's value to the texture unit I gave the stateset with
the osg::Texture?

 Yes.

  now if all the above is true I still have two questions: 1. to bind 2
texture units to the same
  texture object I only need to pass the same pointer of osg::Texture{nD}
with two different calls
  to StateSet::setTextureAttribute that has different texture units?

 Yes. (Boy, you're systematic. ;-)

  2. I saw in some examples usage of sampler texUnit0 as the sampler of
the texture, but I haven't
  seen in the C code any reference to that name, so I thought it might be
a built in uniform but I
  also haven't seen it in the quick_ref. How does it work?

 I'm not aware of any built-in uniforms concerning textures in OSG.
 Do you mean an OSG example (if so, which) or a GLSL example.

 Cheers!
 /Ulrich
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/



___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Re: Re: Asking again about states in shaders, andtexturing issues (Ulrich Hertlein)

2007-06-07 Thread [EMAIL PROTECTED]
I forgot another little question,
is the binding of texture unit to texture object is time consuming and
should be avoided as much as possible, or is it a simple operation?

thanks again,
 Guy.


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: Re: [osg-users] Trouble with osgProducer::Camera setting camera position

2007-06-02 Thread [EMAIL PROTECTED]
Hi Robert, Charles,

thanks for the hints. OSG 1.9.x is not an option, because we want to use only a 
stable version in our project, so i can't follow Charles introduction. 

Robert, correct me if i am wrong. When i use 
osgProducer::Viewer::setViewByMatrix(..) i am forced to make this call between 
the update() and frame() call of the viewer to overwrite the Producer settings. 
This makes it impossible to use the Producer camera features because i set a 
static value. So i've to reimplement all Producer::Camera features like moving 
ect.. 

Is there no other option to use the camera with all Producer features? It will 
me drives nuts, if i must reimplement all given features of an existing 
component...

Best regards,
Christian


- Original Message -
From: [EMAIL PROTECTED] Robert Osfield
To: osg-users@openscenegraph.net
Date: 01.06.2007 20:38:24
Subject: Re: [osg-users] Trouble with osgProducer::Camera setting camera 
position


 Hi Christian,
 
 You are probably coming up against the problem of the
 osgProducer::Viewer using camera manipulators to set the view matrix
 on each frame, this overwrites the Producer setting.
 
 One thing you could try is to use
 osgProducer::Viewer::setViewByMatrix(..);  and pass in a Matrix set up
 as look at.
 
 If you are new to the OSG and just starting out, then I'd recommend
 using the osgViewer library found in the 1.9.x and SVN versions of the
 OSG.   Integration with core OSG is much cleaner in osgViewer than it
 is with osgProducer.
 
 Robert.
 
 On 6/1/07, [EMAIL PROTECTED]
 [EMAIL PROTECTED] wrote:
  Hello,
 
  I have a question about how to set the position of a camera. I do it the 
  following way:
 
  Producer::CameraConfig* createCameraConfig(void)
  {
  // create a new render surface
  Producer::RenderSurface *rsWindow = new Producer::RenderSurface;
 
  // set the number of screens
  rsWindow-setScreenNum(0);
 
  // set the window title bar caption
  rsWindow-setWindowName(CameraTest);
 
  // set the window client size
  rsWindow-setWindowRectangle(0,0, 1024, 768);
 
  // create a new camera
  Producer::Camera *camera = new Producer::Camera;
 
  // set the render surface of the camera to the window that was just 
  created
  camera-setRenderSurface(rsWindow);
 
  // set the size of the camera viewport to the same size as the 
  window
  camera-setProjectionRectangle(0,0,1024,768;
 
  // set the camera position
 camera-setViewByLookat(Producer::Vec3(0.0f,0.0f,-6.0f),
  Producer::Vec3(0.0f,0.0f,0.0f),
  Producer::Vec3(0.0f,1.0f,0.0f));
 
 // create a new camera configuration container
 Producer::CameraConfig *cfg = new Producer::CameraConfig;
 
  // add the camera that was just created to the configuration
  cfg-addCamera(Camera One,camera1);
  return(cfg);
  }
 
  void createView()
  {
  // Create View with ProducerCamera Config
  m_viewer = new osgProducer::Viewer(createCameraConfig());
 
  // Create Scene root
  m_viewerRoot= new osg::Group();
  m_viewerRoot-setName(Root);
 
  // Sett default Settings
  m_viewer-setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS);
 
  /* Test to check  position set up on View
  m_viewer-setViewByLookat(Producer::Vec3(0.0f, 0.0f,-10.0f),
Producer::Vec3(0.0f, 0.0f,  0.0f),
Producer::Vec3(0.0f, 1.0f,  0.0f));
 */
 
  m_viewer-setSceneData(m_viewerRoot.get());
  m_viewer-realize();
  }
 
  I can set the position with setViewByLookat() to whatever I want, but 
  nothing changes to the initial camera position. It is always the default 
  position or something unspecific. Because Producer::Camera is an external 
  component which is used by the osgProducerViewer i tried to set the 
  position directly on the viewer by: setViewByLookat()
 
  But this has no effect too. If i call later in the code const double* pos = 
  m_viewer-getPosition(); i got always some position values i've never set 
  ...
 
  Is there a way to predefine the Producer::Camera or Viewer Position?
  Thanks for any help.
 
  Best regards
  Christian
 
 
 
  ___
  osg-users mailing list
  osg-users@openscenegraph.net
  http://openscenegraph.net/mailman/listinfo/osg-users
  http://www.openscenegraph.org/
 
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/
 



___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: Re: Re: [osg-users] Trouble with osgProducer::Camera setting camera position

2007-06-02 Thread [EMAIL PROTECTED]
Hi Robert,

thanks for the information about OSG 2.0. I will wait for this release and 
check the new viewer features. Perhaps it will make my life easier as you 
described, if not, i will follow your introduction.
Thanks for help.

Best regards,
Christian

- Original Message -
From: [EMAIL PROTECTED] Robert Osfield
To: osg-users@openscenegraph.net
Date: 02.06.2007 14:00:03
Subject: Re: Re: [osg-users] Trouble with osgProducer::Camera setting camera 
position


 Hi Cristian,
 
 On 6/2/07, [EMAIL PROTECTED]
 [EMAIL PROTECTED] wrote:
  Hi Robert, Charles,
 
  thanks for the hints. OSG 1.9.x is not an option, because we want to use 
  only a stable version in our project, so i can't follow Charles 
  introduction.
 
 Well 2.0 is coming out next week.  I presume you are able to at least
 trail the dev versions.  Refusing to consider testing out the dev
 versions is holding your back.  osgViewer exists to make *your* life
 easier.
 
  Robert, correct me if i am wrong. When i use 
  osgProducer::Viewer::setViewByMatrix(..) i am forced to make this call 
  between the update() and frame() call of the viewer to overwrite the 
  Producer settings. This makes it impossible to use the Producer camera 
  features because i set a static value. So i've to reimplement all 
  Producer::Camera features like moving ect..
 
  Is there no other option to use the camera with all Producer features? It 
  will me drives nuts, if i must reimplement all given features of an 
  existing component...
 
 If you wish you can swtich off the osgProducer::Viewer's camera
 manipulator and manage Producer's view matrix directly, when you call
 Viewer::setUpViewer(mask) pass in the appropriate mask.
 
 You could also just reset the camera manipulator directly, something like
 
   viewer.getKeySwitchManipulator()-setHomePosition(...);
 
 If things are driving you nuts then just go a use 1.9.x series.
 
 Robert.
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/
 



___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] Linking problems with 1.9.4, wrappers and MinGW

2007-05-17 Thread [EMAIL PROTECTED]
Hi,

I am trying to build 1.9.4 with MinGW. However when it gets to creating the 
wrapper DLLs, the linker, ld, takes a very large amount of memory (200MB) and 
after about an hour it aborts with a memory allocation failure. Everything else 
seems to compile and work correctly and I certainly have enough memory.

Even trying to link with just Geometry wrapper obj into my application, it 
doesn't get past the linking phase. I can create a DLL from a very small subset 
of the osg wrapper objects (excluding Geometry).

Has anyone encountered this before? What is special about the wrappers that 
leads to this problem (I am no C/C++/MinGW/DLL expert). Would a particular ld 
flag get around the problem?

Yes, I am 90% certain I have to use MinGW. I am integrating with Haskell which 
uses MinGW as part of its backend.

Cheers

Mark
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] when add a skybox to scene, it brings z

2007-05-02 Thread [EMAIL PROTECTED]
Robert, David
Thanks.
The way I adopted was using two cameras to do this. The first renderes only the 
sky box. The second renderes other models.
It's ugly but I could not find a better way the past week. 
Your advice was a great help to me.  could you post the sample code to my 
email([EMAIL PROTECTED]) or osg-users mailing?
   Best regards,

lilinx
 



___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] when add a skybox to scene, it brings z flighting

2007-04-30 Thread [EMAIL PROTECTED]
osg-users,hi!
  I use a EyeTransform(see osgVertexProgram) to Make Skybox.
  The Code:
//
osg::EyeTransform* skybox = new  osg::EyeTransform;
...
osg::Node*loadmodel = osgDB::readNodeFile(...);

osg::Group* root = new osg::Group;
root-addChild(skybox);
root-addChild(loadmodel);

viewer.setSceneData(root);
//***   

  the cullingseting is COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES
 when  the eye near the scene center, it works fine.
  when  the eye far  from the scene center, it brings z flighting.
  
  if only  setSceneData( loadmodel), it works fine both near and far from 
scene center.

lilinx
[EMAIL PROTECTED]
  2007-04-30
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] Have question about the SceneView's cameraNode

2007-04-20 Thread [EMAIL PROTECTED]
Hi,

I was poking around the OSG code and ran across the osg::CameraNode that is 
created in the SceneView class.  I'm curious as to how I can benefit from 
having access to this node.  I notice that it has a node visitor associated 
with it, but what isn't exactly clear is how the CameraNode is actually 
used.  What is its role in OSG?

Hypothetically, if I were to obtain a pointer to this CameraNode, could I 
modify it to render to texture instead of its default rendering method 
(whatever that may be)?  Typically, I have always created separate 
CameraNode objects for use with RTT which works very well, but someone 
pointed out that a CameraNode is already obtainable from the SceneView 
class.  From there I started wondering.

Thanks,
Brian
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] Window creation parameters.

2007-04-02 Thread [EMAIL PROTECTED]
Hi,

When using Producer to set up a default window, is it possible to specify 
parameters that the window should have upon creation?  I know that I can 
specify my own window to use, but unfortunately, the 3rd party tool that I 
am using in conjunction with OSG isn't set up to do that easily.

Thanks,
Brian
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Window creation parameters.

2007-04-02 Thread [EMAIL PROTECTED]
Hi RJ,

Thanks for the reply and links.  However, I am just not seeing how I can 
alter the style of the window prior to its creation.  I've tried creating a 
parent window and passing that via

DeltaWin::GetInstance(0)-GetRenderSurface()-setParentWindow(win);

However, all this does is to create a child window without the WS_VISIBLE 
style.  I discovered that I will need to provide a parent window due to a 
couple of program specific reasons in my application.  Looking at the 
RenderSurface_Win32.cpp file, there don't seem to be any notifications that 
the child window of the supplied parent has been created.

At this point, a code snippet would be most helpful.

Thanks,
Brian


On Mon, 02 Apr 2007 23:11:32 +0530, RJ [EMAIL PROTECTED] wrote :

 Hi Brian,
 Yes you can do that by using RenderSurface.Get the Producer::
 RenderSurface object from the Producer::Camera and then you can
 call different function of RenderSurface class to set the window
 properties.
 For more information look at the documentation on this site
 
http://andesengineering.com/Producer/Doxygen/html/classProducer_1_1RenderSur
face.html
 
 There is also a tutorial on Producer on the link 
 http://andesengineering.com/Producer/Tutorial/index.html
 
 I hope this answer your query.If not please let me know i will send you
 a code snippet on the same.
 best regards
 RJ
 
 
 On Mon, 2007-04-02 at 17:29 +, [EMAIL PROTECTED] wrote:
  Hi,
  
  When using Producer to set up a default window, is it possible to 
specify 
  parameters that the window should have upon creation?  I know that I 
can 
  specify my own window to use, but unfortunately, the 3rd party tool 
that I 
  am using in conjunction with OSG isn't set up to do that easily.
  
  Thanks,
  Brian
  ___
  osg-users mailing list
  osg-users@openscenegraph.net
  http://openscenegraph.net/mailman/listinfo/osg-users
  http://www.openscenegraph.org/
  
 
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/
 
 
 

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Window creation parameters.

2007-04-02 Thread [EMAIL PROTECTED]

Hi RJ,

Just thought I'd let you know that I got this to work (in a fashion.)  I 
created a separate thread for the parent window to get/dispatch messages, 
and the child, or OSG window, displayed fine in that scenario.  I coded 
some additional logic to determine when the child window becomes visible.

Thanks for your help.  I don't think I need the code snippet now.

Brian


On 2 Apr 2007 18:40:19 -, [EMAIL PROTECTED] [EMAIL PROTECTED] 
wrote :

 Hi RJ,
 
 Thanks for the reply and links.  However, I am just not seeing how I can 
 alter the style of the window prior to its creation.  I've tried creating 
a 
 parent window and passing that via
 
 DeltaWin::GetInstance(0)-GetRenderSurface()-setParentWindow(win);
 
 However, all this does is to create a child window without the WS_VISIBLE 
 style.  I discovered that I will need to provide a parent window due to a 
 couple of program specific reasons in my application.  Looking at the 
 RenderSurface_Win32.cpp file, there don't seem to be any notifications 
that 
 the child window of the supplied parent has been created.
 
 At this point, a code snippet would be most helpful.
 
 Thanks,
 Brian
 
 
 On Mon, 02 Apr 2007 23:11:32 +0530, RJ [EMAIL PROTECTED] wrote :
 
  Hi Brian,
  Yes you can do that by using RenderSurface.Get the Producer::
  RenderSurface object from the Producer::Camera and then you can
  call different function of RenderSurface class to set the window
  properties.
  For more information look at the documentation on this site
  
 
http://andesengineering.com/Producer/Doxygen/html/classProducer_1_1RenderSur
 face.html
  
  There is also a tutorial on Producer on the link 
  http://andesengineering.com/Producer/Tutorial/index.html
  
  I hope this answer your query.If not please let me know i will send you
  a code snippet on the same.
  best regards
  RJ
  
  
  On Mon, 2007-04-02 at 17:29 +, [EMAIL PROTECTED] wrote:
   Hi,
   
   When using Producer to set up a default window, is it possible to 
 specify 
   parameters that the window should have upon creation?  I know that I 
 can 
   specify my own window to use, but unfortunately, the 3rd party tool 
 that I 
   am using in conjunction with OSG isn't set up to do that easily.
   
   Thanks,
   Brian
   ___
   osg-users mailing list
   osg-users@openscenegraph.net
   http://openscenegraph.net/mailman/listinfo/osg-users
   http://www.openscenegraph.org/
   
  
  ___
  osg-users mailing list
  osg-users@openscenegraph.net
  http://openscenegraph.net/mailman/listinfo/osg-users
  http://www.openscenegraph.org/
  
  
  
 
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/
 
 
 
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] precise object occlusion

2007-03-27 Thread [EMAIL PROTECTED]
I need to PARTIALLY occlude some moving objects. Actually,
using the osg::Occluder class and looking at the osgoccluder
example, I realized that when my moving object move just a
little bit behind the occluder plane, it is hidden
completely...even though there is a large part of that
object that should be still visible. How can I hide JUST the
part of objects that are behind the occluder? 

By the way, beside the occluder plane, is possible to use
any kind of geometry (I mean any 3D object...of any shape)
as an occluder? 

Actually, my problem is to have 'transparent objects that
should be able to occlude some other objects'...any
suggestion?

Thanks!

PS: I'm new to osg ;)
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] CombatSimulatorProject

2007-02-20 Thread [EMAIL PROTECTED]

RJ wrote:

Hi folks,
I am trying to build CSP from source code. One of the dependencies
openalpp (openAl++) i am not able to build from source code. Does any
one has tried building this library from the source code ? 
best regards

RJ


i highly suggest to ask that question direct in the development discussion at 
http://csp.sourceforge.net/forum/
as there are all the csp developers at home. :)

kind regards
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: Re: [osg-users] Render scene part to texture

2007-02-14 Thread [EMAIL PROTECTED]
Hi Robert,

i've checked the osgdistortion example and the osgprerender/renderToTexture 
example again. Rendering a scene part following these examples will not work 
and i am not sure if i'am on the right way...

For a better understanding what i want to realize, here a short example what i 
will do:

Imagine a smal scene like a racing track. In this scene you have several cars 
moving on the track and some environment objects arround this track. During 
rendering this scene i want to create multiple views of this scene by using  
RTT's. In example for a tracking-cameras or rear/side-view projected as HUD 
elements on top of the scene/screen.

My problem is, if i create the RTT based on the examples, the object which is 
the child of RTT-Camera is projected to the RTT. But only the object no one of 
the objects arraound this object (in example some of the other cars in the 
camera field of view or the sky in the backround ect.). 

If i add the scene to the camera or the group/translation where all Objects are 
attached, i only got an black screen or texture and sometimes a SIGFAULT.

Now i am not sure, if this is it the right way to realize multiple views? I 
know i could do this by using more openProducer cameras, but this bar me from 
using shaders for some special effects which i will use on the rtts ...

Best regards,
Chris






- Original Message -
From: [EMAIL PROTECTED] Robert Osfield
To: osg-users@openscenegraph.net
Date: 12.02.2007 21:07:03
Subject: Re: [osg-users] Render scene part to texture


 HI Chris,
 
 I don't of its what you are looking for by the osgdistortion example
 uses inheritance of the view and projection matrices for its RTT
 camera to capture the scene as it would have been seen using normal
 OSG camera manipualation.  The resulting texture is then distorted and
 applied to the screen.
 
 Robert.
 
 On 2/12/07, [EMAIL PROTECTED]
 [EMAIL PROTECTED] wrote:
  Hello,
 
  since some days i try to develop a tracking camera for my scene. The view 
  of the camera should be rendered into a texture to show that texture as hud 
  element combined with some shader effects.
 
  To realize that i've played arround with the render to texture example and 
  the osgprerender example. So far so good. Rendering a single object to 
  texture should not be the problem  if i add the object as subgraph to the 
  render to texture camera.
 
  But how should i realize this, if the object is a part of the rendering 
  scene? In this case the object and all surrounding objects  (normaly 
  parallel and parent nodes in the graph) in the field of view of the camera 
  should be rendered to this texture? Is this possible?
 
  I've checked the NPS tutorials, where the tracking camera is realized as 
  separate view context. Is it possible to render the result of this second 
  view to a texture?
 
  Best regards,
  Chris
 
 
 
  ___
  osg-users mailing list
  osg-users@openscenegraph.net
  http://openscenegraph.net/mailman/listinfo/osg-users
  http://www.openscenegraph.org/
 
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/
 



___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] Question about osgdepthshadow example.

2007-02-12 Thread [EMAIL PROTECTED]
Hi,

I'm trying to modify this example slightly so that only the depth buffer 
portion is rendered.  The shadow is cool, but is there a way to just render 
the depth buffer?

Thanks,
Brian

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Status of Combat Simulator Project

2007-02-08 Thread [EMAIL PROTECTED]

Our SVN server is up again at https://www.zerobar.net/csp/

If You have any further questions do not hesitate to ask.

Kind regards
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Status of Combat Simulator Project

2007-02-01 Thread [EMAIL PROTECTED]

Praveen Bhaniramka wrote:

Folks,

Would anyone on this list have information about the status of the CSP?


in ongoing development. http://csp.sourceforge.net/wiki/Development



I downloaded the Windows demos and definitely feel it would be fun to
play with and possibly develop further as needed. But I am unable to get
the SVN repository or register to the forums. 


it should be possible to register in the forum, we only have some stuff changed 
to prevent spam after bad experience. if you still can´t login catch me on icq 
133668500 (please mention csp)

seems that the svn is unreachable at the moment, sent onsight who run our 
development support server a message about it, should be fixed soon. there are 
several improvements of the svn version over the demo.

happy welcome, great that you are interested in developing. :)

kind regards, dust

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Performance drops when using 4 or more cameranodes (RTT)

2007-01-26 Thread [EMAIL PROTECTED]
Hi Robert,

Thanks for that tip!  It turns out that your suspicions were correct.  I 
get the following output when I run my app:

Setting up osg::CameraNode::FRAME_BUFFER_OBJECT
RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd9
OpenGL extension 'ARB_render_texture' is not supported.
Failed to aquire Graphics Context
Setting up osg::CameraNode::FRAME_BUFFER


What I don't understand is how an nVidia 7800 card does not support the 
ARB_render_texture extension.  :?  My guess is that something isn't being 
configured correctly, or that the extension has been replaced with 
something else, or perhaps it is a driver bug.  Any thoughts?  The card 
isn't exactly a low-end card.  I've also checked to see if 
WGL_ARB_render_texture is supported, and it isn't either.

Thanks,
Brian



On Thu, 25 Jan 2007 08:57:03 +, Robert Osfield 
[EMAIL PROTECTED] wrote :

 Hi Brian,
 
 How is the RTT being implementated?  Are you sure its FBO?  Running
 use OSG_NOTIFY_LEVEL set to DEBUG will print out what path the OSG
 uses for implementing the FBO.
 
 I have personally worked with FBO sizes way higher than window
 resolution, all the way up to 4k x 4k without problem.  I must admit I
 have only done this with a full screen window, but I'd be very
 surprised if its any different.
 
 From the description of the performance you a getting it I does kinda
 sound like there issue with the OpenGL driver.
 
 Robert.
 
 On 24 Jan 2007 17:58:53 -, [EMAIL PROTECTED] [EMAIL PROTECTED] 
wrote:
 
  Hi Robert,
 
  Actually, I have discovered what my problem was.  On two of the machines
  that I was testing on, their window dimensions were 640x480.  My 
original
  test machine was 512x512.  When I changed my test machine to 640x480, I 
saw
  the same drop in FPS on it as well.
 
  To my knowledge, I am not modifying the size of the 512x512 textures, 
so I
  am curious as to why increasing my window dimensions from 512x512 to
  640x480 would cause such a drastic frame rate drop.  :?  The only thing
  that I can think of would be that since the initial RTT texture is 
smaller
  than the actual window dimensions, this imposes a performance hit when 
the
  render to texture actually occurs.  Of course, that's just a stab in the
  dark.
 
  Can you think of any suggestions that I could try to get my framerate 
back
  up?  The final window dimensions will ultimately need to be full screen,
  but that kind of frame rate hit (~2-3 FPS) will just kill any usability.
  Even having just one floating point texture at 512x512 drops the frame 
rate
  to around 20FPS for a full screen app.
 
  BTW, the final texture for the RTT is being rendered at 512x512, not 
full
  screen.  It is a secondary view.
 
  Thanks,
  Brian
 
 
 
  On Wed, 24 Jan 2007 09:13:51 +, Robert Osfield
  [EMAIL PROTECTED] wrote :
 
   Hi Brian  Jeremy
  
   I know this doesn't help you guys, but for the record I used Linux
   almost everyday for the past 5 years, running with various NVidia
   hardware + drivers and haven't ever come across changes in performance
   w..r.t first boot up vs continued use.
  
   So its certainly possible to have OpenGL running near flawlessly year
   after year.
  
   But... there are dodgey drivers around and it sounds like you guys
   have got them installed, the quickest way to establish a pattern is to
   publish what drivers you are have a problem with and see if others are
   having the same problem.  Try upgrading or stepping back driver
   versions.
  
   NVidia have a set of forums that you could look at.  I can't recally
   the address but google will find it for you.
  
   Robert.
   ___
   osg-users mailing list
   osg-users@openscenegraph.net
   http://openscenegraph.net/mailman/listinfo/osg-users
   http://www.openscenegraph.org/
  
  
  
  ___
  osg-users mailing list
  osg-users@openscenegraph.net
  http://openscenegraph.net/mailman/listinfo/osg-users
  http://www.openscenegraph.org/
 
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/
 
 
 
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Performance drops when using 4 or more cameranodes (RTT)

2007-01-26 Thread [EMAIL PROTECTED]

Hi Robert,

I finally found the bug (in my code, of course.)  :)

It is amazing how one missing line of code can really wreak havoc on 
performance.  When I was setting up my cameraNodes, I set the first 
cameraNode that the scene renders to correctly.  The other camera nodes 
that I use with multiple shaders were not set up correctly.  I had 
forgotten to include the line:

m_CameraNode-setViewport(0, 0, width, height);

Adding this one line solved all of my problems.

I cannot stress how appreciative I am of the debugging capabilities built 
in to OSG!  I only wish that I had known about them earlier.

Thanks,
Brian

 
 Hi Robert,
 
 The osgprerender example using --hdr --fbo cow.osg works fine.  The 
last 
 lines in the debug output are:
 
 OpenGL extension 'GL_EXT_framebuffer_object' is supported.
 OpenGL extension 'GL_ARB_shader_objects' is supported.
 OpenGL extension 'GL_ARB_vertex_shader' is supported.
 OpenGL extension 'GL_ARB_fragment_shader' is supported.
 OpenGL extension 'GL_ARB_shading_language_100' is supported.
 glVersion=2, isGlslSupported=YES, glslLanguageVersion=1.1
 Setting up osg::CameraNode::FRAME_BUFFER_OBJECT
 
 I'll take a closer look at that example.  I'm obviously missing 
something.  
 Whether it's in my initial setup for the openGL window, the texture2D 
 object, or the FBO set up, I don't know.  However, I should be able to 
 track it down given that the example works.  
 
 After looking at the example, it is quite confusing to me because the way 
 the example sets up its FBO and texture seem to be exactly how my app 
does 
 it.  
 
 Thanks for the help,
 Brian
 
 
  HI Brian,
  
  I have 7800GTs and they work fine with FBO's.
  
  The pathway your code seems to be going through is for pbuffers
  though, so it looks like FBO isn't available, so its failling back to
  pbuffers, which is also not supported, so its falling back to frame
  buffer.
  
  Both FBO's and pbuffers are supported on your graphics card though, so
  I'm a bit perplexed as to what is amiss.  Drivers?
  
  Do the OSG RTT examples like osgprerender work ok? By default it
  should use FBO, then fallback to pbuffers if they arn't supported.
  
  Robert.
  
  On 26 Jan 2007 16:40:35 -, [EMAIL PROTECTED] 
[EMAIL PROTECTED] 
 wrote:
   Hi Robert,
  
   Thanks for that tip!  It turns out that your suspicions were 
correct.  I
   get the following output when I run my app:
  
   Setting up osg::CameraNode::FRAME_BUFFER_OBJECT
   RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd9
   OpenGL extension 'ARB_render_texture' is not supported.
   Failed to aquire Graphics Context
   Setting up osg::CameraNode::FRAME_BUFFER
  
  
   What I don't understand is how an nVidia 7800 card does not support 
the
   ARB_render_texture extension.  :?  My guess is that something isn't 
 being
   configured correctly, or that the extension has been replaced with
   something else, or perhaps it is a driver bug.  Any thoughts?  The 
card
   isn't exactly a low-end card.  I've also checked to see if
   WGL_ARB_render_texture is supported, and it isn't either.
  
   Thanks,
   Brian
  
  
  
   On Thu, 25 Jan 2007 08:57:03 +, Robert Osfield
   [EMAIL PROTECTED] wrote :
  
Hi Brian,
   
How is the RTT being implementated?  Are you sure its FBO?  Running
use OSG_NOTIFY_LEVEL set to DEBUG will print out what path the OSG
uses for implementing the FBO.
   
I have personally worked with FBO sizes way higher than window
resolution, all the way up to 4k x 4k without problem.  I must 
admit I
have only done this with a full screen window, but I'd be very
surprised if its any different.
   
From the description of the performance you a getting it I does 
kinda
sound like there issue with the OpenGL driver.
   
Robert.
   
On 24 Jan 2007 17:58:53 -, [EMAIL PROTECTED] 
 [EMAIL PROTECTED]
   wrote:

 Hi Robert,

 Actually, I have discovered what my problem was.  On two of the 
 machines
 that I was testing on, their window dimensions were 640x480.  My
   original
 test machine was 512x512.  When I changed my test machine to 
 640x480, I
   saw
 the same drop in FPS on it as well.

 To my knowledge, I am not modifying the size of the 512x512 
 textures,
   so I
 am curious as to why increasing my window dimensions from 512x512 
to
 640x480 would cause such a drastic frame rate drop.  :?  The only 
 thing
 that I can think of would be that since the initial RTT texture is
   smaller
 than the actual window dimensions, this imposes a performance hit 
 when
   the
 render to texture actually occurs.  Of course, that's just a stab 
 in the
 dark.

 Can you think of any suggestions that I could try to get my 
 framerate
   back
 up?  The final window dimensions will ultimately need to be full 
 screen,
 but that kind of frame rate hit (~2-3 FPS) will just kill any 
 usability.
 Even having just one

Re: [osg-users] Performance drops when using 4 or more cameranodes (RTT)

2007-01-24 Thread [EMAIL PROTECTED]

Hi Robert,

Actually, I have discovered what my problem was.  On two of the machines 
that I was testing on, their window dimensions were 640x480.  My original 
test machine was 512x512.  When I changed my test machine to 640x480, I saw 
the same drop in FPS on it as well.

To my knowledge, I am not modifying the size of the 512x512 textures, so I 
am curious as to why increasing my window dimensions from 512x512 to 
640x480 would cause such a drastic frame rate drop.  :?  The only thing 
that I can think of would be that since the initial RTT texture is smaller 
than the actual window dimensions, this imposes a performance hit when the 
render to texture actually occurs.  Of course, that's just a stab in the 
dark.

Can you think of any suggestions that I could try to get my framerate back 
up?  The final window dimensions will ultimately need to be full screen, 
but that kind of frame rate hit (~2-3 FPS) will just kill any usability.  
Even having just one floating point texture at 512x512 drops the frame rate 
to around 20FPS for a full screen app.  

BTW, the final texture for the RTT is being rendered at 512x512, not full 
screen.  It is a secondary view.

Thanks,
Brian



On Wed, 24 Jan 2007 09:13:51 +, Robert Osfield 
[EMAIL PROTECTED] wrote :

 Hi Brian  Jeremy
 
 I know this doesn't help you guys, but for the record I used Linux
 almost everyday for the past 5 years, running with various NVidia
 hardware + drivers and haven't ever come across changes in performance
 w..r.t first boot up vs continued use.
 
 So its certainly possible to have OpenGL running near flawlessly year
 after year.
 
 But... there are dodgey drivers around and it sounds like you guys
 have got them installed, the quickest way to establish a pattern is to
 publish what drivers you are have a problem with and see if others are
 having the same problem.  Try upgrading or stepping back driver
 versions.
 
 NVidia have a set of forums that you could look at.  I can't recally
 the address but google will find it for you.
 
 Robert.
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/
 
 
 
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


RE: [osg-users] Performance drops when using 4 or more cameranodes (RTT)

2007-01-23 Thread [EMAIL PROTECTED]

Well, I'm perplexed for sure.  I decided to uninstall my nvidia drivers, 
disabled my antivirus service, and reinstalled the drivers as per nvidia's 
suggestion.  I rebooted, and the application ran great at 75FPS.

I then decided to test other graphics settings because we have nearly 
identical systems that did not benefit from the drivers being reinstalled.  
The frame rate dropped down to 16FPS again, and I cannot get the original 
75FPS to resurface.

I am truly at a loss here.


On Tue, 23 Jan 2007 12:21:30 -0500, Gordon Tomlinson 
[EMAIL PROTECTED] wrote :

 One yhing don't forget MIP maps on your textures
 
 you need a to times by 4 then divide by 3 to your total texture usage 
below
 to add in the mip map requirments of your textures
 
 
 But that does not expand you usage too much...
 
 Best Regards
 
 
 
 Gordon
 
 __
 
 Gordon Tomlinson
 Email  : gordon.tomlinson @ overwatch.com
 YIM/AIM: Gordon3dBrit
 MSN IM : Gordon3dBrit @ 3dSceneGraph.com
 __
 
 Self defence is not a function of learning tricks
 but is a function of how quickly and intensely one
 can arouse one's instinct for survival
 - Master Tambo Tetsura
 
 
 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of
 [EMAIL PROTECTED]
 Sent: Tuesday, January 23, 2007 12:20 PM
 To: osg users
 Subject: Re: [osg-users] Performance drops when using 4 or more
 cameranodes (RTT)
 
 
 
 Hi,
 
 First, to answer Anders' question, my general specs are:
 
 Windows XP Pro
 nVidia 7800 GTX (512MB)
 
 
 As for how much texture memory that I'm using, I simplified my application
 to only load the cow model.  I have seven other textures loading:
 
 texN is width x height (internal format, source format, source type)
 
 tex0 is 512x512 (GL_RGBA16F_ARB, GL_RGBA, GL_UNSIGNED_BYTE)
 tex1 is 512x512 (GL_LUMINANCE, GL_LUMINANCE, GL_FLOAT)
 tex2-5 are all 512x512 (GL_RGBA16F_ARB, GL_RGBA, GL_FLOAT)
 tex6 is 512x512 (GL_RGBA, GL_RGBA, GL_FLOAT)
 
 Unless I'm misunderstanding how texture memory works, seven 512x512
 textures in the worst case scenario would take up:
 
 (512*512) * 4bytes (RGBA) * 4bytes (32-bit) * 7 textures = 28MB
 
 The second 4bytes (32-bit) is assuming GL_FLOAT uses 32-bits per RGBA.  
I
 realize that this calculation is wrong in the sense that not all textures
 are using the same internal formats, source types, or source formats; but 
I
 would assume that this is the worst it could ever be for these textures.
 With that in mind, it would appear that I should have plenty of texture
 memory available.
 
 I'm wondering if there is some limit to the amount of texture memory that
 can be associated with FBOs.  The same number of FBOs using texture 
formats
 of (GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE) works great, so I'm assuming that 
I
 haven't hit a limit as far as the number of FBOs is concerned.  If there 
is
 a limit on the overall texture memory that can be associated with FBOs, is
 there a relatively painless way of determining what that maximum texture
 memory size is?
 
 Thanks,
 Brian
 
 
 
 
 On Tue, 23 Jan 2007 08:50:39 +, Robert Osfield
 [EMAIL PROTECTED] wrote :
 
  Hi Brian,
 
  I'd check to see if you graphics card has sufficient memory for what
  you are trying to do
 
  Robert.
 
  On 22 Jan 2007 23:27:35 -, [EMAIL PROTECTED] [EMAIL PROTECTED]
 wrote:
   Hi,
  
   I'm using floating point textures as my targets for multipass RTT.  In
 my
   tests I have noticed that if three or less camera nodes are set up 
using
   GL_RGBA16F_ARB internal format textures, the frame rate stays at a
 constant
   75FPS when only the texture is rendered to the screen (i.e. the 
texture
 is
   rendered over the full window).
  
   If I add an additional camera node, the frame rate drops to 15 FPS.
 Five
   nodes yields 8FPS, and 5FPS are achieved with six nodes.  Also, if I 
set
   the texture to render to 1/4 of the screen and position the main 
camera
 so
   that the actual scene being rendered to texture is visible, I'll get
 25FPS
   for the three camera node implementation.
  
   I'm setting up my textures with internal formats of GL_RGBA16F_ARB, a
   source type of GL_FLOAT, and a source format of GL_RGBA.
  
   The FBO is set up like:
 fbo-setAttachment(GL_COLOR_ATTACHMENT0_EXT,
   osg::FrameBufferAttachment(texture));
  
 fbo-setAttachment(GL_DEPTH_ATTACHMENT_EXT,
   osg::FrameBufferAttachment(new osg::RenderBuffer(512, 512,
   GL_DEPTH_COMPONENT24)));
  
   My min/max filters are set up as NEAREST.
  
   If I change my textures to internal formats of GL_RGBA and the source
 type
   as GL_UNSIGNED_BYTE, my performance is great.
  
   Any thoughts?
  
   Thanks,
   Brian
   ___
   osg-users mailing list
   osg-users@openscenegraph.net
   http://openscenegraph.net/mailman/listinfo/osg-users
   http://www.openscenegraph.org

RE: [osg-users] Performance drops when using 4 or more cameranodes (RTT)

2007-01-23 Thread [EMAIL PROTECTED]

Well, I managed to get the 75FPS back by doing a Restore on the nVidia 
control panel.  The perplexing thing is that there are two other systems 
that I've tested on:  one has a high frame rate and the other's is slow.  
Both are using nVidia 7800 GT cards with default settings.  They are also 
both running WinXP Pro with nearly identical memory/hardware specs as well.

I'd really like to get this issue resolved, however I do realize that it is 
not an OSG specific topic.  Are there any good forums that someone could 
recommend?

Thanks,
Brian

On Tue, 23 Jan 2007 17:24:54 -0500, Jeremy L. Moles 
[EMAIL PROTECTED] wrote :

 On Tue, 2007-01-23 at 22:23 +, [EMAIL PROTECTED] wrote:
  Well, I'm perplexed for sure.  I decided to uninstall my nvidia 
drivers, 
  disabled my antivirus service, and reinstalled the drivers as per 
nvidia's 
  suggestion.  I rebooted, and the application ran great at 75FPS.
  
  I then decided to test other graphics settings because we have nearly 
  identical systems that did not benefit from the drivers being 
reinstalled.  
  The frame rate dropped down to 16FPS again, and I cannot get the 
original 
  75FPS to resurface.
  
  I am truly at a loss here.
 
 I don't know if you're talking about Linux here (I don't think you are)
 but I see the exact same thing w/ my Quadro2500M (which is a beastly
 card) in Fedora 6.
 
 If I run an osg example app right when I boot I get N fps; if I close
 and run that same app again I get about N/3 fps. 100% repeatable and
 consistent. Doesn't happen with DirectX, so maybe it's an OpenGL thing.
 
  On Tue, 23 Jan 2007 12:21:30 -0500, Gordon Tomlinson 
  [EMAIL PROTECTED] wrote :
  
   One yhing don't forget MIP maps on your textures
   
   you need a to times by 4 then divide by 3 to your total texture usage 
  below
   to add in the mip map requirments of your textures
   
   
   But that does not expand you usage too much...
   
   Best Regards
   
   
   
   Gordon
   
   __
   
   Gordon Tomlinson
   Email  : gordon.tomlinson @ overwatch.com
   YIM/AIM: Gordon3dBrit
   MSN IM : Gordon3dBrit @ 3dSceneGraph.com
   __
   
   Self defence is not a function of learning tricks
   but is a function of how quickly and intensely one
   can arouse one's instinct for survival
   - Master Tambo Tetsura
   
   
   
   
   -Original Message-
   From: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] Behalf Of
   [EMAIL PROTECTED]
   Sent: Tuesday, January 23, 2007 12:20 PM
   To: osg users
   Subject: Re: [osg-users] Performance drops when using 4 or more
   cameranodes (RTT)
   
   
   
   Hi,
   
   First, to answer Anders' question, my general specs are:
   
   Windows XP Pro
   nVidia 7800 GTX (512MB)
   
   
   As for how much texture memory that I'm using, I simplified my 
application
   to only load the cow model.  I have seven other textures loading:
   
   texN is width x height (internal format, source format, source type)
   
   tex0 is 512x512 (GL_RGBA16F_ARB, GL_RGBA, GL_UNSIGNED_BYTE)
   tex1 is 512x512 (GL_LUMINANCE, GL_LUMINANCE, GL_FLOAT)
   tex2-5 are all 512x512 (GL_RGBA16F_ARB, GL_RGBA, GL_FLOAT)
   tex6 is 512x512 (GL_RGBA, GL_RGBA, GL_FLOAT)
   
   Unless I'm misunderstanding how texture memory works, seven 512x512
   textures in the worst case scenario would take up:
   
   (512*512) * 4bytes (RGBA) * 4bytes (32-bit) * 7 textures = 28MB
   
   The second 4bytes (32-bit) is assuming GL_FLOAT uses 32-bits per 
RGBA.  
  I
   realize that this calculation is wrong in the sense that not all 
textures
   are using the same internal formats, source types, or source formats; 
but 
  I
   would assume that this is the worst it could ever be for these 
textures.
   With that in mind, it would appear that I should have plenty of 
texture
   memory available.
   
   I'm wondering if there is some limit to the amount of texture memory 
that
   can be associated with FBOs.  The same number of FBOs using texture 
  formats
   of (GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE) works great, so I'm assuming 
that 
  I
   haven't hit a limit as far as the number of FBOs is concerned.  If 
there 
  is
   a limit on the overall texture memory that can be associated with 
FBOs, is
   there a relatively painless way of determining what that maximum 
texture
   memory size is?
   
   Thanks,
   Brian
   
   
   
   
   On Tue, 23 Jan 2007 08:50:39 +, Robert Osfield
   [EMAIL PROTECTED] wrote :
   
Hi Brian,
   
I'd check to see if you graphics card has sufficient memory for what
you are trying to do
   
Robert.
   
On 22 Jan 2007 23:27:35 -, [EMAIL PROTECTED] 
[EMAIL PROTECTED]
   wrote:
 Hi,

 I'm using floating point textures as my targets for multipass 
RTT.  In
   my
 tests I have noticed that if three or less camera nodes are set 
up 
  using
 GL_RGBA16F_ARB internal format textures, the frame

RE: [osg-users] Performance drops when using 4 or more cameranodes (RTT)

2007-01-23 Thread [EMAIL PROTECTED]

Well, I managed to get the 75FPS back by doing a Restore on the nVidia 
control panel.  The perplexing thing is that there are two other systems 
that I've tested on:  one has a high frame rate and the other's is slow.  
Both are using nVidia 7800 GT cards with default settings.  They are also 
both running WinXP Pro with nearly identical memory/hardware specs as well.

I'd really like to get this issue resolved, however I do realize that it is 
not an OSG specific topic.  Are there any good forums that someone could 
recommend?

Thanks,
Brian

On Tue, 23 Jan 2007 17:24:54 -0500, Jeremy L. Moles 
[EMAIL PROTECTED] wrote :

 On Tue, 2007-01-23 at 22:23 +, [EMAIL PROTECTED] wrote:
  Well, I'm perplexed for sure.  I decided to uninstall my nvidia 
drivers, 
  disabled my antivirus service, and reinstalled the drivers as per 
nvidia's 
  suggestion.  I rebooted, and the application ran great at 75FPS.
  
  I then decided to test other graphics settings because we have nearly 
  identical systems that did not benefit from the drivers being 
reinstalled.  
  The frame rate dropped down to 16FPS again, and I cannot get the 
original 
  75FPS to resurface.
  
  I am truly at a loss here.
 
 I don't know if you're talking about Linux here (I don't think you are)
 but I see the exact same thing w/ my Quadro2500M (which is a beastly
 card) in Fedora 6.
 
 If I run an osg example app right when I boot I get N fps; if I close
 and run that same app again I get about N/3 fps. 100% repeatable and
 consistent. Doesn't happen with DirectX, so maybe it's an OpenGL thing.
 
  On Tue, 23 Jan 2007 12:21:30 -0500, Gordon Tomlinson 
  [EMAIL PROTECTED] wrote :
  
   One yhing don't forget MIP maps on your textures
   
   you need a to times by 4 then divide by 3 to your total texture usage 
  below
   to add in the mip map requirments of your textures
   
   
   But that does not expand you usage too much...
   
   Best Regards
   
   
   
   Gordon
   
   __
   
   Gordon Tomlinson
   Email  : gordon.tomlinson @ overwatch.com
   YIM/AIM: Gordon3dBrit
   MSN IM : Gordon3dBrit @ 3dSceneGraph.com
   __
   
   Self defence is not a function of learning tricks
   but is a function of how quickly and intensely one
   can arouse one's instinct for survival
   - Master Tambo Tetsura
   
   
   
   
   -Original Message-
   From: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] Behalf Of
   [EMAIL PROTECTED]
   Sent: Tuesday, January 23, 2007 12:20 PM
   To: osg users
   Subject: Re: [osg-users] Performance drops when using 4 or more
   cameranodes (RTT)
   
   
   
   Hi,
   
   First, to answer Anders' question, my general specs are:
   
   Windows XP Pro
   nVidia 7800 GTX (512MB)
   
   
   As for how much texture memory that I'm using, I simplified my 
application
   to only load the cow model.  I have seven other textures loading:
   
   texN is width x height (internal format, source format, source type)
   
   tex0 is 512x512 (GL_RGBA16F_ARB, GL_RGBA, GL_UNSIGNED_BYTE)
   tex1 is 512x512 (GL_LUMINANCE, GL_LUMINANCE, GL_FLOAT)
   tex2-5 are all 512x512 (GL_RGBA16F_ARB, GL_RGBA, GL_FLOAT)
   tex6 is 512x512 (GL_RGBA, GL_RGBA, GL_FLOAT)
   
   Unless I'm misunderstanding how texture memory works, seven 512x512
   textures in the worst case scenario would take up:
   
   (512*512) * 4bytes (RGBA) * 4bytes (32-bit) * 7 textures = 28MB
   
   The second 4bytes (32-bit) is assuming GL_FLOAT uses 32-bits per 
RGBA.  
  I
   realize that this calculation is wrong in the sense that not all 
textures
   are using the same internal formats, source types, or source formats; 
but 
  I
   would assume that this is the worst it could ever be for these 
textures.
   With that in mind, it would appear that I should have plenty of 
texture
   memory available.
   
   I'm wondering if there is some limit to the amount of texture memory 
that
   can be associated with FBOs.  The same number of FBOs using texture 
  formats
   of (GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE) works great, so I'm assuming 
that 
  I
   haven't hit a limit as far as the number of FBOs is concerned.  If 
there 
  is
   a limit on the overall texture memory that can be associated with 
FBOs, is
   there a relatively painless way of determining what that maximum 
texture
   memory size is?
   
   Thanks,
   Brian
   
   
   
   
   On Tue, 23 Jan 2007 08:50:39 +, Robert Osfield
   [EMAIL PROTECTED] wrote :
   
Hi Brian,
   
I'd check to see if you graphics card has sufficient memory for what
you are trying to do
   
Robert.
   
On 22 Jan 2007 23:27:35 -, [EMAIL PROTECTED] 
[EMAIL PROTECTED]
   wrote:
 Hi,

 I'm using floating point textures as my targets for multipass 
RTT.  In
   my
 tests I have noticed that if three or less camera nodes are set 
up 
  using
 GL_RGBA16F_ARB internal format textures, the frame

Re: [osg-users] osgVideo

2007-01-23 Thread [EMAIL PROTECTED]

Here comes another question;

Rendering in some systems due to the cpu rate or something else may not be
as fast as possible, that is they may not show the graphics in real-time;
are these screen capturing software programs able to handle this, may be by
writing the color buffer first rather than taking the actual screen image?

Hope still some people following this thread :))
Any ideas are appreciated..
Thanks in advance :)

On 11/10/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


Using the route described above, you can grab an image from a frame in a
post-draw callback and write it to a file regardless of its size and aspect
ratio I think, since it is not used as a texture.  Any video editing tool
(not just AVID) should be able to grab a sequence of frames and make an AVI
out of it.  I am sure even Window's Movie Maker, the free one that comes
with XP will do that.
I also ran across a little snippet of code somewhere that you could use to
write out an AVI, and even asks for what compression you want using the
CODECs installed.  I might be able to dig it up if you are interested.  The
part about running with a constant framerate is critical too, because it
takes quite a bit of processor/disk to do it all and the animation will not
be smooth.

-- Rick



On 11/9/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 When we're putting together promo videos, we just dump out each frame as
 a
 tga then use Avid to edit the sequence and turn it into a useable video.

 Admittedly we have a high-end Avid suite for this, but the dumping of
 the
 frames goes from the PS3, down the network and onto our PCs. We run at
 about 1 fps, but you can capture quite a lot of video by letting it run
 overnight. In our case, we have several machines capturing different
 parts
 of the game, then let the video guys sift through it all.
 There's no reason why you couldn't set up a 512x512 render target at the
 top of your scenegraph, change the aspect ratio to that of 720x480 (3:2)

 so it appears stretched (or if your card supports non-power-of-two
 textures, then you can do it at native resolution), then dump out each
 frame to an image file. I don't have any code to hand, but OSG can cope
 with that easily. When you come to encode it, you can stretch it back to
 the desired resolution. Oh, and don't forget to make your animation
 dependent on framerate (i.e. assume you're running at a constant
 framerate), so the animation runs smoothly at full speed; otherwise
 you'll
 pick up any variation in rendering speed.
 To put it all together, Avid did a home edition of their video editing
 software that was free to download and is fairly powerful, but I can't
 find it on their page, maybe they stopped doing it. If you're on Linux,
 there's a free bit of software for video editing, called Cinelerra
 (http://heroinewarrior.com/cinelerra.php3). If you want to automate the
 process, and you use Linux, Transcode
 (http://www.transcoding.org/cgi-bin/transcode) will import individual
 frames and spit out a video in a bunch of different formats. It might
 take
 some time to set up to your liking, but it'll happily cope with most
 things you can throw at it; it'll even mux any audio you might want to
 use.

 John Donovan
 Sony Computer Entertainment Europe
 http://www.scee.com


 [EMAIL PROTECTED] wrote on 09/11/2006 00:45:14:

  Hello,
 
  PLEASE!
  Does anybody have a way to automatically create an mpg or avi from an
 OSG
  fly through?  So, that it plays back in real-time?
 
  Basically, I want to generate videos for demo purposes.
 
  ie.
  loop
  update frame
  render scene
  capture screen
  down convert screen capture to acceptable format (720x480)
  end loop
  concatenate screen captures into video file.
 
  Recommendations are also welcome.
 
  Thanks.
 
  Zach
 
  ___
  osg-users mailing list
  osg-users@openscenegraph.net
  http://openscenegraph.net/mailman/listinfo/osg-users
  http://www.openscenegraph.org/


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

 This footnote also confirms that this email message has been checked
 for all known viruses.

 **
 Sony Computer Entertainment Europe

 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/



___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/





--
CodeSchbeke Software Solutions
Senior Project Team
Computer Engineering Department
Middle East

[osg-users] Performance drops when using 4 or more camera nodes (RTT)

2007-01-22 Thread [EMAIL PROTECTED]
Hi,

I'm using floating point textures as my targets for multipass RTT.  In my 
tests I have noticed that if three or less camera nodes are set up using 
GL_RGBA16F_ARB internal format textures, the frame rate stays at a constant 
75FPS when only the texture is rendered to the screen (i.e. the texture is 
rendered over the full window).  

If I add an additional camera node, the frame rate drops to 15 FPS.  Five 
nodes yields 8FPS, and 5FPS are achieved with six nodes.  Also, if I set 
the texture to render to 1/4 of the screen and position the main camera so 
that the actual scene being rendered to texture is visible, I'll get 25FPS 
for the three camera node implementation.

I'm setting up my textures with internal formats of GL_RGBA16F_ARB, a 
source type of GL_FLOAT, and a source format of GL_RGBA.

The FBO is set up like:
  fbo-setAttachment(GL_COLOR_ATTACHMENT0_EXT, 
osg::FrameBufferAttachment(texture));
  
  fbo-setAttachment(GL_DEPTH_ATTACHMENT_EXT, 
osg::FrameBufferAttachment(new osg::RenderBuffer(512, 512,
GL_DEPTH_COMPONENT24)));

My min/max filters are set up as NEAREST.

If I change my textures to internal formats of GL_RGBA and the source type 
as GL_UNSIGNED_BYTE, my performance is great.

Any thoughts?

Thanks,
Brian
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] GL_RGBA16F_ARB Texture source formats

2007-01-18 Thread [EMAIL PROTECTED]
Hi,

I am also trying to get a grasp on this subject.  Basically, I have n 
shader programs.  Shaders 1 to n-1 need to use floating point textures.  

As I understand it, the first shader to be rendered needs to have an 
internal format of GL_RGBA16F_ARB, a source format of GL_RGBA, and a source 
type of GL_UNSIGNED_BYTE.  

The floating point shaders need to have internal formats of GL_RGBA16F_ARB 
and source formats and types of GL_FLOAT

The last shader would need to have an internal format of GL_RGBA, a source 
format and type of GL_FLOAT.

Does this seem correct?  When I try this approach, I get an error:
RenderStage::drawInner(,) OpenGL errorNo= 0x502

Obviously, I'm doing something wrong, but I am uncertain as to what might 
be the problem.

Thanks,
Brian

On Wed, 17 Jan 2007 12:19:50 +, David Spilling 
[EMAIL PROTECTED] wrote :

 
 Robert,
 
 Thanks for that. I can see that this makes sense when (for example) you 
have
 an image in disk in RGBA8, and you load it into a texture with a different
 internal format (e.g. RGBA16F), then a conversion takes place on the way.
 
 But if you have a RTT, does the source format actually matter at all? By
 setting a texture internal format to RGBA16F and attaching that to a
 cameraNode, you are saying that the render target is RGBA16F, and shaders
 and the like operating on the graph underneath the camera can output float
 values; theres no RGBA8 to 16F conversion going on, is there?
 
 David
 
 
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] Overriding shader values using osgNV

2007-01-11 Thread [EMAIL PROTECTED]
Hi,

I noticed in the archives that osgNV is no longer being maintained, but I 
was wondering if anyone knows if it supports overriding the shader uniform 
values like osg::Uniform does.  For example, is there an osgNV equivalent 
to:

osg::Uniform* uniform = new osg::Uniform(
osg::Uniform::SAMPLER_2D, shaderEnabled);
uniform-set(1); 

rootStateSet-addUniform(uniform, osg::StateAttribute::OVERRIDE);

This lets me modify GLSL shader uniforms with no problem.  The problem is 
that we have some shaders written with Cg that need to be customized for a 
main camera and a CameraNode.  Test GLSL shaders work fine when modifying 
uniform values as shown above, but I've yet to figure out how to do this 
with osgNV.

Thanks,
Brian

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Drawables, RTT, and shaders

2007-01-10 Thread [EMAIL PROTECTED]

Hi, 

It's been about a month since I looked at this, but I'm finally able to get 
back to it.  Can you please explain how to override the inherited setting 
for the RTT CameraNode's StateSet?  I know how to add a Uniform value to a 
StateSet, but I am not familiar with how to override the value for the 
osg::Uniform of a parent node.  

I know how to override or inherit values using the setMode and/or 
setAttributesAndModes functions of the StateSet, but I have never used them 
in conjunction with a shader's Uniform value.

Thanks,
Brian


 Hi Brian,
 
 You should be able to define a StateSet on the RTT Camera subgraph
 that contains a osg::Uniform that overrides the inherited setting.
 
 For maximum performance you might want to just use a different shader
 though, one that doesn't have any lighting path.
 
 Robert.
 
  Hi,
 
  I have an application that I'm developing that uses RTT to render's an
  image to a quad in my scene that is based on the overall scene. Best
  analogy that I can give is that the rendered quad is similar to a 
security
  camera. The main display consists of a drawable that has a shader 
program
  attached to it to produce lighting effects. The shader has a parameter
  that allows the lighting effect to be toggled. The security camera is
  rendered using a series of camera nodes. Each camera node has a quad, a
  texture, and a shader attached to the geometry node for the quad. All 
this
  works nicely.
 
  The problem that I have run into is that ideally, I would like to toggle
  the lighting effects shader for the RTT. Currently, the main display's
  shader has lighting enabled, but the lighting effects are carried into 
the
  RTT for the security camera. Ideally, I'd like to enable the main
  display's lighting effects, but disable them for the RTT so that I can
  produce more realistic effects like night vision if that is possible.
 
  One thing to keep in mind is that all lighting effects are done through 
  the
  shader, but I do have a flag in the shader program that can disable the
  effect.
 
  I'm guessing that either node visitors or setting a cull mask might be 
the
  way to go, but I haven't had any luck with either of those methods. It's
  very possible that I'm going about it the wrong way. Any ideas?
 
  Thanks,
  Brian
 
 
 
 
 
 
  ___
  osg-users mailing list
  osg-users@openscenegraph.net
  http://openscenegraph.net/mailman/listinfo/osg-users
  http://www.openscenegraph.org/
  
 
 
 
 
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Drawables, RTT, and shaders

2007-01-10 Thread [EMAIL PROTECTED]

Hi, 

It's been about a month since I looked at this, but I'm finally able to get 
back to it.  Can you please explain how to override the inherited setting 
for the RTT CameraNode's StateSet?  I know how to add a Uniform value to a 
StateSet, but I am not familiar with how to override the value for the 
osg::Uniform of a parent node.  

I know how to override or inherit values using the setMode and/or 
setAttributesAndModes functions of the StateSet, but I have never used them 
in conjunction with a shader's Uniform value.

Thanks,
Brian


 Hi Brian,
 
 You should be able to define a StateSet on the RTT Camera subgraph
 that contains a osg::Uniform that overrides the inherited setting.
 
 For maximum performance you might want to just use a different shader
 though, one that doesn't have any lighting path.
 
 Robert.
 
  Hi,
 
  I have an application that I'm developing that uses RTT to render's an
  image to a quad in my scene that is based on the overall scene. Best
  analogy that I can give is that the rendered quad is similar to a 
security
  camera. The main display consists of a drawable that has a shader 
program
  attached to it to produce lighting effects. The shader has a parameter
  that allows the lighting effect to be toggled. The security camera is
  rendered using a series of camera nodes. Each camera node has a quad, a
  texture, and a shader attached to the geometry node for the quad. All 
this
  works nicely.
 
  The problem that I have run into is that ideally, I would like to toggle
  the lighting effects shader for the RTT. Currently, the main display's
  shader has lighting enabled, but the lighting effects are carried into 
the
  RTT for the security camera. Ideally, I'd like to enable the main
  display's lighting effects, but disable them for the RTT so that I can
  produce more realistic effects like night vision if that is possible.
 
  One thing to keep in mind is that all lighting effects are done through 
  the
  shader, but I do have a flag in the shader program that can disable the
  effect.
 
  I'm guessing that either node visitors or setting a cull mask might be 
the
  way to go, but I haven't had any luck with either of those methods. It's
  very possible that I'm going about it the wrong way. Any ideas?
 
  Thanks,
  Brian
 
 
 
 
 
 
  ___
  osg-users mailing list
  osg-users@openscenegraph.net
  http://openscenegraph.net/mailman/listinfo/osg-users
  http://www.openscenegraph.org/
  
 
 
 
 
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Drawables, RTT, and shaders

2007-01-10 Thread [EMAIL PROTECTED]
Hi,

Sometimes I tend to forget to look at the actual function declaration in 
the header files.  I just now noticed the second parameter that allows the 
override status to be set.  Guess I'm just tired.  

Thanks,
Brian

 
 Hi, 
 
 It's been about a month since I looked at this, but I'm finally able to 
get 
 back to it.  Can you please explain how to override the inherited setting 
 for the RTT CameraNode's StateSet?  I know how to add a Uniform value to 
a 
 StateSet, but I am not familiar with how to override the value for the 
 osg::Uniform of a parent node.  
 
 I know how to override or inherit values using the setMode and/or 
 setAttributesAndModes functions of the StateSet, but I have never used 
them 
 in conjunction with a shader's Uniform value.
 
 Thanks,
 Brian
 
 
  Hi Brian,
  
  You should be able to define a StateSet on the RTT Camera subgraph
  that contains a osg::Uniform that overrides the inherited setting.
  
  For maximum performance you might want to just use a different shader
  though, one that doesn't have any lighting path.
  
  Robert.
  
   Hi,
  
   I have an application that I'm developing that uses RTT to render's an
   image to a quad in my scene that is based on the overall scene. Best
   analogy that I can give is that the rendered quad is similar to a 
 security
   camera. The main display consists of a drawable that has a shader 
 program
   attached to it to produce lighting effects. The shader has a parameter
   that allows the lighting effect to be toggled. The security camera is
   rendered using a series of camera nodes. Each camera node has a quad, 
a
   texture, and a shader attached to the geometry node for the quad. All 
 this
   works nicely.
  
   The problem that I have run into is that ideally, I would like to 
toggle
   the lighting effects shader for the RTT. Currently, the main display's
   shader has lighting enabled, but the lighting effects are carried 
into 
 the
   RTT for the security camera. Ideally, I'd like to enable the main
   display's lighting effects, but disable them for the RTT so that I can
   produce more realistic effects like night vision if that is possible.
  
   One thing to keep in mind is that all lighting effects are done 
through 
   the
   shader, but I do have a flag in the shader program that can disable 
the
   effect.
  
   I'm guessing that either node visitors or setting a cull mask might 
be 
 the
   way to go, but I haven't had any luck with either of those methods. 
It's
   very possible that I'm going about it the wrong way. Any ideas?
  
   Thanks,
   Brian
  
  
  
  
  
  
   ___
   osg-users mailing list
   osg-users@openscenegraph.net
   http://openscenegraph.net/mailman/listinfo/osg-users
   http://www.openscenegraph.org/
   
  
  
  
  
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/
 
 
 
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Is it possible to share textures between RenderSurface objects?

2007-01-09 Thread [EMAIL PROTECTED]

I decided to go the extra mile and create another app that basically 
duplicates the Producer camera method with CameraNodes.  The original 
Producer camera application was more of a test than anything.  Long story 
short... the two running side-by-side were nearly identical.  A little 
finagling of the Producer version's POV have the two running side by side, 
and I cannot tell the difference between them.

Thanks for the help.  I especially am thankful for your confirming that the 
two methods should produce identical results.  Not to mention, the 
CameraNode version works at a higher framerate than the Producer method.

Thanks,
Brian

On 28 Dec 2006 03:14:39 -, [EMAIL PROTECTED] [EMAIL PROTECTED] 
wrote :

 
 Thanks for the suggestion, but it did not work.  Instead, the RTT is no 
 longer rendered and the texture, providing any exists, appears gray.  I 
 also get the following error when trying this:
 
 RenderStage::drawInner(,) OpenGL errorNo= 0x506
 
 which translates to INVALID_FRAMEBUFFER_OPERATION_EXT 
 
 Any other thoughts?
 
 Thanks,
 Brian
 
 
 
 On Wed, 27 Dec 2006 15:43:17 -0800, Don Burns 
[EMAIL PROTECTED] 
 wrote :
 
  
  Try calling Producer::RenderSurface::shareAllGLContexts(true) before you
  create any RenderSurfaces (or call Camera::frame() );
  
  -don
  
  On 27 Dec 2006 23:17:37 -, [EMAIL PROTECTED] [EMAIL PROTECTED]
  wrote:
  
   Hi,
  
   I have developed an application that uses one camera that uses camera
   nodes
   to render a scene to a texture.  It works fine and has no problems 
 (that I
   know of.)
  
   I have recently been asked to create another window with a camera in 
it
   that simply displays the texture rendered in my original application
   window.  I've tried setting up the new window's camera with either a
   shared
   RenderSurface object from the original application's window or its own
   private RenderSurface object.  In both cases, I cannot get the 
texture, 
 an
   osg::Texture2D object created for the original camera, to display.
  
   What I wind up seeing is my scene along with a *partial* rendered 
scene 
 in
   the original window, and in the new window, I see my quad rendered as 
a
   gray image.  The gray image persists even when the texture is not 
added 
 to
   the geometry's state set, and the partial rendered scene that had 
 appeared
   in the original window also disappears.  This leads me to the 
conclusion
   that the texture itself is not being seen by the second camera.
  
   Is there a way to get the second camera to recognize and correctly 
 display
   a texture rendered by the first camera?  The RTT does its job fine, 
and 
 a
   quad using the rendered texture can be displayed in the original 
window.
   It's only when I add the second camera that I have problems.
  
   Thanks,
   Brian
  
   ___
   osg-users mailing list
   osg-users@openscenegraph.net
   http://openscenegraph.net/mailman/listinfo/osg-users
   http://www.openscenegraph.org/
  
  
  
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/
 
 
 
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Is it possible to share textures between RenderSurface objects?

2007-01-04 Thread [EMAIL PROTECTED]
Hi Robert,

It's a puzzling problem for sure.  In each implementation, I have verified 
that all of the shaders are working.  However, in the Producer version, the 
images produced by the shader's histogram are different than those produced 
by the CameraNode implementation.  It appears that imagery is being lost 
in the CameraNode version.  By lost, I mean that the textures generated 
in each pass don't seem to be accumulating as I would expect.  They do 
accumulate, or use image information from a previous pass, but the outcome 
is different.  

To further complicate things, my coworker/boss is convinced that we have to 
go the Producer route, and he may be right for all I know.  His basic 
reasoning is that everyone else is doing it that way.  If I may ask, 
which method (Producer or CameraNode) is the most efficient in terms of 
speed, or are they about the same?  If it's the CameraNode version, then 
I'd love to convince my coworker otherwise; and he would certainly be open 
to the idea.  However, until I can duplicate the images using CameraNodes, 
that is not going to be easy.  Right now, I'm just trying to appease him by 
finding a solution to the Producer method.

If it helps you understand, we're in the process of trying to do various IR 
sensor effects using shaders.  So, the first rendering pass might perform a 
noise filter, the next might be a blur filter, and then a sharpening 
filter.  

Thanks,
Brian

On Wed, 3 Jan 2007 19:16:45 +, Robert Osfield 
[EMAIL PROTECTED] wrote :

 Hi Brian,
 
 In what way is the rendering not what you expect when you use
 osg::CameraNode?  Its all OpenGL under the hood so most likely causes
 are some difference in OpenGL state or the depth of the colour buffer.
 
 Robert.
 
 On 3 Jan 2007 16:54:12 -, [EMAIL PROTECTED] [EMAIL PROTECTED] 
wrote:
 
  Hi Robert,
 
  Yes, I agree that using the CameraNode would be easier and more 
efficient
  than using the Producer.  I have also implemented the code below using
  CameraNodes, and as far as I can tell the same shaders are being used in
  the same order.  However, the output is clearly different.  It's as 
though
  there is another step being performed by Producer that is causing the
  imagery to be rendered correctly.  I'd like to say that my CameraNode
  implementation is the correct one, but I've been convinced otherwise.
 
  What I plan to do is to simplify the scenario a bit and work from there.
  As you've pointed out, the current implementation is a bit complex.
 
  Thanks,
  Brian
 
  On Wed, 3 Jan 2007 10:37:00 +, Robert Osfield
  [EMAIL PROTECTED] wrote :
 
   Hi Brian,
  
   Your set up is too complex for me to get my head around remotely.
   Personally I wouldn't use Producer for FBO work, the core OSG's
   osg::CameraNode (now named osg::Camera in CVS) has support for FBO
   while Producer doesn't.  Please see the OSG RTT examples such as
   osgprerender, osgprerendercubemap, osgshadowtexture etc.
  
   Robert.
  
   On 2 Jan 2007 23:45:37 -, [EMAIL PROTECTED] 
[EMAIL PROTECTED]
  wrote:
   
Hi Robert,
   
Thanks again for the tips, but I'm still struggling with this issue.
Here's what I'm attempting at a slightly deeper level.
   
I'm using two cameras.  One is my main scene, and the other is used 
to
  do
multipass rendering.  The multipass render camera uses a drawable 
object
that does nothing but clear the color and depth buffers.  Attached 
to
  this
multipass camera are n additional cameras and a rendering surface.
   
Each camera has a newly allocated drawable object as described 
above.
Associated with each additional camera (Producer::Camera) is a new 
FBO,
Geode, texture, scene handler, and render buffer.  The FBOs are set 
up
  so
that the output of the previous render will be used as the input to 
the
next rendering cycle.  Each texture has its own shader that is
  associated
with it.
   
In the multipass camera's main rendering function, all the 
additional
cameras are rendered to produce a final image that is output to the
display.  This all works fine, and hopefully what I wrote makes 
sense.
   
The problem that I'm having is that because the multipass camera 
has its
own rendering surface, it also has its own window.  Since this is a
secondary camera, I'd like to take the final imagery that is 
generated
  for
the multipass camera and use it in the main application window.  I 
had
hoped that it would be a simple matter of attaching a quad to a 
geode
  and
then attaching the secondary window's final texture to the geode's
stateset.  Unfortunately, the only thing rendered to the main
  application's
geode is a gray quad, whereas the secondary window is rendering
  correctly.
   
I have verified that the pipeline is rendering the multipass camera
  before
the main window's camera.  I have also tried creating a camera node 
in
  the
main camera using the final texture

Re: [osg-users] Is it possible to share textures between RenderSurface objects?

2007-01-03 Thread [EMAIL PROTECTED]

Hi Robert,

Yes, I agree that using the CameraNode would be easier and more efficient 
than using the Producer.  I have also implemented the code below using 
CameraNodes, and as far as I can tell the same shaders are being used in 
the same order.  However, the output is clearly different.  It's as though 
there is another step being performed by Producer that is causing the 
imagery to be rendered correctly.  I'd like to say that my CameraNode 
implementation is the correct one, but I've been convinced otherwise.

What I plan to do is to simplify the scenario a bit and work from there.  
As you've pointed out, the current implementation is a bit complex.

Thanks,
Brian

On Wed, 3 Jan 2007 10:37:00 +, Robert Osfield 
[EMAIL PROTECTED] wrote :

 Hi Brian,
 
 Your set up is too complex for me to get my head around remotely.
 Personally I wouldn't use Producer for FBO work, the core OSG's
 osg::CameraNode (now named osg::Camera in CVS) has support for FBO
 while Producer doesn't.  Please see the OSG RTT examples such as
 osgprerender, osgprerendercubemap, osgshadowtexture etc.
 
 Robert.
 
 On 2 Jan 2007 23:45:37 -, [EMAIL PROTECTED] [EMAIL PROTECTED] 
wrote:
 
  Hi Robert,
 
  Thanks again for the tips, but I'm still struggling with this issue.
  Here's what I'm attempting at a slightly deeper level.
 
  I'm using two cameras.  One is my main scene, and the other is used to 
do
  multipass rendering.  The multipass render camera uses a drawable object
  that does nothing but clear the color and depth buffers.  Attached to 
this
  multipass camera are n additional cameras and a rendering surface.
 
  Each camera has a newly allocated drawable object as described above.
  Associated with each additional camera (Producer::Camera) is a new FBO,
  Geode, texture, scene handler, and render buffer.  The FBOs are set up 
so
  that the output of the previous render will be used as the input to the
  next rendering cycle.  Each texture has its own shader that is 
associated
  with it.
 
  In the multipass camera's main rendering function, all the additional
  cameras are rendered to produce a final image that is output to the
  display.  This all works fine, and hopefully what I wrote makes sense.
 
  The problem that I'm having is that because the multipass camera has its
  own rendering surface, it also has its own window.  Since this is a
  secondary camera, I'd like to take the final imagery that is generated 
for
  the multipass camera and use it in the main application window.  I had
  hoped that it would be a simple matter of attaching a quad to a geode 
and
  then attaching the secondary window's final texture to the geode's
  stateset.  Unfortunately, the only thing rendered to the main 
application's
  geode is a gray quad, whereas the secondary window is rendering 
correctly.
 
  I have verified that the pipeline is rendering the multipass camera 
before
  the main window's camera.  I have also tried creating a camera node in 
the
  main camera using the final texture, FBO, and rendering surface from the
  multipass camera.   This, too, failed.
 
  I hope that my explanation of what I'm trying to do makes sense.  If 
not,
  I'd be more than happy to try and clarify.
 
  Thanks,
  Brian
 
   Hi Brian,
  
   I'm just about to head away for a trip, so some quick pointers.  Yes
   you can share texture objects between separate graphics contexts in
   certain situations, but its isn't universally supported by graphics
   drivers/hardware.  You can get the OSG/Producer to do it use but I
   can't recall the details off the top of my head, so you'll need to dig
   into the API of Producer.
  
   The quickest thing is probably to just have a HUD on the same window
   that has your RTT texture.  See the osgshadowtexture example for just
   this type of usage.
  
   Robert.
  
   On 27 Dec 2006 23:17:37 -, [EMAIL PROTECTED] 
[EMAIL PROTECTED]
  wrote:
Hi,
   
I have developed an application that uses one camera that uses 
camera
  nodes
to render a scene to a texture.  It works fine and has no problems
  (that I
know of.)
   
I have recently been asked to create another window with a camera 
in it
that simply displays the texture rendered in my original application
window.  I've tried setting up the new window's camera with either a
  shared
RenderSurface object from the original application's window or its 
own
private RenderSurface object.  In both cases, I cannot get the 
texture,
  an
osg::Texture2D object created for the original camera, to display.
   
What I wind up seeing is my scene along with a *partial* rendered 
scene
  in
the original window, and in the new window, I see my quad rendered 
as a
gray image.  The gray image persists even when the texture is not 
added
  to
the geometry's state set, and the partial rendered scene that had
  appeared
in the original window also disappears.  This leads me to the 
conclusion

Re: [osg-users] Is it possible to share textures between RenderSurface objects?

2007-01-02 Thread [EMAIL PROTECTED]

Hi Robert,

Thanks again for the tips, but I'm still struggling with this issue.  
Here's what I'm attempting at a slightly deeper level.

I'm using two cameras.  One is my main scene, and the other is used to do 
multipass rendering.  The multipass render camera uses a drawable object 
that does nothing but clear the color and depth buffers.  Attached to this 
multipass camera are n additional cameras and a rendering surface.

Each camera has a newly allocated drawable object as described above.  
Associated with each additional camera (Producer::Camera) is a new FBO, 
Geode, texture, scene handler, and render buffer.  The FBOs are set up so 
that the output of the previous render will be used as the input to the 
next rendering cycle.  Each texture has its own shader that is associated 
with it.

In the multipass camera's main rendering function, all the additional 
cameras are rendered to produce a final image that is output to the 
display.  This all works fine, and hopefully what I wrote makes sense.

The problem that I'm having is that because the multipass camera has its 
own rendering surface, it also has its own window.  Since this is a 
secondary camera, I'd like to take the final imagery that is generated for 
the multipass camera and use it in the main application window.  I had 
hoped that it would be a simple matter of attaching a quad to a geode and 
then attaching the secondary window's final texture to the geode's 
stateset.  Unfortunately, the only thing rendered to the main application's 
geode is a gray quad, whereas the secondary window is rendering correctly.

I have verified that the pipeline is rendering the multipass camera before 
the main window's camera.  I have also tried creating a camera node in the 
main camera using the final texture, FBO, and rendering surface from the 
multipass camera.   This, too, failed.

I hope that my explanation of what I'm trying to do makes sense.  If not, 
I'd be more than happy to try and clarify.

Thanks,
Brian

 Hi Brian,
 
 I'm just about to head away for a trip, so some quick pointers.  Yes
 you can share texture objects between separate graphics contexts in
 certain situations, but its isn't universally supported by graphics
 drivers/hardware.  You can get the OSG/Producer to do it use but I
 can't recall the details off the top of my head, so you'll need to dig
 into the API of Producer.
 
 The quickest thing is probably to just have a HUD on the same window
 that has your RTT texture.  See the osgshadowtexture example for just
 this type of usage.
 
 Robert.
 
 On 27 Dec 2006 23:17:37 -, [EMAIL PROTECTED] [EMAIL PROTECTED] 
wrote:
  Hi,
 
  I have developed an application that uses one camera that uses camera 
nodes
  to render a scene to a texture.  It works fine and has no problems 
(that I
  know of.)
 
  I have recently been asked to create another window with a camera in it
  that simply displays the texture rendered in my original application
  window.  I've tried setting up the new window's camera with either a 
shared
  RenderSurface object from the original application's window or its own
  private RenderSurface object.  In both cases, I cannot get the texture, 
an
  osg::Texture2D object created for the original camera, to display.
 
  What I wind up seeing is my scene along with a *partial* rendered scene 
in
  the original window, and in the new window, I see my quad rendered as a
  gray image.  The gray image persists even when the texture is not added 
to
  the geometry's state set, and the partial rendered scene that had 
appeared
  in the original window also disappears.  This leads me to the conclusion
  that the texture itself is not being seen by the second camera.
 
  Is there a way to get the second camera to recognize and correctly 
display
  a texture rendered by the first camera?  The RTT does its job fine, and 
a
  quad using the rendered texture can be displayed in the original window.
  It's only when I add the second camera that I have problems.
 
  Thanks,
  Brian
 
  ___
  osg-users mailing list
  osg-users@openscenegraph.net
  http://openscenegraph.net/mailman/listinfo/osg-users
  http://www.openscenegraph.org/
 
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/
 
 
 
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Use CEGUI with OSG?

2006-12-29 Thread [EMAIL PROTECTED]

I use CEGUI as well and have seen problems of this sort.  My application 
uses multitexturing, so this may not apply to what you are doing.  I 
discovered that the problem was usually solved by doing the following:

In the call to OpenGLRenderer::initPerFrameStates(void), I found that I 
needed to call the following functions before rendering.  The 
glActiveTextureARB call is an extension function, and the texid is the id 
of the texture being used.

  // put the call to glActiveTextureARB after the calls to the following
  // functions
  glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS);
  glPushAttrib(GL_ALL_ATTRIB_BITS);

  glActiveTextureARB(GL_TEXTURE0);
  

This will help to ensure that the active texture is reset to GL_TEXTURE0, 
which CEGUI uses by default, in the event that some multi-texturing aspect 
of your program has it set to some other value by the time 
OpenGLRenderer::doRender is called.

I have seen other situations that cause crazy texturing problems like you 
spoke of even with these changes, however they were generally solved the 
same way.  For instance, if you have drawable objects, you might need to 
push and pop the attributes and reset the active texture.  This may not be 
the most effecient method, but it works for my application.

Incidentally, check out CEGUI's web site/forum for answers to a lot of 
questions.  Also, the IRC channel, #CEGUI on irc.freenode.net, is a great 
source for help.  This is really more of a CEGUI-specific question, but 
hopefully my suggestions will help you in the meantime.

-Brian

On Fri, 29 Dec 2006 21:20:14 +0800 (CST), lin [EMAIL PROTECTED] wrote :

 
 
 How can I use CEGUI with OSG? We integrate CEGUI for HUDs, In the 
application, sometimes the HUD is right, sometimes the HUD's texture is 
wrong, sometimes the HUD disappears. can somebody give me a demo?
I have saw the message:adaptation of CEGUI and OSG at:
 ftp://yag2002.homeftp.org/VRC/VRC-sources-July-31-2005.zip,but I can't 
download it.  
  
 
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] Is it possible to share textures between RenderSurface objects?

2006-12-27 Thread [EMAIL PROTECTED]
Hi,

I have developed an application that uses one camera that uses camera nodes 
to render a scene to a texture.  It works fine and has no problems (that I 
know of.) 

I have recently been asked to create another window with a camera in it 
that simply displays the texture rendered in my original application 
window.  I've tried setting up the new window's camera with either a shared 
RenderSurface object from the original application's window or its own 
private RenderSurface object.  In both cases, I cannot get the texture, an 
osg::Texture2D object created for the original camera, to display.  

What I wind up seeing is my scene along with a *partial* rendered scene in 
the original window, and in the new window, I see my quad rendered as a 
gray image.  The gray image persists even when the texture is not added to 
the geometry's state set, and the partial rendered scene that had appeared 
in the original window also disappears.  This leads me to the conclusion 
that the texture itself is not being seen by the second camera.  

Is there a way to get the second camera to recognize and correctly display 
a texture rendered by the first camera?  The RTT does its job fine, and a 
quad using the rendered texture can be displayed in the original window.  
It's only when I add the second camera that I have problems.

Thanks,
Brian

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] Drawables, RTT, and shaders

2006-12-14 Thread [EMAIL PROTECTED]
Hi,

I have an application that I'm developing that uses RTT to render's an 
image to a quad in my scene that is based on the overall scene. Best 
analogy that I can give is that the rendered quad is similar to a security 
camera. The main display consists of a drawable that has a shader program 
attached to it to produce lighting effects. The shader has a parameter 
that allows the lighting effect to be toggled. The security camera is 
rendered using a series of camera nodes. Each camera node has a quad, a 
texture, and a shader attached to the geometry node for the quad. All this 
works nicely.

The problem that I have run into is that ideally, I would like to toggle 
the lighting effects shader for the RTT. Currently, the main display's 
shader has lighting enabled, but the lighting effects are carried into the 
RTT for the security camera. Ideally, I'd like to enable the main 
display's lighting effects, but disable them for the RTT so that I can 
produce more realistic effects like night vision if that is possible.

One thing to keep in mind is that all lighting effects are done through the 
shader, but I do have a flag in the shader program that can disable the 
effect.

I'm guessing that either node visitors or setting a cull mask might be the 
way to go, but I haven't had any luck with either of those methods. It's 
very possible that I'm going about it the wrong way. Any ideas?

Thanks,
Brian






___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] link error: RenderSurface_X11.obj : error LNK2001: unresolved external symbol

2006-12-14 Thread [EMAIL PROTECTED]
I am using the stable zipped download from main osg website.  I have checked my 
options settings but everything looks ok
so Im at a loss atm.  I will keep looking for something I've missed .

cheers
neighborlee

---
Hi,

What version of Producer are you using?  I haven't seen any reports of
similiar problems before so it sounds like either a new problem in CVS
or that your install/compile has screwed up for some reason.
ReaderSurface_X11.cpp if compiled at all should just compile to an
empty file in anything other than Unix.

Robert.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] link error: RenderSurface_X11.obj : error LNK2001: unresolved external symbol

2006-12-13 Thread [EMAIL PROTECTED]
I am using  vc++express 2005 atm and getting this error during compile ( OT 
compiled just fine in debug) of producer in debug mode:

RenderSurface_X11.obj : error LNK2001: unresolved external symbol
I think I may have delted something from vc++ options and while I reinstalled 
it did not help.
thx anyone
nl
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] Creating an Image using GL_LUMINANCE and GL_FLOAT

2006-12-01 Thread [EMAIL PROTECTED]
Hi,

I'm trying to generate an image using GL_LUMINANCE and GL_FLOAT, however no 
matter what values (ranging from 0 to 1.0) I use in my image buffer, I 
always get an image that has RGB values of 205,205,205.  The number 205 
is typically used when the debugger initializes variables, so this leads me 
to believe that my Image object is incorrectly set up.

If I write the image to a file or simply attach it to a Texture2D object, I 
only see a pure gray image.



osg::Image* NoiseImage = new osg::Image();


// generate random values between 0 and 1
for (int i=0; iNoiseBufferSize; i++)
{
g_NoiseImageF[i] = (float)(rand() % 4096) / 4096.0f;
}


NoiseImage-setImage(width, 
height, 
1, 
GL_LUMINANCE, 
GL_LUMINANCE, 
GL_FLOAT, 
(unsigned char*) g_NoiseImageF, 
osg::Image::NO_DELETE);

osgDB::writeImageFile(*NoiseImage, c:/noise.bmp);


I've looked at various examples in the OSG examples.  One example set the 
Image's internal texture format to GL_LUMINANCE_FLOAT32_ATI.  I tried this, 
but it simply hung my application.  I tried using GL_LUMINANCE for the 
image's texture format, but that had no effect either. Any help would be 
most appreciated.

Thanks,
Brian

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Multiple shaders and RTT

2006-11-24 Thread [EMAIL PROTECTED]
Hi Robert,

I understand about reviewing the code.  I only included it in case it might 
prove helpful.

Anyway, while I haven't gotten this to work just yet, I have managed to 
confirm a few things.

Separately, both CameraNodes can be added and render their respective 
textures fine, so I know that they are set up correctly in that regard.

I've set up a quad osg::geometry and have added it to the camera node and 
have associated a texture with it for test purposes.

CameraNode1 - quad with test texture
  |
  |-- CameraNode2 - cow node attached


When I render my final quad using CameraNode1's RTT texture, it correctly 
displays the rendered textured quad.

However, I am assuming that in order to render the quad's texture with 
CameraNode2's rendered scene, I would need to use the texture associated 
with CameraNode2's texture that is attached to its FBO for RTT.


CameraNode1 - quad with CameraNode2's rendered texture
  |
  |-- CameraNode2 - cow node attached


When I try this approach, I see a black square.

Both camera nodes are set to PRE_RENDER.

Thanks,
Brian


On Wed, 22 Nov 2006 09:04:58 +, Robert Osfield 
[EMAIL PROTECTED] wrote :

 Hi Brian,
 
 Doing code reviews of user code is bit beyond what I have time for.
 I'd recommend getting the nested RTT camera working as you want first,
 without the enclosing/parent RTT camera.  Then once you are happy with
 this then add the enclosing RTT camera.
 
 Robert.
 
 On 22 Nov 2006 00:46:56 -, [EMAIL PROTECTED] [EMAIL PROTECTED] 
wrote:
  Hi Robert,
 
  One quick question.
 
   Applogies I didn't quite differentiate the different options properly.
   A NESTED_RENDER woulnd't generally be used for RTT, as all the drawing
   goes into the current RenderStage, rather than have then drop into a
   RenderStage drawn before the enclosing RenderStage.
  
   CameraNode - PRE_RENDER  - one
 |
 |--  CameraNode - PRE_RENDER - two
   |
   |-- Cow node.
 
  I'm thinking that I should set up CameraNode 1 as an ortho 2D camera.
  However, I'm having a dumb moment and cannot seem to get it set up
  correctly.
 
 
  I set up my CameraNodes like:
 
 
  osg::ref_ptrosg::FrameBufferObject fbo1 =
  new osg::FrameBufferObject();
 
  fbo1-setAttachment(GL_COLOR_ATTACHMENT0_EXT,
  osg::FrameBufferAttachment(CameraTexture1));
 
  osg::RenderBuffer *renderBuffer1 = NULL;
 
  renderBuffer1 = new osg::RenderBuffer(512,
  512, GL_DEPTH_COMPONENT24)));
 
  fbo1-setAttachment(GL_DEPTH_ATTACHMENT_EXT,
  osg::FrameBufferAttachment(renderBuffer1));
 
 
  CameraNode1 = new osg::CameraNode;
  CameraNode1-setClearColor(osg::Vec4(0.f, 0.5f, 0.f, 1.f));
  CameraNode1-setClearMask(GL_COLOR_BUFFER_BIT);
  CameraNode1-setViewport(0, 0, width, height);
 
  // set up projection.
  CameraNode1-setProjectionMatrixAsOrtho2D(0.0, width, 0.0, height);
 
  // set view
  CameraNode1-setReferenceFrame(osg::Transform::ABSOLUTE_RF);
 
  // set the camera to render before the main camera.
  CameraNode1-setRenderOrder(osg::CameraNode::PRE_RENDER);
 
  osg::CameraNode::RenderTargetImplementation renderImplementation;
  renderImplementation = osg::CameraNode::FRAME_BUFFER_OBJECT;
 
  CameraNode1-setRenderTargetImplementation(renderImplementation);
  CameraNode1-attach(osg::CameraNode::COLOR_BUFFER, CameraTexture1);
 
 
  and CameraNode2 like
 
  osg::ref_ptrosg::FrameBufferObject fbo2 =
  new osg::FrameBufferObject();
 
  fbo2-setAttachment(GL_COLOR_ATTACHMENT0_EXT,
  osg::FrameBufferAttachment(CameraTexture2));
 
  osg::RenderBuffer *renderBuffer2 =
  new osg::RenderBuffer(512, 512, GL_DEPTH_COMPONENT24))
 
  fbo2-setAttachment(GL_DEPTH_ATTACHMENT_EXT,
  osg::FrameBufferAttachment(renderBuffer2));
 
 
  CameraNode2 = new osg::CameraNode;
 
  CameraNode2-setClearColor(osg::Vec4(1.f, 0.f, 0.f, 1.f));
  CameraNode2-setClearMask(GL_COLOR_BUFFER_BIT |
  GL_DEPTH_BUFFER_BIT);
 
  CameraNode2-setViewport(0, 0, width, height);
 
  CameraNode2-setComputeNearFarMode(
  osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);
 
  CameraNode2-setProjectionMatrixAsPerspective(
  30.0, 1.0, 0.1, 5.0);
 
  // set view
  CameraNode2-setReferenceFrame(osg::Transform::ABSOLUTE_RF);
 
  // set the camera to render before the main camera.
  CameraNode2-setRenderOrder(osg::CameraNode::PRE_RENDER);
 
 
  //osg::CameraNode::RenderTargetImplementation renderImplementation;
  renderImplementation = osg::CameraNode::FRAME_BUFFER_OBJECT;
  CameraNode2-setRenderTargetImplementation(renderImplementation);
  CameraNode2-attach(osg::CameraNode::COLOR_BUFFER, CameraTexture2);
 
 
 
  I then add CameraNode2 to CameraNode1 like
 
  CameraNode1-addChild(CameraNode2);
 
  I then add the main scene (a cow for now) node to CameraNode2 like
 
  CameraNode2-addChild(CowNode);
 
 
  If I

Re: [osg-users] Preframe callbacks with CameraNode

2006-11-03 Thread [EMAIL PROTECTED]
Hi,

I have been trying to disable lighting in my RTT CameraNode.  Well, I have 
discovered that it is not a true light that I am concerned with here.  The 
lighting is being implemented through a shader that a coworker wrote, so 
the stateset management has been working all along.  However, since the 
shader has no knowledge of this, it continues to produce lighting effects.

While I am using Delta3D as my rendering package, the core OSG is exposed 
to me.  I have set up a preframe callback for my main Producer camera, and 
I'm using a node visitor with an update callback for the CameraNode.

Closer inspection of my code (it's been several months since I set it up 
originally) reveals that my rendering is set up like

CameraNode
Producer camera - scene - CameraNode - drawables

No RTT
Producer camera - scene - drawables


I'm using osgNV to modify the shader uniform for disabling the light 
shader, and while both the preframe callback and node visitor update 
callback are hit, only the changes made by the preframe callback are taken 
into account.  Setting the light uniform in the preframe callback to render 
renders the light for both cameras even though I'm saying otherwise in the 
node visitor update callback.

I'm obviously going about this the wrong way, but I don't know what other 
way to go.  I've also tried setting up a frame buffer object update 
callback like:


   osg::FrameBufferObject *fbo = new osg::FrameBufferObject();

   // actually, fbo is a ref pointer, but to help it fit on one line
   // I removed that code.

   fbo-setUpdateCallback(new FboCallback(true));

This had absolutely no effect.  The callback's () operator was never hit.

Any help would be greatly appreciated.

Thanks,
Brian
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Preframe callbacks with CameraNode

2006-11-03 Thread [EMAIL PROTECTED]

Hi Robert,

I realize that enabling or disabling of GL_LIGHTING will have no effect in 
regard to the shaders.  I have implemeneted a way to change a uniform so 
that lighting can be toggled.

My initial attempt at toggling the light uniform was with callbacks.  This, 
as you pointed out, will not work.

I know enough OSG to be dangerous, but that is about it.  How can I use the 
OSG standard state inheritance mechanism to help me toggle the light 
uniform?

Thanks,
Brian

 HI Brian,
 
 If shaders are being used for lighting then all you can do is change
 uniforms or change the shaders themelves, no enabling or disabling of
 the GL_LIGHTING etc will make a difference.  Putting in callbacks
 won't help either - you have to substitute the shaders being used, and
 the OSG's standard state inheritance mechanism or just traversing
 through the scene will help.
 
 Robert.

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Preframe callbacks with CameraNode

2006-11-03 Thread [EMAIL PROTECTED]
Hi Robert,

You had mentioned substituting the shaders via scene traversal or state 
inheritance.  I know how to enable/disable/substitute (perhaps cripple) the 
shader.  My problem is setting the scene up properly (either through scene 
traversal or state inheritance) such that the RTT's CameraNode is crippled 
while the main Producer camera's shader is fully intact.

Basically, I just don't know how to implement the state inheritance or 
scene traversal aspects such that my crippling and enabling functions 
(that I have written) can be called prior to the rendering of their 
respective cameras.

Thanks,
Brian


 Hi Brian,
 
 Gees you really need to talk to the guys who set up the shaders about
 this, I can't comment on stuff I have nothing to do with...
 
 Robert.
 
 On 3 Nov 2006 17:27:14 -, [EMAIL PROTECTED] [EMAIL PROTECTED] 
wrote:
 
  Hi Robert,
 
  I realize that enabling or disabling of GL_LIGHTING will have no effect 
in
  regard to the shaders.  I have implemeneted a way to change a uniform so
  that lighting can be toggled.
 
  My initial attempt at toggling the light uniform was with callbacks.  
This,
  as you pointed out, will not work.
 
  I know enough OSG to be dangerous, but that is about it.  How can I use 
the
  OSG standard state inheritance mechanism to help me toggle the light
  uniform?
 
  Thanks,
  Brian
 
   HI Brian,
  
   If shaders are being used for lighting then all you can do is change
   uniforms or change the shaders themelves, no enabling or disabling of
   the GL_LIGHTING etc will make a difference.  Putting in callbacks
   won't help either - you have to substitute the shaders being used, and
   the OSG's standard state inheritance mechanism or just traversing
   through the scene will help.
  
   Robert.
 
  ___
  osg-users mailing list
  osg-users@openscenegraph.net
  http://openscenegraph.net/mailman/listinfo/osg-users
  http://www.openscenegraph.org/
 
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/
 
 
 
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Preframe callbacks with CameraNode

2006-11-01 Thread [EMAIL PROTECTED]

Hi Robert,

I have tried that thinking that it should work, but for whatever reason, it 
did not.

I used code like:

/
osg::StateSet *stateset = cameraNode-getOrCreateStateSet();

if (stateset)
{
  stateset-setMode(GL_LIGHTING, 
osg::StateAttribute::OVERRIDE|osg::StateAttribute::OFF);
  
  stateset-setMode(GL_LIGHT0, osg::StateAttribute::OFF);

  cameraNode-setStateSet(stateset);
}
//

Is this what you meant?  Perhaps I am calling it in the wrong place.  When 
is the best time to call these functions?

Thanks,
Brian


 Hi Brian,
 
 To disable the light for the subgraph under the CameraNode it should
 be sufficient to attach a StateSet to the CameraNode and disable the
 lighting mode there, overriding the mode for the whole subgraph below.
  There shouldn't be any need to using a callback for this.
 
 Robert.
 

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Preframe callbacks with CameraNode

2006-11-01 Thread [EMAIL PROTECTED]

Hi Robert,

I appreciate your helping me with this problem.  Perhaps a different view 
will help here.

In the Producer::Camera I have
camera-scene-light_drawable-geometry_drawables

In my RTT camera node I have
cameraNode-scene-light_drawable-geometry_drawables

Attached to the cameraNode is a FBO.

If I disable the lighting in the cameraNode, and the light_drawable re-
enables it, could that be my problem?

I'm using a 3rd party tool that is based on OSG (Delta3D) so I have no 
option but to use the light drawable.  My thought was to intercept the 
rendering by using preframe callbacks: one for the Producer camera and one 
for the cameraNode.  In these callbacks, I could modify the state of the 
light_drawable.  My initial thought was to remove the drawable in the 
cameraNode preframe callback and add it back in the Producer::Camera 
preframe callback, but I fear that by doing that, my scene would change to:

camera-scene-geometry_drawables-light_drawable

and I don't know what effect that would have on the rendering of my scene.  
Of course, I can't figure out how to get a preframe callback for the 
cameraNode, so I cannot test this theory.  I tried using a node visitor and 
removing the light drawable in it, but that caused bad things to happen 
(i.e. program crashed.)  I think that removing the drawable in the node 
visitor's update callback caused the node traversal to break.

Thanks again.
Brian


 Hi Brian,
 
 From the osgtext example you'll find :
 
 camera-getOrCreateStateSet()-setMode
(GL_LIGHTING,osg::StateAttribute::OFF);
 
 I have just doubled checked that its functioning by commenting this
 line out and indeed the lighting goes on and problems occur with
 rendering.
 
 Robert.
 

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Preframe callbacks with CameraNode

2006-11-01 Thread [EMAIL PROTECTED]

Hi Robert,

That's ok.  I have verified using the osgviewer application that disabling 
the light (pressing 'L') works with the terrain data that I am using.

That alone makes me feel sane.  This is obviously a problem either with the 
way I am using Delta3D or with Delta3D itself.

Thanks for your help.
Brian


 Hi Brian,
 
 I'm afriad I can't support custom stuff that Delta3D is doing.  If
 Delta3D manages OpenGL state they way the OSG is designed to handle
 state then the trick that I and Don suggested, and what you have
 tried, should work, the fact it doesn't suggest a problem outwith the
 OSG.
 
 Robert.
 

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] KDevelop and OSG

2006-10-29 Thread [EMAIL PROTECTED]



I was wondering if anyone has got a 
workingOSG/KDevelop project up and running. I seem to have trouble - 
mainly I think the extentionless header problem. Isthis solvedby 
simplyadding extentions onto the headers ?

Kind Regards

Paul
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] Compilation problem with ungif/giflib

2006-10-23 Thread [EMAIL PROTECTED]
Andreas Goebel wrote:
 [EMAIL PROTECTED] schrieb:
 Hello,

 I tried to compile OpenSceneGraph, but it failed with error:

 g++  -O2 -L/usr/X11R6/lib64 -L/usr/freeware/lib64
 -L../../../../lib/Linux64
 -L/home/tuuli/bin/OSG_OP_OT-1.2/OpenThreads/lib/Linux64
 -L/home/tuuli/bin/OSG_OP_OT-1.2/Producer/lib/Linux64 -shared
 ReaderWriterGIF.o   -lstdc++ -losgGA -losgDB -losgUtil -losg  -lungif
 -lOpenThreads -o osgdb_gif.so
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../x86_64-pc-linux-gnu/bin/ld:

 cannot find -lungif
 collect2: ld returned 1 exit status
 gmake[4]: *** [osgdb_gif.so] Error 1

 I don't have ungif installed, but giflib 4.1.4. How can I resolve this
 without installing ungif? I'm running Gentoo with gcc 4.1.1 and glibc
 2.4-r3. Thanks.
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/



   
 Hi,
 
 I think you could go to the make folder and edit makedefs, there is
 a section giflib. Be sure to change it for your platform.
 
 I hope it´s right, I don´t have it here at the moment so I can´t look.
 
 Regards,
 
 Andreas
 

That worked, thanks!

 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] Terrain Databases ?

2006-10-18 Thread [EMAIL PROTECTED]



Does anyone know where you can download terrain 
databases for particular regions of Europe (France/Germany) ? 
I'm sorry but I have no experience with paged 
database terrains, I've ben trying to create terrain using Demeter ( because it 
offersgreater control over texturing and texture splatting) but 
Demeterwont compile againstOSG version 1.0. I think osgDem/osgTerrain is probably the way to go - but does it offer 
the kind of multitexturing/texture splatting like Demeter ? or is that texture 
information given to you in the database ? like an Overall_texture for the given 
terrain.

Thanks for your time.


Paul
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] RenderBin Error

2006-09-15 Thread [EMAIL PROTECTED]
Thanks for the responses. Firstly, I have disabled all of my own GPU shader code. This didn't cause any change in the error. The scene consists simply of a single object and a single terrain database. Removing the terrain database does get rid of the problem, but that also doesn't seem to help much seeing as it is a complex scene node.The program has been set up based on the OSG examples for running FBO's, shadowing, and terrain paging. I tried to follow these examples as closely as possible when creating the scene. I guess I am most interested in the OSG changes that could have caused this error to be found between v 1.1 and v1.2. Identical code under v1.1 doesn't show this error (99% of the time, anyway). One peculiar thing did start to show up which might lend a clue. I am rendering the entire scene on the FBO and then using another basic GLUT node to draw a graph about performance of the
 app. The app saves the contents of the FBO out to bitmaps. From time to time, the screen buffer is getting saved to the bitmaps. Nothing consistent, but it does happen. I am tending to think this is related to the error but I am unsure how to narrow this down any further.I appreciate how hard it is to debug such a vague error through email. If nothing else, how can I disable this error?Robert Osfield [EMAIL PROTECTED] wrote: Hi,The OpenGL error could be caused by many different errors in the scene graph setup so I can't really guess at what might be wrong. I'd recommend simplifying your scene and till the error goes away, then you should be better able to pin point the problem. Also check the RTT examples like osgprerender and osgshadowtexture etc, do they produce
 errors too? This shouldn't produce errors, and if they do it suggest so problem with OpenGL driver support.Robert. On 9/14/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:   I upgraded to OSG 1.2 today. I am now consistently getting the following error message whenever I use FBO's:   "Warning: detected OpenGL error 'invalid operation' after RenderBin::draw(,)"  I would get this occasionally (1% of the time) with v1.1 but now I am getting it EVERY time with  v1.2. I assume there is something that I am doing wrong, but as I "see" no problems with the rendered scene, I was wondering
 what types of operations could be causing this or what I could do to attempt to track it down. Particularly, what operations would cause an error on the FBO that wouldn't cause an error for a normally rendered scene? Were there any changes to the RenderBin which would cause  v1.2 to catch an error that v1.1 would not consistently catch? Any help would be appreciated!  Thanks!Do you Yahoo!?  Get on board. You're invited to try the new Yahoo! Mail. ___osg-users mailing listosg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/ ___osg-users mailing listosg-users@openscenegraph.nethttp://openscenegraph.net/mailman/listinfo/osg-usershttp://www.openscenegraph.org/ 
		Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great rates starting at 1¢/min.___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] RenderBin Error

2006-09-13 Thread [EMAIL PROTECTED]
  I upgraded to OSG 1.2 today. I am now consistently getting the following error message whenever I use FBO's:  "Warning: detected OpenGL error 'invalid operation' after RenderBin::draw(,)"  I would get this occasionally (1% of the time) with v1.1 but now I am getting it EVERY time with v1.2. I assume there is something that I am doing wrong, but as I "see" no problems with the rendered scene, I was wondering what types of operations could be causing this or what I could do to attempt to track it down. Particularly, what operations would cause an error on the FBO that wouldn't cause an error for a normally rendered scene? Were there any changes to the RenderBin which would cause v1.2 to catch an error that v1.1 would not consistently catch? Any help would be appreciated!  Thanks! 
		Do you Yahoo!? 
Get on board. You're invited to try the new Yahoo! Mail.___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] Does anyone know how to use osgShadow nodekit ?

2006-09-03 Thread [EMAIL PROTECTED]
hi,all

Where I can get a sample about osgShadow nodekit?   

thanks.


lilinx
[EMAIL PROTECTED]
  2006-09-03
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] New version of Blender exporter

2006-08-25 Thread [EMAIL PROTECTED]

Rubén López wrote:

Hi,

I've just uploaded a new version of the blender exporter with lots of
enhancements by Ben Discoe, Alessandro Pirovano and Vincent Vivanloc.

In fact I've released two consecutive versions: 2.42 and 2.42b, the
second one has also a progressbar :)

Please, check it here:

https://projects.blender.org/projects/osgexport/

... and send me any bug report, feature request or patch that you want.

I want to say thanks to the contributors. This version wouldn't be
possible without them.


we have a problem

http://csp.sourceforge.net/forum/viewtopic.php?p=3435#3435
 guess it has more to do with the fact that transform matrices are not cleaned up before the export. I ran into that kind of issue with the animation module of blender. 



kind regards

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] Can't find removeDrawables in osg.dll dynamic lib error message?

2006-08-08 Thread [EMAIL PROTECTED]

Hi folks,

I had the same problem because I also use Delta3D. At the moment I 
removed all Delta-Files but is there another possibility to use both at 
the same time or do I have to wait until the Delta3D-Team changed to OSG 
1.1?


Kerstin.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] Animation Path

2006-07-30 Thread GMD [EMAIL PROTECTED]
Hello.

Here is one question- 
How to switch to some time label in animation path.


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] Queston about animation path

2006-07-28 Thread GMD [EMAIL PROTECTED]
Hello.

Here is one question- 
How to switch to some time label in animation path.


And another one-
There is a FAQ about exporter. One of the questions is:



Q: How do I extract the animations, cameras, switches etc. from the exported 
file. 

A: The following code should do it: 

std::vector(osg::PositionAttitudeTransform*) _cameras;
std::vector(osg::Switch*) _switches;
std::vector(osg::AnimationPathCallback*) _animations;

/**
 * Find all special nodes in the scenegraph.
 */
void Previewer::findSpecialNodes(osg::Node* node){
 // Find animations
 if(dynamic_cast(osg::AnimationPathCallback*) (node-getUpdateCallback())){
  _animations.push_back(dynamic_cast(osg::AnimationPathCallback*) 
(node-getUpdateCallback())-getAnimationPath());
 }
 // Find cameras
 if(dynamic_cast(osg::PositionAttitudeTransform*) (node)){
  _cameras.push_back(static_cast(osg::PositionAttitudeTransform*) (node));
 }
 // Find switches
 else if(dynamic_cast(osg::Switch*) (node)){
  _switches.push_back(static_cast(osg::Switch*) (node));
 }
 // Traverse any group node
 else if(dynamic_cast(osg::Group*) (node)){
  osg::Group* group = static_cast(osg::Group*) (node);
  for(unsigned int i=0; igetNumChildren(); i++)
   findSpecialNodes(group-getChild(i));
 }
}
-

Why doesn't it work? What is incorrect?



Thanx.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] AnimationPath help

2006-07-26 Thread GMD [EMAIL PROTECTED]
I▓ve got the following question:

How do I extract the animations from the exported (OSG)file. 

The code (FAQ OsgExp for 3DMAX)  not work: 
What exactly should be changed?




std::vector(osg::PositionAttitudeTransform*) _cameras;
std::vector(osg::Switch*) _switches;
std::vector(osg::AnimationPathCallback*) _animations;

/**
 * Find all special nodes in the scenegraph.
 */
void Previewer::findSpecialNodes(osg::Node* node){
 // Find animations
 if(dynamic_cast(osg::AnimationPathCallback*) (node-getUpdateCallback())){
  _animations.push_back(dynamic_cast(osg::AnimationPathCallback*) 
(node-getUpdateCallback())-getAnimationPath());
 }
 // Find cameras
 if(dynamic_cast(osg::PositionAttitudeTransform*) (node)){
  _cameras.push_back(static_cast(osg::PositionAttitudeTransform*) (node));
 }
 // Find switches
 else if(dynamic_cast(osg::Switch*) (node)){
  _switches.push_back(static_cast(osg::Switch*) (node));
 }
 // Traverse any group node
 else if(dynamic_cast(osg::Group*) (node)){
  osg::Group* group = static_cast(osg::Group*) (node);
  for(unsigned int i=0; igetNumChildren(); i++)
   findSpecialNodes(group-getChild(i));
 }
}

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] TXPNode::updateEye()

2006-07-22 Thread [EMAIL PROTECTED]
  I am running OSG v1.1 with two sceneviews. Each of the sceneviews is looking at the same scene, and the scene contains a txp node. When I switched from OSG v1.0 to v1.1, I started getting this error on the second sceneView.  TXPNode::updateEye() no pageManager created  The error seems to be printing out during the cull on that sceneView. The sceneview printing out this error is drawing the entire scene except the txp node, while the first sceneview is drawing the txp node just fine. (To summarize: I am running two SceneView’s simultaneously. They are each looking at a scene containing a txp node and other objects. Only the first sceneview is drawing the txp node. The second is not drawing the txp node and is producing the error.)  I tried to modify the
 osgSimplePager to reproduce the problem, but it seemed to run two sceneViews without a problem. I have come to the conclusion that it is surely a problem in my code, but I can't track it down. I seem to be making all the same calls that osgSimplePager uses and I seem to be making them in the same order.   Can anyone give me some ideas as to what might cause this error? I am running a version 2.x Terrex database and the same code/database worked fine under OSG v1.0 with an updated TXP loader.  Thanks!   
		Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great rates starting at 1¢/min.___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] TXPNode::updateEye()

2006-07-22 Thread [EMAIL PROTECTED]
Thanks for the quick response. Unfortunately, as I am already assigning unique contextID's for each sceneView, that is not the cause of my trouble here. It is something relating to the latest version of the txp loader, I believe. The CVS version of the txp loader I was using prior to the 1.1 release was working fine and not producing this error. However, I could see how setting up the scene graph wrong might cause a problem as well. I just don't understand the txp loader well enough to track down this problem.Any additional thoughts?Robert Osfield [EMAIL PROTECTED] wrote: Hi,The most common problem with multiple SceneView is not incrementingthe contextID for each seperate graphics contexts, see the FAQ.I can't comment much on the internals of the TXP loader though,
 it hasbeen updated for the 1.1 release.Robert.On 7/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: I am running OSG v1.1 with two sceneviews.  Each of the sceneviews is looking at the same scene, and the scene contains a txp node.  When I switched from OSG v1.0 to v1.1, I started getting this error on the second sceneView.  TXPNode::updateEye() no pageManager created  The error seems to be printing out during the cull on that sceneView.  The sceneview printing out this error is drawing the entire scene except the txp node, while the first sceneview is drawing the txp node just fine. (To summarize:  I am running two SceneView's simultaneously.  They are each looking at a scene containing a txp node and other objects.  Only the first sceneview is drawing the txp node.  The second is not drawing the txp node and is producing the
 error.)  I tried to modify the osgSimplePager to reproduce the problem, but it seemed to run two sceneViews without a problem.  I have come to the conclusion that it is surely a problem in my code, but I can't track it down.  I seem to be making all the same calls that osgSimplePager uses and I seem to be making them in the same order.  Can anyone give me some ideas as to what might cause this error?  I am running a version 2.x Terrex database and the same code/database worked fine under OSG v1.0 with an updated TXP loader. Thanks!   Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1�/min. ___ osg-users mailing list osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/___osg-users mailing listosg-users@openscenegraph.nethttp://openscenegraph.net/mailman/listinfo/osg-usershttp://www.openscenegraph.org/ 
		Yahoo! Music Unlimited - Access over 1 million songs.
Try it free. ___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] FBO and Culling

2006-07-10 Thread [EMAIL PROTECTED]
I am having some problems with the FBO working as I would have expected. I have included some code snippets to help. It seems that culling an FBO node results in some kind of corruption of the node. Let me explain what I am doing:I create a Texture2D that is of size (4096, 4096). This is obviously larger than my real frame buffer. (Hence the need for the FBO.)  texture-setTextureSize(4096, 4096); texture-setInternalFormat(GL_RGB); texture-setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR); texture-setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);I next create an osgCameraNode. I set the viewport to the same size as the texture. camera-setClearColor(osg::Vec4(0.1f,0.1f,0.1f,1.0f));
 camera-setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); camera-setReferenceFrame(osg::Transform::ABSOLUTE_RF); camera-setViewport(0, 0, 4096, 4096); camera-setRenderOrder(osg::CameraNode::PRE_RENDER); camera-setRenderTargetImplementation(osg::CameraNode::RenderTargetImplementation::FRAME_BUFFER_OBJECT);Then, I finish setting up my FBO, establishing who is who's child, etc. image-allocateImage(4096, 4096, 1, GL_RGB, GL_UNSIGNED_BYTE); camera-attach(osg::CameraNode::COLOR_BUFFER, this-_pBufferImage); texture-setImage(0, this-_pBufferImage); camera-addChild(sceneManager-getScene().get()); camera-setProjectionMatrixAsPerspective(this-getFieldOfView(),
 1.4, 10.0, 4.0);Now, I have other camera's running while this FBO exists. Having a FBO running of this size really kills performance, so I wanted a way to "turn off" the use of this FBO. I created a culling callback and added it. Then I added the whole thing to my master scene node. fboParent-setCullCallback(this-_fboCullCallback); fboParent-addChild(this-camera); masterSceneNode-addChild(this-fboParent);I implemented the culling callback as:CullCallback::CullCallback() : osg::NodeCallback(){ this-_skipCallback = false;}  void CullCallback::operator()(osg::Node* node, osg::NodeVisitor* nv){  if(this-_skipCallback == false) {  traverse(node,
 nv); }}void CullCallback::setSkipCull(bool x){ this-_skipCallback = x;} Ok, now for the problem: If I leave everything alone, the FBO works fine. If I "setSkipCull(true)", then the FBO doesn''t render, as expected. The problem comes when I "setSkipCull(false)" after setting it to TRUE. The FBO does render, but only the size of the current viewport, not the original 4096x4096. The rest of the buffer is black. I guess I don't understand why skipping the cull on the node would result in this behavior. Is there a better way to turn the FBO rendering on and off? Is this a problem in the osg code or my code? I have tried to re-initialize the values for the FBO, its texture, etc, but it doesn't have any effect. Any input would be greatly
 appreciated! __Do You Yahoo!?Tired of spam?  Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] 1 process, 2 viewers

2006-06-23 Thread [EMAIL PROTECTED]
Hello,

Is it possible to run in the same process (same application)
but on two separate threads, two osgProducer::Viewer
instances (1 scene graph/viewer) ? I did some trials and it
works more or less but:
- it happens that text objects (osgText::Text) have no texture
- for some reason large LODs like bluemarble are not working.

Thanks,

Antoine

- ALICE SECURITE ENFANTS -
Protégez vos enfants des dangers d'Internet en installant Sécurité Enfants, le 
contrôle parental d'Alice.
http://www.aliceadsl.fr/securitepc/default_copa.asp


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] 1 process, 2 viewers

2006-06-23 Thread [EMAIL PROTECTED]
Hello Robert,

Thanks for the answer.  Actually, getting two osg::State is
what I am looking for.
One of the viewer is a true viewer displaying a scene graph
the other is running a parrallel terrain generation. The
latter should not break the first.

I have seen that osgTerrain::DataSet has a
setState(osg::State*) method but was not able to use it
properly. Is there a way to create an independent graphic
context without going for a full osgProducer::Viewer.

I also had a look at the osgcamera example but it currently
does not work on my machine (Error while redimensionning
texture because the OpenGL context is not valid) and it is
written in the source code that it is not stable yet.  It
looks like  another level of abstraction for the OSG runtime
and camera without using Producer. Is that right?


Antoine

-- Initial Header ---

From  : [EMAIL PROTECTED]
To  : osg users osg-users@openscenegraph.net
Cc  : 
Date  : Fri, 23 Jun 2006 14:42:32 +0100
Subject : Re: [osg-users] 1 process, 2 viewers

Hi Antoine,

Is there a reason why you can't use two Camera's in a singe
viewer, or
just use an OsgCameraGroup and manage things yourself.

Also do the viewers share the same graphics context?  If not
then
you'll need to ensure they use the seperate osg::State
objects for
each context otherwise the OSG will only have one buffer of
display
lists/texture objects for two seperate graphis context and will
certainly prodcue artifacts like you describe.

It should be possible to modify things, but having two seperate
viewers running sequnetially is a bit of hack.  However it'd
be better
to have just one viewer with multiple windows and let 
osgProducer
automatically manage the seperate osg::State for you.

Robert.

On 6/23/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Hello,

 Is it possible to run in the same process (same application)
 but on two separate threads, two osgProducer::Viewer
 instances (1 scene graph/viewer) ? I did some trials and it
 works more or less but:
 - it happens that text objects (osgText::Text) have no texture
 - for some reason large LODs like bluemarble are not working.

 Thanks,

 Antoine

 - ALICE SECURITE ENFANTS
-
 Protégez vos enfants des dangers d'Internet en installant
Sécurité Enfants, le contrôle parental d'Alice.
 http://www.aliceadsl.fr/securitepc/default_copa.asp


 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


- ALICE SECURITE ENFANTS -
Protégez vos enfants des dangers d'Internet en installant Sécurité Enfants, le 
contrôle parental d'Alice.
http://www.aliceadsl.fr/securitepc/default_copa.asp


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Terrapage 2.2 support in OSG

2006-06-06 Thread [EMAIL PROTECTED]
Is there a way to tell that this pager is done? That is: There is no more work for the pager to do until the camera moves again? I am interested in querying the "complete" state of the pager. Any ideas?Andrew Sampson [EMAIL PROTECTED] wrote:  Terrex made a lot of changes (especially differences in whitespace), so the diff between the forked version and OSG 1.0's txp plugin is yucky.  I did  my best, but  keep in mind that this is the result of a 4-way merge (kinda... terrex-0.9.8, stock-0.9.8,  stock-0.9.9, stock-1.0). I guess I should clarify: performing a diff betweenOSG 1.0's txp plugin and the forked version is yucky(lots of whitespace changes, large chunks of new code,etc).  The code itself is quite
 solid.  It's beentested with just about every database I haveavailable, and has been stable so far.  It actuallyseems a little quicker than the stock 1.0 code, but Icould be imagining that.-Andrew__Do You Yahoo!?Tired of spam?  Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___osg-users mailing listosg-users@openscenegraph.nethttp://openscenegraph.net/mailman/listinfo/osg-usershttp://www.openscenegraph.org/ __Do You Yahoo!?Tired of spam?  Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] Producer Texture Access

2006-05-09 Thread [EMAIL PROTECTED]
  Will the glReadPixels work from the pBufferCamera? I guess it wasn't clear to me that I could read from the pbuffer with that call. How would glReadPixels know to read data from the Producer PBuffer Camera vs. the rendered Frame Buffer?  From the documentation for glReadPixels:  "glReadPixels returns pixel data from the frame buffer, starting with the pixel whose lower left corner is at location (x, y), into client memory starting at location pixels."  The reason I had used the producer camera is because I needed to render an image larger than the actual frame buffer. I had originally tried this with the regular osg::CameraNode. While I was able to successfully access the pixel data out of the pBuffer, i was not able to get OSG to fill an area larger than the frame buffer. I went through each of the available render target implementations (FRAME_BUFFER,
 FRAME_BUFFER_OBJECT, PIXEL_BUFFER, etc.) with no luck. Is there a trick there?   Looking through the mailing list archives, it seemed as though the Producer camera was the only one that could render to a texture larger than the frame buffer. I would have preferred to use the osg::CameraNode because that was working fine until I needed the larger image size.  Robert Osfield [EMAIL PROTECTED] wrote: On 5/9/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: I have build a small application modeled after the one in Producer/Test/PBuffer.  The major difference here is that where that example assigns the PBuffer's texure to another camera as in:
 camera-getRenderSurface()-setReadDrawable(pBufferCamera-getRenderSurface()); I want direct access to the texture in pBufferCamera's render surface. Ideally, I would want a pointer to some standard GL_RGB formatted OpenGL image.  I have tried a couple things but I haven't found exactly how to get the texture data from the pBufferCamera.  Any Ideas?You'll need to do a glReadPixels.   Note that osg::Image has thisalready available as a method.Also consider just using the osg::CameraNode for the job, it can helpyou seemlessly work with FBO's, pixel buffers and standard framebuffer.  See the osgprerender which includes a segment which has aread to an osg::Image.Robert.___osg-users mailing
 listosg-users@openscenegraph.nethttp://openscenegraph.net/mailman/listinfo/osg-usershttp://www.openscenegraph.org/
		New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] text

2006-05-02 Thread [EMAIL PROTECTED]
Ok, I found that example, thanksOn 5/2/06, Philip Hahn [EMAIL PROTECTED] wrote:
Bahar-It sounds like want is a heads-up display. Here is a tutorial explaining how to accomplish it:
http://www.nps.navy.mil/cs/sullivan/osgtutorials/osgText.htm
Also the osgtext example included with OSG shows how to accomplish this (look at the function createHUDText() )Hope this helps,Philip Hahn
On 5/2/06, 
[EMAIL PROTECTED] 
[EMAIL PROTECTED] wrote:

Hi all,I want some string to be located in my scene as text. I use osgText for this. But the text is seen as a 3d object in the scene, I mean as the camera moves the string stays in its place like any object in the scene. I want the text to be located in its place statically even if the camera moves.
Is there any way to do this or should I make the text follow the camera and take its rotation and positions too?The code is as this://osgText::Font* font = osgText::readFontFile(fonts/arial.ttf);
 osg::Geode* geode = new osg::Geode; osg::Vec4 layoutColor(1.0f,1.0f,0.0f,1.0f);  float windowHeight = 400.0f;  float windowWidth = 300.0f;  float margin = 50.0f;


  float layoutCharacterSize = 20.0f;  osgText::Text* text = new osgText::Text; text-setFont(font); text-setColor(layoutColor); text-setCharacterSize(layoutCharacterSize);
 text-setPosition(osg::Vec3(0.0f,0.0f,10.0f)); // the default layout is left to right, typically used in languages // originating from europe such as English, French, German, Spanish etc..
 text-setLayout(osgText::Text::LEFT_TO_RIGHT); text-setText(I am the passenger); geode-addDrawable(text);  root-addChild(geode);


//Thanks...--bahar-- CodeSchbeke Software SolutionsSenior Project TeamComputer Engineering Department
Middle East Technical University
Ankara/TURKEYhttp://senior.ceng.metu.edu.tr/2006/codeschbeke

___osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users

http://www.openscenegraph.org/

___osg-users mailing listosg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/-- CodeSchbeke Software SolutionsSenior Project TeamComputer Engineering DepartmentMiddle East Technical UniversityAnkara/TURKEY
http://senior.ceng.metu.edu.tr/2006/codeschbeke
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/