Well, my idea was to make a guide once I figured it out a bit more. I’m still not done, only managed to fix the lighting part of the headlights but there are still some things to do. And it seems I got the color more or less right but I still have to fiddle around with the intensity and angles. And I have to fix the glowmaps too
Also, finding which node to change can be hard in automation cars, some you can see in the debug view, but others are so close together that you can’t tell which is which, so it also took trial and error
If you want to experiment too, here are the values I used, in the .jbeam file of the exported car:
.jbeam for the headlights
"props": [
["func", "mesh", "idRef:", "idX:", "idY:", "baseRotation", "rotation", "translation", "min", "max", "offset", "multiplier"]
{
"lightInnerAngle":40
"lightOuterAngle":120
"lightAttenuation":{"x":0, "y":1, "z":1}
"lightCastShadows":true
"flareName":"vehicleHeadLightFlare"
"cookieName":"art/special/BNG_light_cookie_headlight.png"
"texSize":512
"shadowSoftness":0.5
}
//Toco madera
//Exterior derecha
["lowbeam", "SPOTLIGHT", "Light_-638_-1958_715_d4ffeb00_0", "Light_-638_-1958_715_d4ffeb00_1", "Light_-638_-1958_715_d4ffeb00_2", { "x":-5, "y":0, "z":0 }, { "x":0, "y":0, "z":0 }, { "x":0, "y":0, "z":0 }, 0, 0, 0, 1, { "baseTranslation":{"x":0.0, "y":0, "z":0.01}, "lightRange":70.000000,"lightBrightness":0.680000,"flareScale":0.388600,"lightColor":{"r":255, "g":186, "b":0, "a":255} }],
["highbeam", "SPOTLIGHT", "Light_-638_-1958_715_d4ffeb00_0", "Light_-638_-1958_715_d4ffeb00_1", "Light_-638_-1958_715_d4ffeb00_2", { "x":-2, "y":0, "z":0 }, { "x":0, "y":0, "z":0 }, { "x":0, "y":0, "z":0 }, 0, 0, 0, 1, { "baseTranslation":{"x":0.0, "y":0, "z":0.01}, "lightRange":120.000000,"lightBrightness":0.950000,"flareScale":0.582899,"lightColor":{"r":255, "g":186, "b":0, "a":255} }],
//Interior derecha
["lowbeam", "SPOTLIGHT", "Light_-491_-1993_706_d4ffeb00_0", "Light_-491_-1993_706_d4ffeb00_1", "Light_-491_-1993_706_d4ffeb00_2", { "x":-5, "y":0, "z":0 }, { "x":0, "y":0, "z":0 }, { "x":0, "y":0, "z":0 }, 0, 0, 0, 1, { "baseTranslation":{"x":0.0, "y":0, "z":0.01}, "lightRange":70.000000,"lightBrightness":0.680000,"flareScale":0.388600,"lightColor":{"r":255, "g":186, "b":0, "a":255} }],
["highbeam", "SPOTLIGHT", "Light_-491_-1993_706_d4ffeb00_0", "Light_-491_-1993_706_d4ffeb00_1", "Light_-491_-1993_706_d4ffeb00_2", { "x":-2, "y":0, "z":0 }, { "x":0, "y":0, "z":0 }, { "x":0, "y":0, "z":0 }, 0, 0, 0, 1, { "baseTranslation":{"x":0.0, "y":0, "z":0.01}, "lightRange":120.000000,"lightBrightness":0.950000,"flareScale":0.582899,"lightColor":{"r":255, "g":186, "b":0, "a":255} }],
//Exterior Izquierda
["lowbeam", "SPOTLIGHT", "Light_638_-1958_715_d4ffeb00_0", "Light_638_-1958_715_d4ffeb00_1", "Light_638_-1958_715_d4ffeb00_2", { "x":-10, "y":0, "z":0 }, { "x":0, "y":0, "z":0 }, { "x":0, "y":0, "z":0 }, 0, 0, 0, 1, { "baseTranslation":{"x":0.0, "y":0, "z":0.01}, "lightRange":70.000000,"lightBrightness":0.680000,"flareScale":0.388600,"lightColor":{"r":255, "g":186, "b":0, "a":255} }],
["highbeam", "SPOTLIGHT", "Light_638_-1958_715_d4ffeb00_0", "Light_638_-1958_715_d4ffeb00_1", "Light_638_-1958_715_d4ffeb00_2", { "x":-2, "y":0, "z":0 }, { "x":0, "y":0, "z":0 }, { "x":0, "y":0, "z":0 }, 0, 0, 0, 1, { "baseTranslation":{"x":0.0, "y":0, "z":0.01}, "lightRange":120.000000,"lightBrightness":0.950000,"flareScale":0.582899,"lightColor":{"r":255, "g":186, "b":0, "a":255} }],
//Interior Izquierda
["lowbeam", "SPOTLIGHT", "Light_491_-1993_706_d4ffeb00_0", "Light_491_-1993_706_d4ffeb00_1", "Light_491_-1993_706_d4ffeb00_2", { "x":-10, "y":0, "z":0 }, { "x":0, "y":0, "z":0 }, { "x":0, "y":0, "z":0 }, 0, 0, 0, 1, { "baseTranslation":{"x":0.0, "y":0, "z":0.01}, "lightRange":70.000000,"lightBrightness":0.680000,"flareScale":0.388600,"lightColor":{"r":255, "g":186, "b":0, "a":255} }],
["highbeam", "SPOTLIGHT", "Light_491_-1993_706_d4ffeb00_0", "Light_491_-1993_706_d4ffeb00_1", "Light_491_-1993_706_d4ffeb00_2", { "x":-2, "y":0, "z":0 }, { "x":0, "y":0, "z":0 }, { "x":0, "y":0, "z":0 }, 0, 0, 0, 1, { "baseTranslation":{"x":0.0, "y":0, "z":0.01}, "lightRange":120.000000,"lightBrightness":0.950000,"flareScale":0.582899,"lightColor":{"r":255, "g":186, "b":0, "a":255} }],
The first part seems to be general settings for everything, should be pretty self-explanatory. Inner angle is the angle in which the lights have maximum intensity it seems, and then it falls off slowly until reaching the outer angle. It also lists the formatting for the rest of the stuff: “[“func”, “mesh”, “idRef:”, “idX:”, “idY:”, “baseRotation”, “rotation”, “translation”, “min”, “max”, “offset”, “multiplier”]”
Exterior=Exterior, Interior=Interior (duh), Derecha=Right, Izquierda=Left.
In this car I used two modular headlight housings on each side, with one headlight “bulb” on each. So a total of 8 “headlight fixtures” to call it something (ignoring the blinkers and foglights).
I’m absolutely not an expert (still trying to figure this out) but I’ll try to share more or less what I already figured, I’ll make a standalone guide somewhere when I can finally get everything light-related working right.
Summary
So, basically, there are two parts to Beam.NG headlights:
Glowmap
This thing makes the light itself seem lit. Basically, changing the texture of the light fixture itself but not actually illuminating anything else. Most easily seen in blinkers and tailights.
Example
“glowMap”: {
“material_27_boulanger_trapeze_2_8_dl__mt__fra_efixturetype__eft_headlight014”:{“simpleFunction”:{“signal_R”:0.3}, “off”:“material_27_boulanger_trapeze_2_8_dl__mt__fra_efixturetype__eft_headlight014_off”, “on”:“material_27_boulanger_trapeze_2_8_dl__mt__fra_efixturetype__eft_headlight014_on”, “on_intense”:“material_27_boulanger_trapeze_2_8_dl__mt__fra_efixturetype__eft_headlight014_onIntense”},
This one willl make some light (no idea which one) light up with 30% intensity when the right turn signal is activated.
My problem with glowmaps was that when I activated a turn signal, the bulbs inside the headlights acted as turn signals, as the automation exporter automatically thought they were blinkers because of having changed their color to yellow.
So what I edited in glowmaps was delete it for those 4 headlight bulbs. Finding out what is their name on the .jbeam was a pain though, I tried a mixture of free camera + debug mode, and trial and error. I figured the lens flare would make them look good enough.
Then I also hunted down the glowmap for the light housings (as the exporter thinks they are actual lights) and deleted it too, as it made them turn white when the lights were on
Spotlight props
Spotlight props can be seen on the part of code I put at the beginning. These won’t make the fixtures themselves light up, but they allow them to cast light on other stuff, and show a lens flare.
Problem number 1: the headlight housings were emitting light. Again, had to use debug and trial and error to find these nodes and delete them. They have a name like “Light_491_-1993_706_d4ffeb00_1”. The numbers seem to be related to their coordinates in the car it seems, so the one on the other side of the car will probably have a similar name but with a coordinate with opposite sign once you’ve found the first.
Problem number 2: the headlight bulbs were emitting very faint white light (like all exported cars do). So I toyed around changing the values and trying what looked right.
For example, taking the exterior right light in my case: its node is called “Light_-638_-1958_715_d4ffeb00_0”.
When low beams are on, it will light up with an angle of -5º, a max range of 70m, a brightness of 68%, it will show a lens flare (I don’t think I changed the default value on this one), and it will light up with an RGB color of 255/186/0 that seems to be close enough to selective yellow.
When high beams are on, the angle is -2º, range 120m, brightness 95%, and the lens flare is larger.
Stuff like the light beam angle seem to be adjusted in the general settings before that.
For the left lights, I made them have a lower angle in low beams to avoid glaring other drivers. The headlights seem to be a bit too bright, I still have to toy around with the exact values but hopefully those can be a good starting point