re: damage texture not working - is this on a player ship? if i remember correctly you have to calculate energy levels differently for a player ship, the uniforms that send the relevant energy levels data from oolite to the shader are in a different format for players than they are for NPC ships, i remember being stuck on this for a while then someone (possibly Frame or Svengali) posed up a few lines of code to get it working, i'll have a dig through my shipset shaders to find the particular lines you need.
edit:
ok, i think this is the code you need for the damage glow texture on a player ship,
in your players ship in shipdata.plist, in the shaders\uniforms section write:
in your players ship fragment shader, have
then further down in the 'void main(void)' section of your shader have this code
Code: Select all
// Damage Calculator
float tempvar = float(damage_amount);
float DamageAmount = mod(tempvar, 100.0) / 100.0;
so now we've got a new floating point number called DamageAmount (note: case sensitive) that we can use as an opacity setting for mixing in your damage texture
Code: Select all
finalColor += IlluminationMap2 * DamageAmount;
If you want the texture drawn at full opacity when the ship is full of energy and gradually have it fade out as the ship energy level falls then subtract DamageAmount from 1.0 and use that result as the opacity level
Code: Select all
finalColor += IlluminationMap2 * (1.0 - DamageAmount);
at least i think that'll work i haven't tested it! - you could do that to your Lights texture map so they fade as the ship gets more and more beaten up and the energy banks start draining
