How do I create a shaded manual object with colours for each vertex?
Eg if ogreObj
is the Ogre::ManualObject
:
ogreObj->begin("BaseWhiteNoLighting", Ogre::RenderOperation::OT_TRIANGLE_LIST);
will allow me to select each vertex's colour with ogreObj->colour(r, g, b)
after each ogreObj->position(x, y, z)
and ogreObj->normal(x, y, z)
call.
However, if I change the material to BaseWhite
, color()
instructions are ignored.
I read that you must disable lighting int the .material
script, but I need it active...
Any advice?
ANSWER: This Ogre forum's thread has a simple .material
script that works for this purpose:
material Voxel/Default
{
technique
{
pass
{
diffuse vertexcolour
specular vertexcolour
ambient vertexcolour
lighting on
}
}
}
.material
script with this content:material Voxel/Default { technique { pass { diffuse vertexcolour specular vertexcolour ambient vertexcolour lighting on } } }
\$\endgroup\$