This is what I was getting at...
So if I have a struct in my app
struct MyStruct
{
float fMember;
int iMember;
} _myStruct;
And in my shader
struct MyStruct
{
float fMember;
int iMember;
} myStruct;
Then in my osg code I would do this...
stateset->getOrCreateUniform("myStruct.fMember",osg::Uniform::FLOAT)->set(myStruct.fMember);
stateset->getOrCreateUniform("myStruct.iMember",osg::Uniform::INT)->set(_myStruct.iMember);
And then to access the updated data, just use the struct as usual?
something = somethinelse * myStruct.fMember;
Wyatt
On Fri, Sep 4, 2009 at 9:47 AM, Ralph Kern <[email protected]> wrote:
> Wyatt Earp schrieb:
> How would I
> > create/set the uniform struct?
> >
>
> You don't create/set the whole struct at once, but the individual
> members of the struct. OpenGL recognizes struct members by the typical
> dot notation "<name of struct>.<name of member>".
>
> regards Ralph
>
> _______________________________________________
> 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