Thanks for the help,

What I'm going to need is per geometry (e.g., osgGeometry::BIND_OVERALL),
the shader attribute values will be the same for each Geode (e.g., model
part).  I just can't find any examples of the best way to do the binding and
update the values each frame.  I can probably figure something out, but I'm
looking for "the trail already blazed."

Thanks,
Bob

-----Original Message-----
From: Thrall, Bryan [mailto:bryan.thr...@flightsafety.com] 
Sent: Wednesday, July 08, 2009 4:05 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] how to set per vertext attributes using osg

Bob Youmans wrote on Wednesday, July 08, 2009 3:51 PM:
> Hi all, I'm trying to figure out the best method to pass per vertex
> "attributes" to shaders using osg and I can't seem to find many
examples of
> attribute use.  My guess is there's a reason for that and I should
probably
> code up a uniform array of some kind instead.  I need to pass
"thickness" as
> an "attribute" and that varies with the geometry / osg::Geode.  I've
studied
> the osg::Drawable and its attribute types, and the osg::Program and
its
> addBindAttribLocation, but I can't find any examples of the callback
or other
> mechanism to actually get the data set into the attributes from the
> scenegraph.  I must be missing something, and I'm really new at this
shader
> stuff.  Can anybody point me in the right direction?  Should I not try
to use
> shader attributes, but instead use a uniform array and look up my data
in
> there?  If I do use shader attributes, where's an example?           

Using a normal array is unlikely to allow a big enough array for all
your vertices :)

See osg::Geometry::setVertexAttribArray(), setVertexAttribBinding(),
etc.

It doesn't look like there are any examples for using vertex attributes,
though.
-- 
Bryan Thrall
FlightSafety International
bryan.thr...@flightsafety.com



_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to