[osg-users] Redirecting osg::notify

2009-08-18 Thread Chris Glasnapp
Hello,

This is probably a C++ question, but maybe there is a way OSG makes it easier.

I have an on screen event log that I'd like to use to display the
various OSG notifications (i.e. osg::notify(osg::WARN) << "Danger Will
Robinson!").
Is there anyway to intercept these calls so I can write the string to
my on screen log instead of the string going to stdout?

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


Re: [osg-users] Composite Viewer, Multiple Windows, Different Framerates

2009-08-17 Thread Chris Glasnapp
At this point I'm somewhat pressed for time, so I'm going to toggle
the nodemask on and off and deal with the buffer swapping.
Maybe when I get more time I'll revisit the disabling of windows at
the viewer level.

Thanks for the info!

-Chris

On Fri, Aug 14, 2009 at 7:44 AM, Robert Osfield
 wrote:
>
> Hi Chris,
>
> The current design of osgViewer is for a single viewer to have a
> single frame loop, and in your case you fall out this.  One possible
> solution would be to have two separate viewers, each running their own
> frame when required - you can't mix scene graphs or graphics contexts
> in this case though.  The other route is node masks as you have done,
> but this won't disable the swap buffers of the associate contexts - do
> to the later one would need to modify the
> CompsiteViewer::renderingTraversals() method to enable the disable of
> a window.
>
> Potentially we could evolve osgViewer to support the disabling of
> windows so that all the cameras on it wouldn't rendering and no swap
> buffers would be issued.  Disabling cameras from updating where the
> window/context is a bit more awkward though as you'd need to rendering
> to the back buffer and front buffer of the camera to be disabled
> before you can fully disable it, otherwise you'd end up with black
> hole where the camera was.
>
> Robert.
>
> On Wed, Aug 12, 2009 at 8:15 PM, Chris Glasnapp 
> wrote:
> > Hello,
> >
> > I have a wxWidgets application where I'd like to setup two windows.
> > The first window is interactive, so I want the framerates to be quite high.
> > The second window displays a different view of the same scene, but it is not
> > interactive, and I don't care much about the refresh rate.
> >
> > Because I'm using wxWidgets, I call frame() myself instead of calling run().
> >
> > If I use a composite viewer (as I believe OSG intended for me to do), then I
> > can only call frame() once, which redraws both views. What is the best way
> > to achieve different framerates for the two different views? Should I set
> > the nodemask of the low framerate camera to 0 for most of the time, and then
> > set its nodemask to ~0, when I want it to render to its window?
> >
> > I'm hoping there is a better way, because I use the nodemask of the cameras
> > for other purposes.
> >
> > Thanks!
> > -Chris
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Composite Viewer, Multiple Windows, Different Framerates

2009-08-12 Thread Chris Glasnapp
Hello,

I have a wxWidgets application where I'd like to setup two windows.
The first window is interactive, so I want the framerates to be quite high.
The second window displays a different view of the same scene, but it is not
interactive, and I don't care much about the refresh rate.

Because I'm using wxWidgets, I call frame() myself instead of calling run().

If I use a composite viewer (as I believe OSG intended for me to do), then I
can only call frame() once, which redraws both views. What is the best way
to achieve different framerates for the two different views? Should I set
the nodemask of the low framerate camera to 0 for most of the time, and then
set its nodemask to ~0, when I want it to render to its window?

I'm hoping there is a better way, because I use the nodemask of the cameras
for other purposes.

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


Re: [osg-users] Default camera render order?

2009-02-27 Thread Chris Glasnapp
I guess the only reason I ask is that it seems like CullVisitor is doing
extra work with rtts if the camera render order != NESTED_RENDER, although
I'm not quite sure exactly how that code works, so it may be very
lightweight. The earliest revision in svn of Camera.cpp has the default
render order as POST_RENDER. Just trying to understand!  : )

Thanks,
-Chris


On Fri, Feb 27, 2009 at 3:01 PM, Robert Osfield wrote:

