OK, changed the shader's last two lines to:
color = norm;
gl_FragColor = vec4(color, 1.0);
Got this,
only when one of the other light events is firing (weapons / vernier thrusters):
If you can't tell, that's an almost-but-not-truly-black ship-shape. Weird.
So...
1. The permanent distant light isn't working at all atm, otherwise we'd see this all the time. Which isn't making sense.
The code used is here...
Spoiler
package data.scripts.plugins;
import java.util.List;
import org.lwjgl.util.vector.Vector2f;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.EveryFrameCombatPlugin;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.CollisionClass;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.combat.ShipHullSpecAPI;
import com.fs.starfarer.api.combat.WeaponAPI;
import java.awt.Color;
import java.util.HashMap;
import java.util.Map;
import org.dark.shaders.light.LightAPI;
import org.dark.shaders.light.LightShader;
import org.dark.shaders.light.StandardLight;
import org.lwjgl.util.vector.Vector3f;
public class ShipPhysics implements EveryFrameCombatPlugin {
private CombatEngineAPI engine;
private float height;
private float width;
private boolean doneOnce = false;
public static Map darkMap = new HashMap();
@Override
public void init(CombatEngineAPI engine) {
this.engine = engine;
this.height = engine.getMapHeight() / 2f;
this.width = engine.getMapWidth() / 2f;
}
@Override
public void advance(float amount, List events)
{
if (engine.isPaused()) return;
if(!doneOnce){
//Create the new light
StandardLight sunLight = new StandardLight();
sunLight.setColor(255f,255f,255f);
sunLight.setType(3);
Vector3f dir = new Vector3f(-0.57735f, -0.57735f, -0.57735f);
sunLight.makePermanent();
sunLight.setDirection(dir);
sunLight.setIntensity(10f);
sunLight.setSpecularIntensity(10f);
LightShader.addLight(sunLight);
doneOnce = true;
}
//Gets all ships;
for (ShipAPI ship : engine.getShips()){
if(!darkMap.containsKey(ship)){
ship.getSpriteAPI().setColor(new Color(32,32,32,255));
for(WeaponAPI weapon : ship.getAllWeapons()){
if(!weapon.getSlot().isHardpoint() && !weapon.getSlot().isDecorative() && !weapon.getSlot().isSystemSlot()){
weapon.getSprite().setColor(new Color(32,32,32,255));
}
}
darkMap.put(ship,ship);
}
}
}
}
2. The results don't make sense. I should be seeing the normal map or pure black; instead, I'm seeing almost-black gray.
Any ideas? I don't suppose you're using additive blending here or something like that?