[osg-users] Manipulating the diffuse color in the entire scene

Ofir Ofir ofirosg at gmail.com
Tue Jul 24 04:35:50 PDT 2007


Hello Robert,

Thanks for the quick reply. Let me clarify my issue: I rendered the scene
into the color buffer with all the lights off (now the color buffer has only
the ambient component). I would now like to render only the diffuse color of
the scene, and add it to the ambient color in the color buffer, so it will
look as if I rendered the scene naturally  (so now the color on the screen
is ambient + diffuse).

I tried using the BlendFunc with several combinations of src/dst but the
output color of this is distorted.

Thanks!

Ofir

2007/7/23, Robert Osfield <robert.osfield at gmail.com>:
>
> Hi Ofir,
>
> Material::setColorMode(ColorMode mode) is what you need to set, i,e,
>
>   material->setColorMode(osg::Material::DIFFUSE);
>
> In OpenGL docs see the second on glColorMaterial.
>
> Robert.
>
> On 7/23/07, Ofir Ofir <ofirosg at gmail.com> wrote:
> >
> > Hello!
> >
> > I would like to use a node with a special StateSet, so I can force the
> > diffuse color in the entire scene (which is added as a child to the
> node) to
> > be (0,0,0,1).
> >  I tried doing so with the attribute Material:
> > "
> > node->addChilde( entireSceneNode );
> >
> > state = node->getOrCreateStateSet();
> >
> > material->setDiffuse( Material::FRONT_AND_BACK, Vec4( 0, 0, 0, 1 ) );
> >
> > state->setAttributeAndModes( material.get(), StateAttribute::ON |
> > StateAttribute::OVERRIDE);
> > "
> >
> > But the result was that the ambient,specular,shinness etc. was changed
> as
> > well. How can I force the diffuse color alone on the entire scene?
> >
> > Thanks!
> >
> > Ofir
> > _______________________________________________
> > osg-users mailing list
> > osg-users at lists.openscenegraph.org
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070724/0262d93a/attachment-0001.html 


More information about the osg-users mailing list