Hi Wojtek,
Thanks for the vertex shader trick, but in this way i gate pure black
shadow and terrible artifact on my shadow caster model.
Actually i can see two way to solve my lighting problem.
-Make a vertex shader who can compute lighting with glMaterial and
glColor both.
but it's seem to me that it's impossible without using an uniform
switch.
-Use a nodeVisitor to replace vertex color attribute by a similar material.
But here i dont now how to check actual color mode:
void setMatNodeVisitor::apply(osg::Node& node)
{
osg::Geode* geode = node.asGeode();
if(geode)
{
for(int i =0; i < geode->getNumDrawable(); i++)
{
osg::Material* mat = (osg::Matrial*)
geode->getDrawable(i)->getStateSet();
if(mat){
if(mat.getColorMode() == osg::Material::OFF)
//no material off in my scene ...
}
}
}
}
Wojciech Lewandowski a écrit :
Hi Antonin,
I am glad you had this sorted it out. You may try to replace shaders
with yours. Its possible to set only fragment shaders and use fixed
pipeline for vertices by setting MainVertexShader and
ShadowVertexShader to NULL.
Cheers,
Wojtek
----- Original Message ----- From: "Antonin Linares"
<antonin.lina...@onera.fr>
To: "OpenSceneGraph Users" <osg-users@lists.openscenegraph.org>
Sent: Monday, May 04, 2009 4:11 PM
Subject: Re: [osg-users] ViewDependentShadow and Lod
Again,
Please don't care of my previous message, i'm wrong.
Some part of my terrain database use pure glColor(), so the shader
miss compute this part of database.
Sorry all.
_______________________________________________
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
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org