> HI Chris,
>
> On Fri, Feb 27, 2009 at 6:15 PM, Chris Glasnapp
>  wrote:
> > Why is the default render order of a Camera POST_RENDER, rather than
> > NESTED_RENDER?
>
> I'm afraid I don't recall the exact reason. The svn logs for
> Camera.cpp might reveal something.
>
> Is there are reason why you think the default should be NESTED_RENDER?
>  Different defaults suit different contexts, no one default can suit
> all Camera usages, it's normal practice to set the RenderOrder to what
> you require, rather than leave it as defaults as there are so many
> different ways to use a Camera no single default will even capture the
> majority of usage.
>
> Robert.
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Default camera render order?

2009-02-27 Thread Chris Glasnapp
Why is the default render order of a Camera POST_RENDER, rather than
NESTED_RENDER?

Thanks!

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


[osg-users] Problem with simultaneous use of DepthPartitonNode, AutoTransform, and Multiple Views

2008-10-23 Thread Chris Glasnapp
Hello,



I have a single scene that is being rendered multiple times on the same
screen. The entire scene is contained within a DepthPartitionNode. I am
rendering a velocity vector arrow originating from my object using an
AutoTransform node so the arrows maintain their size regardless of their
distance to the camera. I have two cameras. One camera is very close to the
object, the other camera is very far from the object. The problem I am
experiencing is that the clipping that occurs on the arrow in camera two is
dependant on the distance to the object in camera one. I believe the
following sequence of events is occurring:



1. Camera one starts to render the scene.

2. The cull visitor hits the DepthParitionNode.

3. A distance accumulator is created and sent through the scene.

4. The distances for the depth partitions are calculated for the scene using
the current bounds of the arrow.

5. The cull visitor is passed to each depth partition.

6. The cull visitor hits the AutoTransform node.

7. The AutoTransform node calculates its new scale by using the information
from the cull visitor. This dirties the bound of the node.

8. Rendering for camera one finishes.



9. Camera two starts to render the scene.

10. The cull visitor hits the DepthParitionNode.

11. A distance accumulator is created and sent through the scene. When the
accumulator hits the AutoTransform, it calculates the bounds of the node
since it was dirtied in step 7. Unfortunately, the size of the node has been
scaled according to the information of the cull visitor used to render the
view in camera one.

12. The distances for the depth partition are calculated for the scene using
the incorrect bounds of the arrow.

13. The cull visitor is passed to each depth partition.

14. The cull visitor hits the AutoTransform node.

15. The AutoTransform node calculates its new scale by using the information
from the cull visitor. This scale was needed prior to step 11 to calculate
the proper distances!

16. Rendering for camera two finishes.



Because the distances calculated by the distance accumulator in step 11 were
incorrect, the wrong clipping planes are used when rendering the view for
camera two. This causes some of the arrows to not be rendered entirely.



Any suggestions on how to fix this?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Outlines using Stencil Buffer

2008-08-12 Thread Chris Glasnapp
Hello,

This is my first post, so please forgive any breech of etiquette.

I'm trying to use stencil buffers to achieve outlines around my
objects, as described in the following article:
http://www.codeproject.com/KB/openGL/Outline_Mode.aspx

I want to be able to display the outlines of objects regardless of
whether they are behind another object or not. For example, say I have
two objects: A and B. If Object A is partially occluded by Object B, I
want to display the entire outline of Object A, even the occluded
part.

The problem I'm running into is that when Object B is rendered first,
the silhouette for Object B is in the stencil buffer, which prevents
the outline surrounding the occluded parts of Object A from being
drawn.

Similarly, if Object A is rendered first, a part of the outline for
Object B will not be drawn because the silhouette of Object A is in
the stencil buffer.

This is a long way of saying: How do I clear the stencil buffer in the
middle of rendering?

I took a look at osg::ClearNode, but when I set its clear mask to
GL_STENCIL_BUFFER_BIT, it had an effect as if I had cleared the
GL_COLOR_BUFFER_BIT instead.

I am aware of the polygon offset method of outlining objects, but have
found the stencil buffer method to be much more accurate in my
application.

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