Game Development Community

TGEA 1.7.0 Beta 1 Bug - CustomMaterial Documentation

by Kirk Longendyke · in Torque Game Engine Advanced · 03/20/2008 (11:32 am) · 0 replies

The example listed under Sample CustomMaterial utilises a specified version = 2.0;
under lower specified cards, the custommaterial will not properly fall back to a valid material definition, so you need to include a specified fallback in the actual custommaterial definition, ie:

new CustomMaterial( buggy_bodybase)
{
texture[0] = "./base";
texture[1] = "./baseb";
shader = ColorPickerShader;
version = 2.0;//<<
fallback = buggy_bodybase_fallback; //<----------------------------------------------------
pixelSpecular[0] = true;
specular[0] = "0.85 0.85 0.85 0.85";
specularPower[0] = 512.0;
preload = true;
};

new CustomMaterial( buggy_bodybase_fallback)
{
texture[0] = "./base";
texture[1] = "./baseb";
shader = ColorPickerShader14;
version = 1.4;//<<
pixelSpecular[0] = true;
specular[0] = "0.85 0.85 0.85 0.85";
specularPower[0] = 512.0;
preload = true;
};

or the texture will not render on low end cards.