Logarithmic Sun Intensity

Talk about the mods you'd like to see in Daggerfall Unity. Give mod creators some ideas!
User avatar
Freak2121
Posts: 60
Joined: Fri Sep 08, 2017 6:14 am

Logarithmic Sun Intensity

Post 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?

l3lessed
Posts: 1403
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Logarithmic Sun Intensity

Post 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/
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

User avatar
Freak2121
Posts: 60
Joined: Fri Sep 08, 2017 6:14 am

Re: Logarithmic Sun Intensity

Post by Freak2121 »

It's right here.

User avatar
pango
Posts: 3357
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Logarithmic Sun Intensity

Post 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.
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
Freak2121
Posts: 60
Joined: Fri Sep 08, 2017 6:14 am

Re: Logarithmic Sun Intensity

Post 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

Lokkrin Zhataros
Posts: 256
Joined: Thu Nov 21, 2019 9:27 pm

-

Post by Lokkrin Zhataros »

-
Last edited by Lokkrin Zhataros on Wed May 26, 2021 3:15 am, edited 2 times in total.

User avatar
pango
Posts: 3357
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Logarithmic Sun Intensity

Post 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.
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

Lokkrin Zhataros
Posts: 256
Joined: Thu Nov 21, 2019 9:27 pm

-

Post by Lokkrin Zhataros »

-
Last edited by Lokkrin Zhataros on Wed May 26, 2021 3:15 am, edited 2 times in total.

User avatar
King of Worms
Posts: 4752
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Logarithmic Sun Intensity

Post by King of Worms »

Mods or ingame options:
Daylight curve - classic/advanced (with tooltip explanation when you hover cursor over it)

User avatar
Interkarma
Posts: 7242
Joined: Sun Mar 22, 2015 1:51 am

Re: Logarithmic Sun Intensity

Post 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 1126 times

Post Reply