I'm trying to use vertex colour tracking to define the colours on my objects instead of specifically setting them in the pass information and everything works fine except when I enable (additive stencil) shadows. Using Ogre 1.7.2 GL.
See below:
Images - Left: No Shadows, Right: With Shadows
Coloured Mode (Old Way - No Vertex Colour Tracking) - i.e. using pass->setAmbient(colour) and pass->setDiffuse(colour)
- No shadows. Works as expected.
- With Shadows. Works as expected.
Coloured Mode (New Way - Vertex Colour Tracking) - i.e. using manual->colour(colour) and pass->setVertexColourTracking(TVC_AMBIENT|TVC_DIFFUSE)
- No shadows. Works as expected.
- With Shadows. Everything looks over exposed. Doesn't work as expected...
Textured Mode (No Vertex Colour Tracking)
- No shadows. Works as expected.
- With Shadows. Applies vertex colour when it shouldn't. Doesn't work as expected...
FYI - I switch between Coloured and Textured modes using Material Schemes.
Here's what my material definitions look like (i've clumped the techniques together just for posting on the forum):
Code: Select all
material Material_Base
{
// Coloured Mode (No Vertex Colour Tracking) - What i was doing before
technique
{
scheme ViewMode_Coloured
pass
{
lighting on
shading phong
ambient 0.7 0.7 0.7 1.0 // set in code, but set these defaults anyway
diffuse 0.7 0.7 0.7 1.0 // set in code, but set these defaults anyway
// scene_blend alpha_blend // set in code, but only for transparent materials
// depth_write off // set in code, but only for transparent materials
}
}
// Coloured Mode (Vertex Colour Tracking) - What i'm trying to use now
technique
{
scheme ViewMode_Coloured
pass
{
lighting on
shading phong
ambient vertexcolour // disabled tracking in code for transparent materials, they have specific colours to use
diffuse vertexcolour // disabled tracking in code for transparent materials, they have specific colours to use
// scene_blend alpha_blend // set in code, but only for transparent materials
// depth_write off // set in code, but only for transparent materials
}
}
// Textured Mode - This mode hasn't changed
technique
{
scheme ViewMode_Textured
pass
{
lighting on
shading phong
ambient 0.7 0.7 0.7 1.0
diffuse 0.7 0.7 0.7 1.0
texture_unit DiffuseMap
{
texture_alias DiffuseMap // set in code
}
}
}
}
So does anyone have ideas on what's going wrong? Is this a bug or limitation in Ogre? Or am i doing something wrong? Seems like it's a bug to me...
EDIT: Do i have to do something with the material pass 'illumination_stage' parameter?
Any help appreciated!
Regards,
Kaylx