Thanks Jason,
I understand about the interpolation. I have been operating under the
assumption that if I use a node visitor to loop over each primitive in my
object, create a floatArray of index numbers of size=size(primitive array), and
then bind_per_primitive, then I shouldn't have to worry about interpolation of
those index numbers within the shader. Is that correct?
I noticed that in Christian's code snippet that the osg::Program that he
created was not attached to the geometry's stateset. Without attaching it, you
will still have a floatArray stored in the 6 position, but it will not have a
name and therefore I don't think you can access it from the shader.
In either case, when i try to add my floatArray to the 6th vertex attribute, my
shaders stop working. I don't get any glsl errors printed to screen, but even
if I try to do something simple like assign all color values to black, the
shader just spits out the underlying object colors and ignores my shader
commands. If I don't attach the osg::Program to my object's stateset, the
shader commands do work again but I can't access my 6th vertex attribute
because it wasn't named.
Here is the stateset that was added to my object.obj's geometry:
StateSet {
rendering_hint DEFAULT_BIN
renderBinMode INHERIT
Program {
name "targetIndices"
GeometryVerticesOut 1
GeometryInputType TRIANGLES
GeometryOutputType TRIANGLE_STRIP
AttribBindingLocation indices 6
num_shaders 0
}
}
I'm assuming most of these things are default values since I never specified
GeometryVerticesOut, GeometryInputType, GeometryOutputType, or num_shaders when
I created my osg::Program. Are these defaults the cause of my problems?
I know that this post is a bit scatter-brained but I tried my best to represent
my problem.
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=46183#46183
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org