LightmapUtil v6
A command-line program to help find lightmapped faces that can be improved
A simple command line utility to tell you if your lightmaps are too high resolution (and maybe more soon?)
If you don't include the ".bsp" in the input (i.e.
The program also will accept any file as long as it is actually a valid source engine map file, for example, if you use CompilePal and have the repacked and unpacked map, you can run
Please note that this program is very naive! It has no clue what your map actually looks like, and only checks how similar one lightmap sample on a face is to another one! It doesn't take into account the texture on a face, or how high or low the contrast of the light actually looks to the human eye.
Because of this, I highly recommend not blindly listening to the program, and instead just using it as a way to find faces which might be able to be improved.
Note: map files currently must be uncompressed. If they are compressed, the bspzip utility included in source engine games can be used to decompress maps using a command like
The program also accepts the following launch arguments:
The source code for this program can be found on github: https://github.com/treacherousfiend/LightmapUtil
Usage
The program can be run withLightmapUtil.exe filename.bsp
. This generates a filename-LightmapUtilLog.txt that provides you with details about lightmapping on that map file.If you don't include the ".bsp" in the input (i.e.
LightmapUtil.exe filename
, the program will search for one and read it if it is there.The program also will accept any file as long as it is actually a valid source engine map file, for example, if you use CompilePal and have the repacked and unpacked map, you can run
LightmapUtil.exe filename.bsp.unpacked
and it will work just finePlease note that this program is very naive! It has no clue what your map actually looks like, and only checks how similar one lightmap sample on a face is to another one! It doesn't take into account the texture on a face, or how high or low the contrast of the light actually looks to the human eye.
Because of this, I highly recommend not blindly listening to the program, and instead just using it as a way to find faces which might be able to be improved.
Note: map files currently must be uncompressed. If they are compressed, the bspzip utility included in source engine games can be used to decompress maps using a command like
bspzip -repack filename.bsp
The program also accepts the following launch arguments:
- -h / -help - Same as opening the program without inputting a bsp file, shows all launch arguments
- -v / -verbose - Show some additional debug info, and output info to the command prompt as well as the txt file
- -logfile LOGFILE - (replace LOGFILE with a filepath) Set the location of the logfile, default is in the same folder as the input bsp
- -qualitythreshold 0-1 - Set a custom threshold percentage for lightmap sample similarity, accepts percentages as decimals from 0-1 (Default is 0.03).
- -usenormals - Output the face's normal coordinates instead of general directions (i.e. "face 1 facing north" becomes "face 1 facing 0 1 0)
- -ldr - Only read LDR lightmaps even if map was compiled with both LDR and HDR lightmaps
- -hdr - Only read HDR lightmaps even if map was compiled with both LDR and HDR lightmaps
The source code for this program can be found on github: https://github.com/treacherousfiend/LightmapUtil
- License
- Free to use and modify. Credit is appreciated but not required.