Fix lighting issues on self-illuminating faces

© Zbx1425
转载请注明链接 Please link to this page when redistributing


There is a severe error in v1.2, please do not use.


What is this tool for?

由于 OpenBVE的一个长期存在,但最近被修复了的Bug,CSV/B3D模型中同时指定了日间和夜间材质的所有面会在低光照下常亮。由于该Bug已经存在了很长一段时间,许多作者误将其作为特性来使用,致使此Bug修复时大量列车车内光照效果失效。手动大量修改代码十分麻烦,本工具可批量自动处理含有问题的模型,以协助作者迅速适配最新版本。

Because of a long present but recently fixed bug in OpenBVE, all faces applied with both Daytime and Nighttime texture will become self-illuminating at low brightness. As this bug has been around for quite a long time, many developers considered it a feature and misused it, causing the interior lighting effect of lots of trains to fail when the bug is fixed. Since manually modifying all the models is time-consuming, this tool is developed to batch-process models with such problem, in order to help developers adapt their models to the new standard.

下载 v1.3

Download v1.3


Detailed info about the aforementioned bug


In the older versions of OpenBVE, using a LoadTexture instruction like this will make the faces self-illuminating:

LoadTexture, TrainInterior.png, TrainInterior.png

但是这个写法其实是错误的,这个常亮的效果上述长期存在的Bug凑巧导致的。现在由于该Bug已被修复,此写法在新版OpenBVE里也已不再有效 (除非打开 Enable hacks for buggy older content)。现在要想使一个面常亮,正确的写法是:

But this usage is actually incorrect, and the self-illuminating effect achieved by it is caused by the aforementioned bug. Since the bug is fixed now, it will no longer achieve the same effect in the newer versions of OpenBVE (unless "Enable hacks for buggy older content" is turned on). The correct way to make faces self-illuminating is:

LoadTexture, TrainInterior.png
SetEmissiveColor, 255, 255, 255



  1. 打开软件,用顶部按钮选择需要处理的文件。可以单独选取文件,也可以扫描文件夹内容。
    点击选中中央列表框,按 Insert/I 及 Ctrl+Insert/Ctrl+I 快捷键也可以选取文件。按 Delete 可以从列表中去除文件。
  2. (如果您比较有信心可跳过) 按底部 Test Run 按钮,软件将从选中的文件中检出存在问题的模型。"Good" 表示该模型没有问题,不会被处理;"Will Fix" 表示该模型存在错误,将会被修改。由于软件会直接在原文件上动手,请确认将被修改的文件是否都是您想要的。
  3. 如果您非常在意您模型文件的安全,建议您备份一下。然后按底部 Start 按钮,开始自动修复所有存在错误的模型。
  4. 看到写有 "Done" 的对话框即可进入游戏测试效果了。
  1. After starting the tool, you can use the buttons on the top to select the files to process. You can select individual files or scan all models in a folder.
    You can also picked files with Insert/I and Ctrl+Insert/Ctrl+I after focusing the center listview. Press Delete to remove files from the listview.
    It may take a while to scan a folder.
  2. (Skip this if you are confident) Press the "Test Run" button, and models with problems will be detected. "Good" means the model will not be touched, while "Will Fix" indicates the model will get modified. Since the tool will directly modify the input files, please make sure the files to be modified is what you want.
  3. Making a backup is recommended if your files are critical. Then press the "Start" button, and the files will get patched automatically.
  4. A dialog with the word "Done" indicates the process is complete, and you can test it out now.



本软件使用了@yinyue200 移植的 Mozilla Universal Charset Detector

Mozilla Universal Charset Detector for .Net Standard by @yinyue200 is used in this program.