I've found a few clues this evening. Not sure why things are behaving
the way they are - I'm probably abusing the OSG in my overridden
traverse(...) function. My node has a shader attached. If I do NOT
attach that shader to the stateset, no problems. Read on....

On Feb 12, 2008 3:40 PM, Paul Martz <[EMAIL PROTECTED]> wrote:
> > I have a class that inherits from osg::Group. In this class
> > I'm overriding the traverse function. It is written in such a
> > way that the CULL_VISITOR doesn't have an opportunity to call
> > osg::Group::traverse(nv). When I add this object to the
> > scenegraph all the nodes in my scene go black. Even if this
> > class is a child - all the nodes (including parent nodes)
> > appear black.
>
> The presence of this custom Node is changing the color of your geometry so
> that they render black? E.g., against a non-black background, you see them
> render? Or, by "appear black", do you mean they just don't show up?
>
> What color is your Geometry supposed to render?

The only other node is a bluemarble ellipsoid produced by osgdem. It's
entirely black when I intrdouce my node into the scenegraph. If the
node (my custom node) is a sibling, the bluemarble node goes black.

>
> Does your custom Node support the .osg file format? If so, have you dumped
> your scene to a .osg file to see if anything is amiss?
>

No - doesn't support OSG.

> Have you tried to reproduce the problem with a very simple scene, like just
> a single triangle plus your custom Node? Then you could step through in the
> debugger and determine what's going on.
>
> Have you tried capturing the OpenGL output with GLIntercept?
>
> In the past, whenever I've seen state bleed from one Node to a sibling Node,
> it is usually because the sibling Node's Geometry lacks a color array.
>

I suspect either one of (at least) two things:

1) I'm abusing OSG some manner and the code is responding in kind. In
other words, I'm doing something I shouldn't be and I'm getting
undefined behavior.

OR

2) There is some sort of state leakage (of my shader) issue between
sibling nodes. If this is leakage - is it a bug or not?

> > What I did to patch things is to hack my class such that the
> > CULL_VISITOR is allowed to call osg::Group::traverse(nv); at
> > least once at the start. This seems to address the problem,
> > albeit in a kludgy sort of way. I'd like to know if:
> >
> > - this is a new OSG bug?
>
> Are you saying you tried this same thing in v2.2 and the problem didn't
> occur?

I thought this was new - but went back and tried older versions of OSG
and the problem persists. I have a fix (allow one cull traversal on my
custom node)...but it seeems kludgy. I'm either doing something
terribly wrong OR I've found some bug. It's probably the former.

It does strike me as add that performing a single cull traversal
addresses the issue. Seems as though some state isn't be set properly
unless this cull traversal is allowed to pass through.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to