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 in shaders as well a range of other variables.

Robert.

On Tue, Dec 2, 2008 at 1:47 PM, Engvall Åsa <[EMAIL PROTECTED]> wrote:
> 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 callback is only
> called for the parent node in the subgraph.
> I think it would work if I declare a uniform for each node, and attach an
> updating callback to each uniform, but there must be a more clever way do to
> it?
>
> Any help would be appreciated!
> Regards,
>
> Åsa Engvall
>
> _______________________________________________
> 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

Reply via email to