i'm getting this error when trying to bind it to a shader:
Code: Select all
oolite.exe[2252] [shader.uniform.bind.failed]: Could not bind uniform "nearly_dead" to -[ShipEntity ?] (no uniform of that name could be found).
Code: Select all
uniforms = {
time = "universalTime";
engine_power = "speedFactor";
laser_heat_level = "laserHeatLevel";
nearly_dead = "throwingSparks";
hull_heat_level = "hullHeatLevel";
};
in the fragment shader i've got:
Code: Select all
uniform bool nearly_dead;
Code: Select all
if (nearly_dead = true)
{
color += cyanGlow(effectsMap.r * Pulse(min(engine_power, 1.0), 1.0)) * Blink_on_off(Pulse(1.0, 1.0));
color += effectsMap.a * diffuseMap * Blink_on_off(Pulse(1.0, 0.6));
}
else
{
color += cyanGlow(effectsMap.r * Pulse(min(engine_power, 1.0), 1.0));
color += effectsMap.a * diffuseMap * 3.0;
}
what i'm seeing in oolite is the flickering effect as if the nearly_dead bool is true, even though the ship is not in the throwingSparks state, what's odd is if i edit the shader and change if (nearly_dead = true) to if (nearly_dead = false) i don't see the flickering effect, so it's as if the if else stuff is being acted on.
Edit: fixed by Cmdr James, i had the shader code wrong
Also, does hullHeatLevel always have a slightly positive value even when ships are just milling around aimlessly in space?
i've added in the hull heat glow effect from the shady cobra to the griff_krait shader and now all the kraits are glowing slightly red, as if hullHeatLevel starts off at some value such as 0.1 - this is for non-player craft, i haven't tested it with a player ship