Hi JS,

The OSG is designed around separating geometry data (in Drawables)
from state data (in StateSets), the usage model you are suggesting
mixing this, and this would struggle in anything other than models
that don't have any colour arrays assigned to them, otherwise the
local geometry colour array would just override that you provide by
the StateSet.  Consider that the OSG by default display lists geometry
and you can see that the problem isn't one that you can fix easily.

However if you carefully manage your scene graph so that the subgraph
you are decorating contains no colour arrays then you could define a
custom StateAttribute that sets the vertex colour.

Robert.

On Wed, Feb 4, 2009 at 7:13 PM, Jean-Sébastien Guay
<jean-sebastien.g...@cm-labs.com> wrote:
> Hi all,
>
> I have a question about OpenGL materials. From what I can see, if I disable
> GL_LIGHTING in the stateset of an object, then that object is rendered with
> the colors specified in its color array only, i.e. the material has no
> effect. Is there a way to change that?
>
> The effect I want is that the object be unaffected by lighting but still has
> colors according to its material, i.e. even if no light is present in the
> scene, or if there is only a spotlight but it is not pointing toward the
> object, its color is defined by its material.
>
> The reason I can't just specify the colors in the color array is that then,
> if I use scribe or outline effects (using osgFX::Effect), the wireframe
> overlay or outline takes on the vertex colors too instead of being white (or
> the color I specify). If there's a way to force the scribe to be white (i.e.
> not use the object's vertex colors) that would work too even though it's the
> reverse of what I'm asking...
>
> Any suggestions would be appreciated. I've never quite understood the
> intricacies of how OpenGL handles vertex colors, materials, shading and even
> textures (when one takes precedence over the other, etc.) so I'd like the
> advice of someone who knows more than me in this respect.
>
> Thanks,
>
> J-S
> --
> ______________________________________________________
> Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
>                               http://www.cm-labs.com/
>                        http://whitestar02.webhop.org/
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to