Hi Stephane,

Stephane, try to put an empty shader program on the cow, just like this:

cow->getOrCreateStateSet()->setAttribute(new osg::Program(), 
osg::StateAttribute::ON);

I think this could help you.
And if not then just add an empty UniformList to the stateset of the cow.

Best regards,
Art


--- Robert Osfield <[EMAIL PROTECTED]> schrieb am Do, 22.5.2008:

> Von: Robert Osfield <[EMAIL PROTECTED]>
> Betreff: Re: [osg-users] empty geode + shader + uniform = bug ?
> An: "OpenSceneGraph Users" <[email protected]>
> Datum: Donnerstag, 22. Mai 2008, 18:02
> Hi Stephane,
> 
> Pressing 's' for stats reveals the problem too. 
> Looks like state is
> leaking from the empty geode.  This is certainly a bug, as
> to it's
> possible cause I can't answer.  I'm afraid I can
> only juggle so many
> support items at one time so can't go chasing this bug
> right now.
> 
> Robert.
> 
> On Thu, May 22, 2008 at 4:57 PM, Stephane Lamoliatte
> <[EMAIL PROTECTED]> wrote:
> > Hi Robert,
> >
> > There is another strange thing about this.
> > If you run
> >   osgviewer scene.osg
> > and you press the 's' key, you could see that
> the statistics are red. So,
> > the shader is applied on the statistics too.
> >
> >
> > Robert Osfield a écrit :
> >>
> >> Hi Stephane,
> >>
> >> When I run
> >>
> >>   osgviewer scene.osg
> >>
> >> I get a red cow, which looks correct.  I'm
> using the SVN version of
> >> the OSG under 64bit Kubuntu 7.10 on a Quad core
> Intel chip with NVidia
> >> drivers/7800GT.
> >>
> >> Robert.
> >>
> >> On Thu, May 22, 2008 at 7:29 AM, Stephane
> Lamoliatte
> >> <[EMAIL PROTECTED]> wrote:
> >>
> >>>
> >>> Hi Robert,
> >>>
> >>> OpenSceneGraph have a strange behavior when I
> set a shader and an uniform
> >>> variable on the state set of a geode which
> have no drawable.
> >>>
> >>> I write a very simple osg scene file to show
> you my problem (see the
> >>> attachment).
> >>> I have a group which have 2 children :
> >>> * a geode without any drawable;
> >>> * a proxy node which point to the
> "cow.osg" file.
> >>>
> >>> When I set a simple shader with an uniform
> variable on the state set of
> >>> the
> >>> geode, the shader is applied to the cow.
> (strange behavior)
> >>> When I remove the uniform variable  (and hard
> code the value of the
> >>> uniform
> >>> variable to the shader), the shader is not
> applied to the cow. (standard
> >>> behavior)
> >>>
> >>> So, do you have any idea to correct this bug ?
> >>>
> >>> Cheers,
> >>>
> >>> --
> >>> Lamoliatte Stephane
> >>> R&D Engineer
> >>> R.S.A. Cosmos
> >>> Z.I. de la Vaure - B.P.40
> >>> 42290 Sorbiers, France
> >>> Tél : +33 (0)4 77 53 30 48
> >>> Fax : +33 (0)4 77 53 38 61
> >>>
> >>>
> >>> Group {
> >>>  name "aGroup"
> >>>  Geode {
> >>>   name "anEmptyGeode"
> >>>   StateSet {
> >>>     Uniform {
> >>>       name "color"
> >>>       type vec3 1 FloatArray 3
> >>>       {
> >>>         1 0 0
> >>>       }
> >>>     }
> >>>     Program {
> >>>       num_shaders 1
> >>>       Shader {
> >>>         type FRAGMENT
> >>>         code {
> >>>           "uniform vec3 color;"
> >>>           "void main() {"
> >>>           "    gl_FragColor =
> vec4(color.rgb, 1.0);"
> >>>           "}"
> >>>         }
> >>>       }
> >>>     }
> >>>   }
> >>>   num_drawables 0
> >>>  }
> >>>
> >>>  ProxyNode {
> >>>   name "whatEverYouWant"
> >>>   FileNameList {
> >>>       cow.osg
> >>>   }
> >>>  }
> >>> }
> >>>
> >>>
> _______________________________________________
> >>> osg-users mailing list
> >>> [email protected]
> >>>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >>>
> >>>
> >>>
> >>
> >> _______________________________________________
> >> osg-users mailing list
> >> [email protected]
> >>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >>
> >>
> >>
> >>
> >>
> >
> >
> > --
> > Lamoliatte Stephane
> > Ingenieur R&D
> >
> > R.S.A. Cosmos
> > Z.I. de la Vaure - B.P.40
> > 42290 Sorbiers, France
> > Tél : +33 (0)4 77 53 30 48
> > Fax : +33 (0)4 77 53 38 61
> >
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


      __________________________________________________________
Gesendet von Yahoo! Mail.
Dem pfiffigeren Posteingang.
http://de.overview.mail.yahoo.com
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to