[osg-users] Problem updating uniforms

2008-12-02 Thread Engvall Åsa
Hi osg-users! I have a shader attached to a subgraph. The shader uses a uniform which needs to be updated in every frame. The uniform is related to the modelviewmatrix, and should thus get a different value for every node in the subgraph. I have tried to use a osg::Uniform::Callback, but the

Re: [osg-users] Problem updating uniforms

2008-12-02 Thread Robert Osfield
Hi Asa, I was strongly recommend trying to use compute what you need from variables already available to your in the shader, do a per drawable binding of an uniform would awkward to implement and provide poor performance. Please note that you have gl_ModeViewMatrix and osg_ViewMatrix available

Re: [osg-users] Problem updating uniforms

2008-12-02 Thread Robert Osfield
Robert Osfield Skickat: den 2 december 2008 14:51 Till: OpenSceneGraph Users Ämne: Re: [osg-users] Problem updating uniforms Hi Asa, I was strongly recommend trying to use compute what you need from variables already available to your in the shader, do a per drawable binding of an uniform

Re: [osg-users] Problem updating uniforms

2008-12-02 Thread Engvall Åsa
Thank you, I will do that! Asa -Ursprungligt meddelande- Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] För Robert Osfield Skickat: den 2 december 2008 15:15 Till: OpenSceneGraph Users Ämne: Re: [osg-users] Problem updating uniforms Hi Asa, Have a look at the osgParticle