All,
I made a couple of changes to the osgFX::Outline class (SVN patch
attached). I had a couple of issues with it that I was trying to resolve:
1. When an outline object was occluded by another object, the backfacing
wireframe was exposed. To fix that, I removed the disabling of
GL_DEPTH_TEST.
2. In some cases, the outline color was the same color as the geometry
being drawn instead of the specified color. I'm not sure I have
completely fixed this issue, but I did make some changes to match up to
how we do a scribe effect.
-Todd
Index: Outline.cpp
===================================================================
--- Outline.cpp (revision 11730)
+++ Outline.cpp (working copy)
@@ -71,8 +71,9 @@
_color = color;
if (_material.valid()) {
const osg::Material::Face face = osg::Material::FRONT_AND_BACK;
- _material->setAmbient(face, color);
- _material->setDiffuse(face, color);
+ _material->setAmbient(face, osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
+ _material->setDiffuse(face, osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
+ _material->setSpecular(face, osg::Vec4(0.0f, 0.0f, 0.0f,
1.0f));
_material->setEmission(face, color);
}
}
@@ -135,13 +136,12 @@
// outline color/material
_material = new osg::Material;
- _material->setColorMode(osg::Material::AMBIENT_AND_DIFFUSE);
+ _material->setColorMode(osg::Material::OFF);
setColor(_color);
state->setAttributeAndModes(_material.get(), Override_On);
// disable modes
state->setMode(GL_BLEND, Override_Off);
- state->setMode(GL_DEPTH_TEST, Override_Off);
state->setTextureMode(0, GL_TEXTURE_1D, Override_Off);
state->setTextureMode(0, GL_TEXTURE_2D, Override_Off);
state->setTextureMode(0, GL_TEXTURE_3D, Override_Off);
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org