The D3D debug drivers gave me this explanation:
Direct3D9: (ERROR) :Stage 0 - Count in D3DTSS_TEXTURETRANSFORMFLAGS must be 0 when programmable pipeline is used
I found it amusing to see the bug elsewhere (here) and it made me think that it was happening only on certain configurations.
In order to fix it I changed the setMaterial bit of code into this:
Code: Select all
//! sets a material
void CD3D9Driver::setMaterial(const SMaterial& material)
{
Material = material;
bool bEnableTransform = Material.MaterialType < (s32)MaterialRenderers.size();
for (u32 i=0; i<MaxTextureUnits; ++i)
{
setTexture(i, Material.getTexture(i));
if(bEnableTransform)
setTransform((E_TRANSFORMATION_STATE) ( ETS_TEXTURE_0 + i ), material.getTextureMatrix(i));
else
pID3DDevice->SetTextureStageState( i, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE );
}
}