BVE WorldWide
Would you like to react to this message? Create an account in a few clicks or log in to continue.

A tool to fix daytime/nighttime texture related lighting issues

3 posters

Go down

A tool to fix daytime/nighttime texture related lighting issues Empty A tool to fix daytime/nighttime texture related lighting issues

Post by zbx1425 Wed Sep 09, 2020 1:38 pm

After a discussion with @LXQt, I made a tool to automatically fix the problem raised by the recent change in lighting behaviour with the same texture defined for both daytime and nighttime. (https://github.com/leezer3/OpenBVE/wiki/Errata#lighting-behaviour-with-the-same-texture-defined-for-both-daytime-and-nighttime)
This tool can batch-process CSV and B3D models, while detecting and patching this issue by automatically removing duplicate textures and introducing emissive color commands.

This tool can certainly help developers adapt their models to the new standard, because manually modifying all the models is time-consuming, but it can be done fully automatically with this tool.
Since it is a third-party tool that assists in fixing the problem, I would personally recommend listing this tool on the Errata wiki page.

The tool can be downloaded at https://www.zbx1425.tk/nautilus/daynightfix.html.
A tool to fix daytime/nighttime texture related lighting issues Daynightfix
zbx1425
zbx1425

Posts : 143
Join date : 2017-08-18
Location : China

https://www.zbx1425.cn

Midnight Express Ginga81 likes this post

Back to top Go down

A tool to fix daytime/nighttime texture related lighting issues Empty Re: A tool to fix daytime/nighttime texture related lighting issues

Post by leezer3 Wed Sep 09, 2020 1:43 pm

Linked from the errata note.

I'd appreciate it if you also added a brief English description to your page as it's all in Chinese at the minute Smile

leezer3

Posts : 1959
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

A tool to fix daytime/nighttime texture related lighting issues Empty Re: A tool to fix daytime/nighttime texture related lighting issues

Post by zbx1425 Wed Sep 09, 2020 1:46 pm

leezer3 wrote:Linked from the errata note.

I'd appreciate it if you also added a brief English description to your page as it's all in Chinese at the minute Smile
Will do that later. Thanks!
zbx1425
zbx1425

Posts : 143
Join date : 2017-08-18
Location : China

https://www.zbx1425.cn

Back to top Go down

A tool to fix daytime/nighttime texture related lighting issues Empty Re: A tool to fix daytime/nighttime texture related lighting issues

Post by S520 Wed Sep 09, 2020 3:55 pm

I think it's a great tool.

Howerver, this issue is not limited to specifying the same thing.
This issue occurs even when different textures are specified for Daytime and Nighttime.
https://github.com/leezer3/OpenBVE/issues/490
https://github.com/leezer3/OpenBVE/issues/480#issuecomment-627630431

The errata text should be corrected.


Last edited by S520 on Wed Sep 09, 2020 3:59 pm; edited 1 time in total (Reason for editing : Add a link of the issue)
S520
S520

Posts : 113
Join date : 2018-08-24
Location : Japan

https://github.com/s520

leezer3 likes this post

Back to top Go down

A tool to fix daytime/nighttime texture related lighting issues Empty Re: A tool to fix daytime/nighttime texture related lighting issues

Post by leezer3 Wed Sep 09, 2020 3:57 pm

The text was right, the title wasn't, now corrected.

leezer3

Posts : 1959
Join date : 2011-08-23

http://www.bvecornwall.co.uk

S520 likes this post

Back to top Go down

A tool to fix daytime/nighttime texture related lighting issues Empty Re: A tool to fix daytime/nighttime texture related lighting issues

Post by S520 Wed Sep 09, 2020 4:00 pm

Thanks!
S520
S520

Posts : 113
Join date : 2018-08-24
Location : Japan

https://github.com/s520

Back to top Go down

A tool to fix daytime/nighttime texture related lighting issues Empty Re: A tool to fix daytime/nighttime texture related lighting issues

Post by zbx1425 Thu Sep 10, 2020 11:44 am

leezer3 wrote:The text was right, the title wasn't, now corrected.
So if I understood it correctly, to get the lighting working in the same (buggy) way as before, pure white EmmisiveColor has to be applied not only to faces with the same day/night texture, but actually all faces that used a nighttime texture.

So, to achieve the same legacy effect, the following code
Code:
......
LoadTexture, day.png, night.png
should be changed into
Code:
......
SetEmissiveColor, 255, 255, 255
LoadTexture, day.png, night.png
instead of preserved as-is. Is that the case?

Also, to achieve the same legacy effect, should the following code
Code:
......
LoadTexture, day.png, day.png
be changed into
Code:
......
SetEmissiveColor, 255, 255, 255
LoadTexture, day.png
or
Code:
......
SetEmissiveColor, 255, 255, 255
LoadTexture, day.png, day.png
?
zbx1425
zbx1425

Posts : 143
Join date : 2017-08-18
Location : China

https://www.zbx1425.cn

Back to top Go down

A tool to fix daytime/nighttime texture related lighting issues Empty Re: A tool to fix daytime/nighttime texture related lighting issues

Post by leezer3 Thu Sep 10, 2020 12:26 pm

Correct.

We originally thought it was *just* identical textures (which were the vast majority of the observed effect), but it's actually all Sad

leezer3

Posts : 1959
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

A tool to fix daytime/nighttime texture related lighting issues Empty Re: A tool to fix daytime/nighttime texture related lighting issues

Post by zbx1425 Thu Sep 10, 2020 12:27 pm

leezer3 wrote:Correct.

We originally thought it was *just* identical textures (which were the vast majority of the observed effect), but it's actually all Sad
Thanks!

As for the second question, is there a visible difference between them?
Code:
SetEmissiveColor, 255, 255, 255
LoadTexture, day.png

SetEmissiveColor, 255, 255, 255
LoadTexture, day.png, day.png
If there is, which one represents the legacy behavior better?
zbx1425
zbx1425

Posts : 143
Join date : 2017-08-18
Location : China

https://www.zbx1425.cn

Back to top Go down

A tool to fix daytime/nighttime texture related lighting issues Empty Re: A tool to fix daytime/nighttime texture related lighting issues

Post by leezer3 Thu Sep 10, 2020 5:14 pm

No difference.

leezer3

Posts : 1959
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

A tool to fix daytime/nighttime texture related lighting issues Empty Re: A tool to fix daytime/nighttime texture related lighting issues

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum