Lumination (.lum) Files


Lumination files, also known as .lum files are used by Medal of Honor Pacific Assault to define which lightmaps are used for what models, and to define the point lights in the scene. Lumination files are in xml format, and may be generated by mohradiant�s lightmap program.If none of the models in your level have light map materials such as �default lit lightmap� then a .lum file will not be created by radiant. Instead, the game will use the same planar projection lightmaps that are used for the terrain for the placed 3D models. The reason why you would want mohradiant to generate lightmaps specific to a model is because it may not look good with the planar projection light maps used for the terrain. One example of this may be a building where the walls are not lit correctly because the planer projection lightmaps map the entire wall to a single line in the lightmap.


Since .lum files are typically generated for you by mohradiant, the only reason you need to know about the .lum format is to place point lights in the scene. The only light that is automatically placed in the scene by mohradiant is the sun. If you want additional lights you will need to add them manually to the .lum file. If no .lum file exists, you will need to create one and save it in the proper place. Fortunately .lum files are fairly simple to understand so this isn�t too difficult. One thing to keep in mind is that if you re-run your lighting with mohradiant�s light mapping (bsp_lightmap) there is a chance that the .lum file will get overwritten. Therefore when you edit a .lum file, it�s probably a good idea to keep a copy around, so that you can restore your edits after mohradiant has created a new .lum file.


Medal of Honor Pacific Assault will look for the .lum files in the same folder as your maps .bsp file. That means it will typically be in your mod�s �maps� folder or �maps\dm� folder. Here is an example of a .lum file:



<PERSISTENT class="LuminationFile" id="d9ec010">

����� <PROP name="m_MaterialOverrides" type="PersistentList">

����������� <PERSISTENT class="InstanceMaterialOverride" id="f9b8ce0">

����������������� <PROP name="material_name" type="emb_string">"2 - Default"</PROP>

����������������� <PROP name="texture_name"����� type="emb_string">"textures/Lightmaps/1_1_c2/camp/floor.tga"</PROP>

����������������� <PROP name="texture_stage" type="emb_string">"light"</PROP>

����������������� <PROP name="unique_id" type="int">1536</PROP>

����������� </PERSISTENT>

����� </PROP>

����� <PROP name="m_PointLights" type="PersistentList">

����������� <PERSISTENT class="PPointLight" id="d9ee420">

����������������� <PROP name="m_Color" type="VECTOR4">0.9 0.0 0.0 0</PROP>

����������������� <PROP name="m_Falloff" type="float">356.6</PROP>

����������������� <PROP name="m_Intensity" type="float">0.9</PROP>

����������������� <PROP name="m_Position" type="VECTOR3">-4149.0 101.0 0.0</PROP>

����������� </PERSISTENT>

����� </PROP>




If you aren�t familiar with xml format there are several good sources for learning about it, here is one good resource:

Fortunately, editing .lum files won�t require too much knowledge of xml.


If you look at the second line of the .lum example, you can see that the PROP node has a name attribute. In this case it is �m_MaterialOverrides�. This type of node is a list of instances of material overides which describe the lightmaps for some of the models in the level. Instances nodes are called �PERSISTENT� and have the class attribute �InstanceMaterialOverride�. Notice that they also contain nodes for describing the material name, the lightmap texture name, the texture stage (for multitexturing) and the unique ID. The unique_id node refers to an object�s unique ID which is how lightmaps get mapped to individual models. As mentioned earlier, you should never need to change the material overrides since mohradiant generates this information for you when it creates lightmaps for models.


Another kind of PROP node in .lum files has the name attribute �m_PointLights�. It�s more intereresting than material overrides because we can use this node type to add point lights to the level. As with material overides, m_PointLights is a list of instances, in this case the PERSISTANT class is �PPointLight�.PPointLights have four PROP nodes associated with them. The first is the �m_Color� node which is a 4 element vector describing the color of the light, with RGB values from 0 to 1. The fourth element can be left 0, since light color is just an RGB value. Then next node is the �m_Falloff� node which specifies how many game units away from the point light, the light will have an effect. Objects outside the falloff radius will not be lit by the point light.The �m_Intensity� node describes, in values from 0 to 1, how bright the light is. The last PPointLight node is the �m_Position� node, and as the name suggests it specifies the x,y,z coordinates of the point light. These coordinates are the same units used by mohradiant, so you can use mohradiant to determine what coordinates to use for the light. In the example above, the m_PointLights list contains one red point light with a falloff of 356.6 units and an intensity of 0.9 located at (-4149, 101, 0) in the level.