Re: [osg-users] reset root color to original colors

2016-05-25 Thread Bruno Oliveira
Thank you very much, those hints did the job.

I will try to better explain my question the next time. I intended to
disable the shader / program.

2016-05-25 9:10 GMT+01:00 Sebastian Messerschmidt <
sebastian.messerschm...@gmx.de>:

> 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 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 
> listosg-users@lists.openscenegraph.orghttp://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
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] CullVisitor object not getting properly deleted

2016-05-25 Thread Rick Irons
Hi Robert,

Thanks for the update.   I will try out the fix.

Rick

> On May 24, 2016, at 3:53 PM, Robert Osfield  wrote:
> 
> Hi Rick,
> 
> After a preplexing day looking at how the osgUtiil::CullVisitor,
> osg::Camera and RenderStageCache were all interacting via the
> osg::Observer system I finally fixed the problem with the crash that
> I've see with the osgoit and osgprerender examples.   As the crash
> looks similar to what you saw there is reasonable chance that the
> changes should work for you too.
> 
> I have checked my fix into master and OpenSceneGraph-3.4.
> 
> Robert.
> ___
> 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


Re: [osg-users] reset root color to original colors

2016-05-25 Thread Sebastian Messerschmidt

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 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@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


Re: [osg-users] reset root color to original colors

2016-05-25 Thread Robert Osfield
Hi Bruno,

It's impossible for us to know exactly what you are doing given the
explanation, so have to guess at the possibilities.

If you shader is using per vertex colours to determine the colours
then simply reassigning the new colour to the geometry, and calling
Geometry::dirtyDisplayList() if you are using display lists, will be
sufficient.  If you are using uniforms to set the colour then simply
changing the uniform value will be sufficient.

Robert.

On 24 May 2016 at 23:17, Bruno Oliveira  wrote:
> 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 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@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