Prior to r3388, the same specular_color (or specular in 1.73) attribute was used as the overall specular colour when there was no specular map, and modulated the specular map when a specular map was used. This turns out to be a bad idea.
In the following picture, the Griff Cobra has been modified to use the material model with no custom shader. The first version is shown in full shader mode. The second version is in r3385 with shaders off and exactly the same material configuration. The third version is with shaders off and specular_color set to (0.2, 0.2, 0.2) (instead of white), giving roughly the desired effect. The problem is that if I left it that way, the specular highlights would barely be visible with shaders turned on.
As of r3388, specular_color is ignored when shaders are available and a specular map is specified. Instead, a new property specular_modulate_color can be used to modulate the colour of the specular map.
The same basic problem applies to emission_color(née emission) and emission maps: when emission mapping is unsupported (i.e. reduced detail mode, systems which don’t support multitexturing, or versions earlier than r3155) the emission colour is applied to the whole ship instead of modulating the emission map. (This effect isn’t visible above since multitexturing is used in the shaderless shots.) The fix is the same: emission_color is now ignored when an emission map is used, and emission_modulate_color has been added.
The recently-introduced illumination_color has been renamed illumination_modulate_color for consistency.
Here’s the material dictionary for r3388, which works right with or without shaders:
Code: Select all
// Ship:
materials =
{
"griff_cobra_mk3_mainhull_diffuse_spec.png" =
{
diffuse_map = "griff_cobra_mk3_mainhull_diffuse_spec.png";
normal_map = "griff_cobra_mk3_mainhull_normal.png";
specular_map = { name = "griff_cobra_mk3_mainhull_diffuse_spec.png"; extract_channel = "a"; };
specular_color = ( 0.2, 0.2, 0.2 ); // Applies when specular map is not used (no shaders)
shininess = 5;
emission_map = { name = "griff_cobra_mk3_mainhull_normal.png"; extract_channel = "a"; };
emission_modulate_color = (0.9926, 0.9686, 0.7325);
};
};
// Gun:
materials =
{
"griff_cobra_mk3_front_gun_diffuse_spec.png" =
{
diffuse_map = "griff_cobra_mk3_front_gun_diffuse_spec.png";
normal_map = "griff_cobra_mk3_front_gun_normal.png";
specular_map = { name = "griff_cobra_mk3_front_gun_diffuse_spec.png"; extract_channel = "a"; };
specular_color = ( 0.2, 0.2, 0.2 );
shininess = 5;
};
};