night rendering with eye adaptation

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
User avatar
trad_emark
Inserter
Inserter
Posts: 27
Joined: Fri Sep 23, 2016 8:54 pm
Contact:

night rendering with eye adaptation

Post by trad_emark »

TL;DR
Use eye adaptation algorithm to make the game better visible during night.

What ?
Human eye consists of receptors of two types: rods (tyčinky) and cones (čípky).
Rods are responsible for brightness and are active all day, but especially useful at night.
Cones are responsible for colors and are active at day only.
Eye adaptation is process where rods become more activated and cones suppressed (day to night transition) and vice-versa.
The result is that rendering night scene is not about reducing brightness.
Instead, in computer graphics, night scenes are usually rendered with:
- desaturated colors
- hue shift towards blue
- sharper lights/shadows

I made a quick test with a screenshot (note that the final results could be made much better):
factorio-2.png
factorio-2.png (611.84 KiB) Viewed 1494 times
vs.
factorio-1.png
factorio-1.png (779.66 KiB) Viewed 1494 times

Eye adaptation is usually made with a luminance-gather pass, where luminance is averaged over the whole screen, than weighted with luminance from previous frame and finally it is applied to the color buffer as a desaturation and hue shift. The weighting is asymmetric, bright-to-dark adaptation takes up to 20 minutes IRL and dark-to-bright takes 2 to 5 minutes.

In factorio, the luminance-gather pass could probably be replaced with estimation based on the number of currently active lights in current scene.

Why ?
Factorio is not a horror game and day-night cycle is minor game mechanic, therefore it should not stand in the way of general playability.

quyxkh
Smart Inserter
Smart Inserter
Posts: 1028
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: night rendering with eye adaptation

Post by quyxkh »

Combining this with implicit moon phases could be pretty cool, nights slowly cycle between your-eyes-adapt-pretty-well to you-can't-see-past-your-headlamp ... and "they mostly come at night" would get a hell of a lot scarier.

User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 2420
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: night rendering with eye adaptation

Post by BlueTemplar »

Interesting, I don't think I've ever seen a game with a hue shift towards blue at night, and it was my understanding that we tend to perceive the rod "color" as just luminance (grey) ?

Sharper lights/shadows sounds great !

Note that this has already been discussed several times in the FFFs, but in the relation to the Nightvision equipment - it seems like you would want to remove it completely ?
BobDiggity (mod-scenario-pack)

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: night rendering with eye adaptation

Post by darkfrei »

How about science packs on the belts? They are have same color, somewhere between white and blue.

User avatar
trad_emark
Inserter
Inserter
Posts: 27
Joined: Fri Sep 23, 2016 8:54 pm
Contact:

Re: night rendering with eye adaptation

Post by trad_emark »

BlueTemplar wrote:
Sat Feb 16, 2019 9:32 am
Interesting, I don't think I've ever seen a game with a hue shift towards blue at night, and it was my understanding that we tend to perceive the rod "color" as just luminance (grey) ?
The hue shift is very slight IRL so most games ignore it entirely. I have mentioned it for the sake of completeness.
Note, the colors are desaturated (turned gray) but not entirely. It should also have a slow transition, so the hue shift might be more apparent during those phases?
BlueTemplar wrote:
Sat Feb 16, 2019 9:32 am
Note that this has already been discussed several times in the FFFs, but in the relation to the Nightvision equipment - it seems like you would want to remove it completely ?
I do not have a strong opinion about the night vision equipment apart from that it is not available at the beginning of the game.
quyxkh wrote:
Fri Feb 15, 2019 9:43 pm
Combining this with implicit moon phases could be pretty cool, nights slowly cycle between your-eyes-adapt-pretty-well to you-can't-see-past-your-headlamp ... and "they mostly come at night" would get a hell of a lot scarier.
It could probably be made controllable by mods :D
And the night vision equipment would actually benefit the player during the dark-moon phase.

Post Reply

Return to “Ideas and Suggestions”