[osg-users] reset root color to original colors
Sebastian Messerschmidt
sebastian.messerschmidt at gmx.de
Wed May 25 01:10:10 PDT 2016
Hi Bruno,
Your question is a bit vague. If you use a shader you have total control
over the colors.
If my interpretation of your question is correct, you want to disable
the shader. There is no real "disable" it, you have to bind a empty
program instead. (simply don't assign any shader).
Cheers
Sebastian
> Hello,
>
> I have one single root node in my scene graph. I have a vertex array
> and a color array. I susually use them in conjunction to see my
> vertices with the original colors, with
>
> ret->setColorArray(m_colors);
> ret->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
>
>
> Now I am adding the option for custom shaders. This is done with
> osg::Programs, and adding the program to the stateset of the root node.
>
> osg::ref_ptr<osg::Program> program = new osg::Program;
> program->setName(m_name);
> program->addShader(new osg::Shader(osg::Shader::VERTEX, m_vertex));
> program->addShader(new osg::Shader(osg::Shader::FRAGMENT,
> m_fragment));
>
> Now I want to reset this, and assign the original colors I have in the
> color Array back again. How can I do this? Do I have to create a new
> shader for applying the custom colors in the color array? Or can I
> reset this in a simpler fashion?
>
>
> _______________________________________________
> 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/20160525/77d8b4ef/attachment-0003.htm>
More information about the osg-users
mailing list