Skip to content

How to find (or add) a mesh to use for an indicator light

Snark edited this page Nov 5, 2016 · 6 revisions

For IndicatorLights to work, there must be a mesh somewhere on the object that has an emissive material.

  • The mesh might be a built-in, "native" piece of the part itself.
  • Or the mesh might be something that's added via ModuleManager config.

If you're using an existing "native" mesh on a part

Then there's nothing to do! It's already good to go.

If you're using ModuleManager to add a mesh to a part

If you're adding a mesh via ModuleManager, it could be your own, or you could use one of the meshes (.mu files) that's included in the Meshes folder of IndicatorLights.

Here's an example of adding a mesh via ModuleManager config, from IndicatorLights' patch to the Z400 battery:

@PART[ksp_r_largeBatteryPack] {
    // ...
    MODEL
    {
        model = IndicatorLights/Meshes/nubbinLamp
        position = 0, 0.292, -0.139
        rotation = -90, 0, 0
    }
}

If you're using Blender and Unity to create your own meshes, a few tips about what works well for indicator lights:

  • You must have an emissive shader for your mesh's material.
  • Note, not the "unlit" shader, such as the one used for the green LED on the stock Z100 battery. "Unlit" is different from "emissive".
  • Recommended: KSP/emissive/diffuse shader, not KSP/emissive/specular.
    • You may be tempted to use the specular, i.e. "my light is made of glossy material!"
    • However, what ends up happening is that the light gets a bright highlight from reflected light, with the result that the indicator light is hard to see when in sunlight.
  • Recommended: Pick a fairly dark color for the diffuse color of your material. White = bad.
    • Again, the reason is that a brightly-diffuse-colored material (i.e. its "native" color when the light is turned off) makes it hard to see the light in the daytime.
    • It doesn't have to be black-- but try to keep it to a dim gray, at most.

You can have lots of them

Note that you're not limited to just one mesh for indicator lights on a part. You can have as many as you want.

The ModuleControllableEmissive guide, coming up next, goes into detail about how to wire up multiple meshes.

Help! I'm making a part and I don't know what mesh name to use in the config!

The IndicatorLights debug console command can help you. It lets you examine, in-game, what the names of all the meshes on your part are, so you can use the appropriate string in your config.

What next?

After you've got your mesh ready, you'll want to set up a ModuleControllableEmissive to point at it.