It can be done easily with straight GL commands but I'd like to use Irrlicht commands and so retain Irrlicht's ability to use multiple renders.
Example code from a demo called "Loony".
Code: Select all
// Do the silhouette lines if desired
if (m_Silhouette)
{
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glColor3fv(&m_SilhouetteColor.r); // Set Line Color
glLineWidth(m_SilhouetteWidth); // Give it some beef
glDepthFunc(GL_LEQUAL); // Draw shared edges
glPolygonMode(GL_BACK,GL_LINE); // Draw Lines
glCullFace(GL_FRONT); // Draw backfacing edges only
glInterleavedArrays(model->dataFormat,0,(GLvoid *)model->vertexData);
glDrawArrays(GL_TRIANGLES,0,model->faceCnt * 3);
// Set Everything Back to original settings
glDepthFunc(GL_LESS);
glColor3f(1.0f, 1.0f, 1.0f);
glCullFace(GL_BACK);
}