Hi Robert,
Bit of a crazy week @ work, so it took a while to revisit this issue.

I must have taken a wrong turn somewhere earlier, because when I modified osgdepthshadow.cpp, the behavior is in line with what you were expecting: the more specific Uniform overrides the inherited value from the parents.

When the program is attached to the scene, there's a new Uniform:
            osg::Uniform* texHint = new osg::Uniform("withTex",(int)1);
            stateset->addUniform(texHint);

And in _create_scene(), I set the complimentary value:

geode_1->addDrawable(shape.get());

  // render this one without texture
  StateSet *set = geode_1->getOrCreateStateSet();

  osg::Uniform* texHint_3 = new osg::Uniform("withTex",(int)0);
  set->addUniform(texHint_3);

The end result is that geode_1 is rendered without texturing, just as I wanted :)

What I'd like to have clear in my head now is how is the above different from SS->setMode(OVERRIDE) or (PROTECTED).

Here's the code:

Attachment: osgdepthshadow.cpp
Description: Binary data

--------------------------
Radu Mihai



On 8-Dec-06, at 4:06 AM, Robert Osfield wrote:

Hi Radu,

On 12/7/06, Radu Mihai <[EMAIL PROTECTED]> wrote:
Sorry about the pdf's here's a png version (the clouds are in place
of other parts of the scenegraph):

1: The case you mention, where Uniform values are inherited (even
though a more local Uniform is present for Object2):

2: The way I got it to work (I think this is heavy-handed, but it
does get the job done):

Case 1 should work, the lower Uniform should be override the inherited
down from above.  It is obviously the more desirable way to work.

As to why its not working I'd have to recreate the problem and get in
a step through and analysis what is happening under the hood.  I'm
afraid I'm too busy to be able to invest this time right now.  If you
can provide a simple example (such as a modified OSG example) that
illustrates the problem then it'll be a big help.

Cheers,
Robert.
_______________________________________________
osg-users mailing list



--------------------------
Radu Mihai



_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to