I hope there will be a name now, otherwise call me Sam :)
The funny thing is that disabling light worked before on other models, while
assigning emission color, the objects have color, no matter if lighting is
on or off (actually it is not full white, but I am on it)
The other problem was solved by using the StatsVisitor (which I wanted to
avoid). Traversing nodes clearing states and setting color arrays to 0
helped.
Thanks
Sam
--------------------------------------------------
From: "Robert Osfield" <[EMAIL PROTECTED]>
Sent: Monday, August 04, 2008 11:23 AM
To: "OpenSceneGraph Users" <[email protected]>
Subject: Re: [osg-users] Removing colors and lighing from model?
Hi ?? Could you please sign the name you wish to be addressed as.
As for your attempt at making your scene white, the problem is that
you are disabling lighting, and in OpenGL the glMaterial has no effect
when lighting is disabled, in this case only OpenGL vertex colours and
textures effect the colour of objects. So enable lighting rather than
disable it.
Robert.
On Mon, Aug 4, 2008 at 9:57 AM, Ariasgore <[EMAIL PROTECTED]> wrote:
I have troubles to remove every color and every lighting from a loaded
model, basically I want to to draw a model completly white without any
shading my code snippet is:
// state is a pointer to the group where the model will be added
state->setMode( GL_LIGHTING, osg::StateAttribute::OFF |
StateAttribute::PROTECTED );
state->removeAttribute(StateAttribute::POLYGONMODE);
state->removeAttribute(StateAttribute::MATERIAL);
osg::Material* mat = new osg::Material();
mat->setEmission(osg::Material::FRONT_AND_BACK,
osg::Vec4(0.0,0.0,0.0,1.0));
state->setAttributeAndModes(mat, osg::StateAttribute::ON |
StateAttribute::PROTECTED);
Basically I set the material as protected which should work but it doesnt
for the models like axis.osg, or cessna.osg. Other model files from a
model
database are rendered white but these ones keep their color and their
lighting.
Is there a way to fix that without visiting each node of the loaded
models?
Thanks
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org