Draw Scaled flipped normals for cartoon outline?
by kingkong · in Torque Game Engine · 10/22/2006 (6:30 pm) · 3 replies
I saw "Cell Shading Tutorial" thread.
i tried it with 3dsmax and i works well.
the outline looks much better than drawing edges for outline.
instead of making model with scaled fliped normals,
i want to modify engine to draw mesh with scaled and flipped normals.
void TSMesh::render(S32 frame, S32 matFrame, TSMaterialList * materials, const MatrixF *objectTransform)
{
// draw normals
// draw scaled flipped normals with black color
}
how can i draw scaled flipped normals with black color for outline??
i don't know opengl, yet.
please, any advice!
thanks.
i tried it with 3dsmax and i works well.
the outline looks much better than drawing edges for outline.
instead of making model with scaled fliped normals,
i want to modify engine to draw mesh with scaled and flipped normals.
void TSMesh::render(S32 frame, S32 matFrame, TSMaterialList * materials, const MatrixF *objectTransform)
{
// draw normals
// draw scaled flipped normals with black color
}
how can i draw scaled flipped normals with black color for outline??
i don't know opengl, yet.
please, any advice!
thanks.
Torque Owner J "hplus" W
First, turn off texturing and lighting. Then, set the vertex color to all black. Then, change glCullMode from CCW to CW (or is it the other way around? I forget). Then either bind a shader that moves the geometry based on the normal, or do a software transform on the vertex array to move the vertices out. Then draw that.
Then set all the state back again.