OgreXML and Vertex Colours

Hi all!



I would like to control the colour of an object directly from a mesh.xml file (not from a material file). I expected I would be able to do this using the colour_diffuse element of the vertex element. However, whatever I do with this element, it doesn’t seem to do anything.



Here’s my material file:



[java]

material Cube0

{

technique

{

pass

{

ambient 0.1 0.1 0.1 1

diffuse 1 1 1 1

specular 1 1 1 5.6

emissive 0 0 0

}

}

}

[/java]



And an example vertex element:



[xml]

<vertex>

<position x=“0.05” y="-0.05" z="-0.05" />

<normal x=“1” y="-1" z="-1" />

<colour_diffuse value=“1.0 0.0 0.0” />

</vertex>

[/xml]



I’ve tried removing the diffuse component from the material declaration, but it didn’t do anything either.



Is there some kind of precedence of material colours that I’m not aware of? Something else?

Aaaand to answer my own question - to use vertex colours defined in the mesh.xml file, the material definition should be:



[java]

material cube0

{

technique

{

pass

{

ambient 0.5 0.5 0.5 0.5

diffuse vertexcolour

specular 1 1 1 5.6

emissive 0 0 0

}

}

}

[/java]