I have also ran into this kind of problem moving from 1.0 to 1.2
(osgProducer).
The set-up is similar, a uniform with default value at the root group:
root->getOrSetStateSet()-> addUniform(new Uniform("uTextured",true))
then nodes can have this overridden:
node->getOrSetStateSet()-> addUniform(new Uniform("uTextured",false))
The problem is that in some cases the node will not use the custom value
of the uniform when it's being drawn. The frustrating part is that this
appears sometimes based on the viewing direction of the camera in the
scene (when using a bunch of nodes with the custom Uniform added to them).
I am also getting some strange behavior when updating values for
Uniform(s), sometimes the new value is not used right away, there is a
delay till some other scene property is modified; in this particular
case it's a bool Uniform that flags if fog is being used, the new value
is ignored until the fog density is updated ( this is the regular GL
property).
This makes me think that there should be some kind of 'dirty' that is
not being applied/called when updating/adding an uniform.
I realize the standard answer is to move to the new viewer code, but
that is not an option for some of our projects since they are close to
delivery and we can't use an unstable code-base for that. Maybe there is
some fix that has been applied to the svn version that can be
back-ported to 1.2.
As far as providing some code for illustration, I couldn't reproduce it
with a simple example, and the application is too tightly integrated
with the physics engine to provide some code samples that make sense.
I hope we'll get to figure this one out soon
Mihai
Mike Weiblen wrote:
Hi,
um ok, so can anyone give me a concise repro to diagnose?
I'm willing to help, but only have a vague description along the lines
of "things seem to work fine except for the shader-related Uniforms."
I've used hierarchies of uniforms and it has worked for me; perhaps
you've found a corner case?
Cheers
-- mew
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/