Page 1 of 3

Logarithmic Sun Intensity

Posted: Sun Jan 03, 2021 10:12 pm
by Freak2121
So, this is something that has been bugging me for a while, I just didn't know exactly how to describe it. The sun intensity curve in Daggerfall Unity, over the course of the day, is kinda bad. Mornings are unnaturally dark and gradually ramp up to peak brightness at noon, before falling off in the same manner. It's very jarring IMO. It's not because it's faulty or a bad curve or anything, technically it's correct, but it's just that it's mapping sun-intensity in a linear, 1:1 fashion. Human eyes, however, perceive brightness differences logarithmically. It's why the morning doesn't look very dark compared to noon, or why when you're indoors and look at a sunlit tree through your window, it doesn't appear literally 50 times brighter than your well lit room, even though it is.

Here's two graphs to show the difference:

Linear:
Image

Logarithmic:
Image

As you can see, with a linear light curve, it takes four hours under a linear curve to reach an apparent brightness which would only take 30 minutes under a logarithmic curve.
So, what I'm asking is, is it possible to implement a logarithmic light curve, and can anyone do it?

Re: Logarithmic Sun Intensity

Posted: Mon Jan 04, 2021 1:55 am
by l3lessed
Do we know where this is in the code? I know very little about this side of the engine. The lerping to create whatever curve we need for a natural sun rise, sun set light cycle is easy to do. I use lerping curves every where in my combat mods.

https://chicounity3d.wordpress.com/2014 ... ike-a-pro/

Re: Logarithmic Sun Intensity

Posted: Mon Jan 04, 2021 2:29 am
by Freak2121
It's right here.

Re: Logarithmic Sun Intensity

Posted: Mon Jan 04, 2021 3:54 am
by pango
Hi Freak2121,

Well, in theory should it matter, given you also look at the game thru your eyes?
But you don't only see DFU world, at the same time you also see the UI, not to mention everything else in your field of vision around your screen, so it's just that the model you suggest is not sufficient.

By the way, concerns about light curve have already been discussed elsewhere.

Re: Logarithmic Sun Intensity

Posted: Mon Jan 04, 2021 4:29 am
by Freak2121
pango wrote: Mon Jan 04, 2021 3:54 am Well, in theory should it matter, given you also look at the game thru your eyes?
In theory, yes. But I don't have an HDR display nor does the game support HDR, so one can't really rely on their eyes to naturally adjust. A standard display just doesn't have the range for it.
But you don't only see DFU world, at the same time you also see the UI, not to mention everything else in your field of vision around your screen, so it's just that the model you suggest is not sufficient.
I mean, even just setting the light curve like this is enough to get it the day-night transition looking natural, at least in my opinion.
Image
The sky and the world begins lighting up just before sunrise, and once the sun is up it quickly transitions to near-full brightness.
Implementing a new model of lighting might fix it in the future but there can be a pretty easy fix right at this moment. I just don't know how to make a such a mod for Unity.
By the way, concerns about light curve have already been discussed elsewhere.
That's good to know, thanks. :D

-

Posted: Mon Jan 04, 2021 6:55 pm
by Lokkrin Zhataros
-

Re: Logarithmic Sun Intensity

Posted: Mon Jan 04, 2021 7:04 pm
by pango
Lokkrin Zhataros wrote: Mon Jan 04, 2021 6:55 pm The issue I brought up in that topic has little to nothing to do with the light curve from Sunrise to Sunset. It was about the light 'intensity' at Peak Daylight during particular weather/time of day that in my opinion is unnaturally bright. So not related to this topic.
The point is different, but technically questions are related, and I think a lot of the answers are also shared: goal to match classic, move to linear colorspace that will require revisiting light curve in any case.

And as you said that may result in the need for a mod, if lighting can't both match classic (or close enough) and at the same time look natural enough to some players.

-

Posted: Mon Jan 04, 2021 7:27 pm
by Lokkrin Zhataros
-

Re: Logarithmic Sun Intensity

Posted: Mon Jan 04, 2021 8:42 pm
by King of Worms
Mods or ingame options:
Daylight curve - classic/advanced (with tooltip explanation when you hover cursor over it)

Re: Logarithmic Sun Intensity

Posted: Tue Jan 05, 2021 11:35 am
by Interkarma
DFU's daylight curve is not linear. It's a hand-tuned curve to try and match classic's brightness peaks in morning and afternoon as closely as possible. Below is the curve used ingame. It has a sharper ramp up and down in morning and afternoon, and a more gradual curve during middle of day. This curve is found in SunlightManager component on Exterior/SunlightRig/SunLight object.

It would be a rather easy curve to change by a mod if anyone wants to. :)

daylight-curve.jpg
daylight-curve.jpg (130.83 KiB) Viewed 1142 times