DayNightFix

修复自发光表面显示问题

Fix lighting issues on self-illuminating faces

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

v1.2版存在严重问题,请勿使用。

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

关于上述Bug的详细说明

Detailed info about the aforementioned bug

在OpenBVE的老版本里,这样写LoadTexture指令能使面保持常亮:

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

CreateMeshBuilder
......
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:

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

使用说明

Instructions

  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.

致谢

Acknowledgements

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

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

Changelog