The Hiryu model by Damawo includes lighting
https://www.sas1946.com/main/index.php/topic,44814.0.htmlThis is coded in the class files.
I have used this to enable lighting for the Illustrious class carriers, but I was not happy with the result.
Instead of the light fading gradually with distance it stays at constant brightness then cuts off abruptly.
Needs some clever coding to improve this aspect.
Attached is some files to enable lighting on HMS Formidable CV --- still WIP
https://www.mediafire.com/?12bej4q4l15ycr6The same lighting should work on HMS Illustrious and HMS Indomitable. Just needs the coding to be cloned.
Lighting code is based on original code by Damawo.
Code is copied from Hiryu and selected parts enabled to suit HMS Formidable.
I have not worked out what all the code in the Emitter section does yet.
I think it might be for patches of area lighting in Hiryu - not sure.
Source code for the lighting extracted from ShipMod.java is as follows:
public static class HMSFormidableCV extends Ship.HMSIllustriousCV
implements TgtShip
{
public HMSFormidableCV()
{
}
public HMSFormidableCV(String s, int i, SectFile sectfile, String s1, SectFile sectfile1, String s2)
{
super(s, i, sectfile, s1, sectfile1, s2);
// Deck lighting code start
Loc loc = new Loc(0.0D, 0.0D, 0.0D, 0.0F, 0.0F, 0.0F);
Loc loc1 = new Loc();
Loc loc2 = new Loc();
Loc loc3 = new Loc();
Loc loc4 = new Loc();
Loc lock = new Loc();
if( World.getTimeofDay() >= 0.5F && World.getTimeofDay() <= 6.0F)
{
//// Point3d[] point3dk = new Point3d[5]
//// Loc loc4 = new Loc();
//// Loc loc5 = new Loc();
//// Loc loc6 = new Loc();
// //red bow side light
// for(int wl = 0; wl < 15; wl++){
// Eff3DActor.New(this, this.findHook("_SLightL" + wl), null , 1.0F, "3DO/Effects/Lights/FlareRedk.eff", -1F);
// Eff3DActor.New(this, this.findHook("_SLightR" + wl), null , 1.0F, "3DO/Effects/Lights/FlareRedk.eff", -1F);
// }
//
// Eff3DActor.New(this, this.findHook("_TSLight0"), null , 1.0F, "3DO/Effects/Lights/FlareWhitek.eff", -1F);
// Eff3DActor.New(this, this.findHook("_MLight0"), null , 1.0F, "3DO/Effects/Lights/FlareWhitekb.eff", -1F);
// Eff3DActor.New(this, this.findHook("_BRLight0"), null , 1.0F, "3DO/Effects/Lights/FlareWhitek2.eff", -1F);
// //red tail light
// for(int red = 0; red < 3; red++){
// Eff3DActor.New(this, this.findHook("_TLightL" + red), null , 1.0F, "3DO/Effects/Lights/FlareRedk.eff", -1F);
// Eff3DActor.New(this, this.findHook("_TLightR" + red), null , 1.0F, "3DO/Effects/Lights/FlareRedk.eff", -1F);
// }
// nose white deck light
for(int nwl = 0; nwl < 8; nwl++)
Eff3DActor.New(this, this.findHook("_NLight" + nwl), null , 1.0F, "3DO/Effects/Lights/FlareWhitek.eff", -1F);
// tail white deck light
for(int tred = 0; tred < 15; tred++)
Eff3DActor.New(this, this.findHook("_TLight" + tred), null , 1.0F, "3DO/Effects/Lights/FlareWhitek.eff", -1F);
//red bow port side light
for(int wl = 0; wl < 12; wl++)
Eff3DActor.New(this, this.findHook("_SLightL" + wl), null , 1.0F, "3DO/Effects/Lights/FlareRedk.eff", -1F);
//red stbd side light
for(int wl = 0; wl < 15; wl++)
Eff3DActor.New(this, this.findHook("_SLightR" + wl), null , 1.0F, "3DO/Effects/Lights/FlareRedk.eff", -1F);
// center line deck light
for(int cwl = 0; cwl < 18; cwl++)
Eff3DActor.New(this, this.findHook("_CLight" + cwl), null , 1.0F, "3DO/Effects/Lights/FlareWhitek.eff", -1F);
// mast head light (flashing)
Eff3DActor.New(this, this.findHook("_MLight0"), null , 1.0F, "3DO/Effects/Lights/FlareWhitekb.eff", -1F);
// // cruising light Portside and starBord
// Eff3DActor.New(this, this.findHook("_PLight0"), null , 1.0F, "3DO/Effects/Lights/FlareGreenkb.eff", -1F);
// Eff3DActor.New(this, this.findHook("_BLight0"), null , 1.0F, "3DO/Effects/Lights/FlareRedkb.eff", -1F);
// // landing instruction light
// for(int igrn = 0; igrn < 4; igrn++)
// Eff3DActor.New(this, this.findHook("_LILightG" +igrn ), null , 1.0F, "3DO/Effects/Lights/FlareGreenkb.eff", -1F);
// for(int ird = 0; ird < 2; ird++)
// Eff3DActor.New(this, this.findHook("_LILightR" + ird), null , 1.0F, "3DO/Effects/Lights/FlareRedkb.eff", -1F);
// // emitter section
// HookNamed hooknamedk1 = new HookNamed(this, "_PLight0");
// hooknamedk1.computePos(this, new Loc(), loc1);
// Point3d point3d1 = loc1.getPoint();
// light1 = new LightPointActor(new LightPointWorld(),point3d1);
// light1.light.setColor(0.0F, 1.0F, 0.0F);
// light1.light.setEmit(2.0F, 8.0F);
// draw.lightMap().put("_PLight0",light1);
// HookNamed hooknamedk2 = new HookNamed(this, "_BLight0");
// hooknamedk2.computePos(this, new Loc(), loc2);
// Point3d point3d2 = loc2.getPoint();
// light2 = new LightPointActor(new LightPointWorld(),point3d2);
// light2.light.setColor(1.0F, 0.0F, 0.0F);
// light2.light.setEmit(2.0F, 8.0F);
// draw.lightMap().put("_BLight0",light2);
// HookNamed hooknamedk3 = new HookNamed(this, "_BRLight0");
// hooknamedk3.computePos(this, new Loc(), loc3);
// Point3d point3d3 = loc3.getPoint();
// light3 = new LightPointActor(new LightPointWorld(),point3d3);
// light3.light.setColor(1.0F, 0.9F, 0.5F);
// light3.light.setEmit(1.5F, 6.0F);
// draw.lightMap().put("_BRLight0",light3);
// HookNamed hooknamedk4 = new HookNamed(this, "_DLLightL1");
// hooknamedk4.computePos(this, new Loc(), loc4);
// Point3d point3d5 = loc4.getPoint();
// light4 = new LightPointActor(new LightPointWorld(),point3d5);
// light4.light.setColor(1.0F, 0.9F, 0.5F);
// light4.light.setEmit(1.5F, 6.0F);
// draw.lightMap().put("_DLLightL1",light4);
// // deck light
// for(int DL = 0; DL < 5; DL++){
// HookNamed hooknamedkk = new HookNamed(this, "_DLLightL" + DL);
// lock.set(1.0D, 0.0D, 0.0D, 0.0F, 0.0F, 0.0F);
// hooknamedkk.computePos(this, loc, lock);
// Point3d point3d4 = lock.getPoint();
// lightk[DL] = new LightPointActor(new LightPointWorld(),point3d4);
// lightk[DL].light.setColor(1.0F, 0.9F, 0.5F);
// lightk[DL].light.setEmit(2.0F, 8.0F);
// draw.lightMap().put("_DLLightL" + DL,lightk[DL]);
// }
}
}
// public LightPointActor light1;
// public LightPointActor light2;
// public LightPointActor light3;
// public LightPointActor light4;
// public LightPointActor[] lightk = new LightPointActor[5];
// public LightPointActor light4;
// public LightPointActor light5;
// public LightPointActor light6;
// Deck lighting code end
}
If anyone wants to develop this further feel free.