Hi Stephane,

I was pretty sure that this would helps. This is a problem which I have already 
encountered long time ago during the development of osgPPU. 
The problem is that there exists an apply() method for StateAttributes (e.g. 
Program) but there is no disapply() method, as I have already asking before in 
the previous posts.

The disapply method works by applying some default values on a freshly created 
StateAttribute. For example a fresh osg::Program do call glUseProgram(0) if it 
gets applied. This means in this case it works like disapply() method.

Maybe you have to look into the pushStateAttribute and popStateAttribute 
methods of the State class. It could be that for such a simpel case like 
osg::Program there might exists a solution of using just a fresh instance to 
disapply attribute. However for more complex cases one do require something 
like glPushAttribute or similar technique, which osg currently don't provide.



Best regards,
Art



--- Stephane Lamoliatte <[EMAIL PROTECTED]> schrieb am Fr, 23.5.2008:

> Von: Stephane Lamoliatte <[EMAIL PROTECTED]>
> Betreff: Re: [osg-users] empty geode + shader + uniform = bug ?
> An: [EMAIL PROTECTED], "OpenSceneGraph Users" 
> <[email protected]>
> Datum: Freitag, 23. Mai 2008, 14:26
> Hi Art,
> 
> Sorry. Yes, I simply add an empty shader on the proxy node
> containing 
> the cow and it works.
> Like Robert says it is a clue to figure out where the
> problem come from.
> I will investigate more deeper in this way and post a
> submission if I 
> find the origin of the problem.
> 
> Art Tevs a écrit :
> > Have you tried, what I have proposed before?
> >
> > cheers,
> > Art
> >
> >
> > --- Stephane Lamoliatte
> <[EMAIL PROTECTED]> schrieb am Fr,
> 23.5.2008:
> >
> >   
> >> Von: Stephane Lamoliatte
> <[EMAIL PROTECTED]>
> >> Betreff: Re: [osg-users] empty geode + shader +
> uniform = bug ?
> >> An: "OpenSceneGraph Users"
> <[email protected]>
> >> Datum: Freitag, 23. Mai 2008, 12:02
> >> Hi David,
> >>
> >> I turn off the optimizer in osgviewer and the
> problem stays
> >> the same.
> >>
> >> Thanks for your help.
> >>
> >> David Spilling a écrit :
> >>     
> >>> Stephane,
> >>>
> >>> Have you tried running with no optimizer? A
> while ago
> >>>       
> >> I dimly remember 
> >>     
> >>> encountering something similar with the
> optimiser
> >>>       
> >> doing funny things 
> >>     
> >>> with empty nodes that had state changes...
> >>>
> >>> Dave
> >>>
> >>>
> >>>       
> >>
> ------------------------------------------------------------------------
> >>     
> >>>
> _______________________________________________
> >>> 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
> >>     
> >
> >
> >      
> __________________________________________________________
> > 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
> >
> >
> >
> >
> >   
> 
> 
> -- 
> 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 61Group {
>   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"
>     StateSet {
>       Program {
>       }
>     }
>     
>     FileNameList {
>         cow.osg
>     }
>   }
> }


      __________________________________________________________
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