As I said above, the goal (or rather, a goal) is to support most of what Griff’s ships do without requiring shaders. My main test is the Adder, which does most of the “normal” Griffly things without anything too exotic (like, say, the Thargoids and Morays).
Here is my current Adder material specification.
- Diffuse colour, normal mapping and specular highlights work. As of r4780, this includes the metallic (self-colouring) effect thanks to the new
self_color
and scale_factor
attributes.
- I haven’t done anything for paint mapping or decals yet. I intend to do paint maps (and remove some of their current limitations). I’m not sure about decals.
- Also as of r4780, arbitrarily many light maps can be used, as shown. The
conditional_color
, binding
, damage_flicker
and simple_mode
attributes aren’t implemented yet; when they are, the glows will respond to the environment in the same way as the standard Griff Adder. As it stands, you just get all four effects on full blast. All these light maps work like emission maps; adding illumination_mode = true
turns them into illumination maps.
I realise there are a lot of weird magic words to take in at once. If you want to understand what’s going on here and don’t, please ask
specific questions. :-)
Code: Select all
{
diffuse_map = "oolite-adder-diffuse.png";
normal_map = "oolite-adder-normal.png";
specular_color_map =
{
name = "oolite-adder-diffuse.png";
extract_channel = "a";
self_color = true; // Modulate specular colour with diffuse colour.
scale_factor = 6; // Multiply all channels by a constant.
};
specular_exponent = 5;
light_map =
(
{
// Light map 1: lamp/window glow map.
name = "oolite-adder-effects.png";
extract_channel = "a";
// Base colour is yellow-white.
color = (0.9926, 0.9686, 0.7325);
// Turn red (and subtract base green and blue) in combat. Ignored in simple shader mode.
conditional_color =
{
binding = "hasHostileTarget";
color = (1.5, -0.4, -0.4);
};
// Flicker on and off while throwing sparks.
damage_flicker = true;
},
{
// Light map 2: cyan engine glow, full shaders only.
name = "oolite-adder-effects.png";
extract_channel = "b";
color = (0.4, 1.4, 1.8);
// Intensity is controlled by speedFactor.
binding = "speedFactor";
// Flicker on and off while throwing sparks.
damage_flicker = true;
// Disable in simple shader mode.
simple_mode = false;
},
{
// Light map 3: orange engine heat glow, full shaders only.
name = "oolite-adder-effects.png";
extract_channel = "r";
color = (1.5, 0.55, 0.2);
// Intensity is controlled by speedFactor.
binding = "speedFactor";
// Disable in simple shader mode.
simple_mode = false;
},
{
// Light map 4: red laser heat glow, full shaders only.
name = "oolite-adder-effects.png";
extract_channel = "g";
color = (1.38, 0.35, 0.20);
// Intensity is controlled by laser temperature.
binding = "laserHeatLevel";
// Disable in simple shader mode.
simple_mode = false;
}
);
};