Diagnosing Morrowind light pop-in

General discussion regarding the OpenMW project.
For technical support, please use the Support subforum.
CMAugust
Posts: 285
Joined: 10 Jan 2016, 00:13

Diagnosing Morrowind light pop-in

Post by CMAugust »

Ever walk around with a torch or light spell at night and observe objects "pop" to a different brightness as you approach? The effect can be made more blatant or more subtle by tweaking light attenuation settings in the ini, but can never be eliminated completely. Note that this is different from the OpenGL limit of 8 lights that affects certain areas in OpenMW (that's another story); the attenuation issue is just as prevalent in vanilla. It's not a concern in later games like Oblivion and Skyrim. The question is: why?

After identifying exactly what's going on under the hood, it will be clearer to pinpoint where the blame lies - engine-side, content side, or both - and devise a solution that will squash this annoying quirk once and for all.
User avatar
akortunov
Posts: 899
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Re: Diagnosing Morrowind light pop-in

Post by akortunov »

I suppose it is because we apply lighting for whole objects (IIRC, Morrowind behaves in the similar way).
User avatar
AnyOldName3
Posts: 2668
Joined: 26 Nov 2015, 03:25

Re: Diagnosing Morrowind light pop-in

Post by AnyOldName3 »

As discussed on Discord when CMAugust did some investigating (and correct me if I'm wrong about this), the point at which lights pop in can be made further away by increasing the light's radius, but the pop-in is still very pronounced. I'm guessing that the attenuation settings or brightness are scaled by the radius or something like that, so making the light affect things further away doesn't mean that it's already faded out by the time it's hitting something at the limit of its range.

I think (but don't think it was clear) that some testing was done where the attenuation settings were swapped from mostly linear to entirely quadratic, and that barely helped.

Ideally, the radius of lights and their attenuation model should be set up such that an object at the limit of a light's radius should receive imperceptibly little illumination so that you don't notice it suddenly going away when the threshold is crossed. Quadratic attenuation kind of does a reasonable job of this, and is how light works in real life, but because Morrowind's lighting system isn't gamma-correct, this looks weird.
CMAugust
Posts: 285
Joined: 10 Jan 2016, 00:13

Re: Diagnosing Morrowind light pop-in

Post by CMAugust »

Searching the Internet, I haven't been able to find any in-depth discussion on Morrowind's lighting quirk, and more importantly how Oblivion/Fallout3/Skyrim's implementation nullified it. I'm afraid the technical particulars are a bit above my head, but if there's anything I can accomplish through basic testing let me know.
User avatar
AnyOldName3
Posts: 2668
Joined: 26 Nov 2015, 03:25

Re: Diagnosing Morrowind light pop-in

Post by AnyOldName3 »

I guess the first thing that would help that I don't know is what options are exposed for a light in both Nif files and the editor.
CMAugust
Posts: 285
Joined: 10 Jan 2016, 00:13

Re: Diagnosing Morrowind light pop-in

Post by CMAugust »

Right, that's something I'll check when I get home – unless someone beats me to it.
CMAugust
Posts: 285
Joined: 10 Jan 2016, 00:13

Re: Diagnosing Morrowind light pop-in

Post by CMAugust »

I can't find any options for lights in the .nif files themselves, so I think lights are only handled and attached to objects in the editor. Someone familiar with nif could probably say for sure. The following are screens from the TES Construction Set showing the options for any given light, both standalone and when attached to an object. For curiosity's sake, the equivalent options for Oblivion and Skyrim lights are here too.

Morrowind Constuction Set:
Spoiler: Show
Oblivion Construction Set:
Spoiler: Show
Skyrim Creation Kit:
Spoiler: Show
Oblivion has light attenuation preferences in its ini, which I'm including here in case it's useful:
Spoiler: Show
User avatar
AnyOldName3
Posts: 2668
Joined: 26 Nov 2015, 03:25

Re: Diagnosing Morrowind light pop-in

Post by AnyOldName3 »

Okay, so there's only one radius setting and no brightness multiplier, so I'm guessing that it's just scaling the attenuation or brightness based on radius, and they're using a different multiplier in Oblivion so that the light has faded more at the limit of its radius.
User avatar
AnyOldName3
Posts: 2668
Joined: 26 Nov 2015, 03:25

Re: Diagnosing Morrowind light pop-in

Post by AnyOldName3 »

Does changing the radius change how brightly things near a light get lit?
Chris
Posts: 1625
Joined: 04 Sep 2011, 08:33

Re: Diagnosing Morrowind light pop-in

Post by Chris »

One other thing with Oblivion is it uses per-pixel lighting, unlike Morrowind which uses per-vertex (same as OpenMW by default). Per-vertex lighting can cause a light to brighten a surface more drastically, especially with larger polygons since it uses linear blending between vertices, which can make pop-in more apparent.

Oblivion also has a design constraint of not allowing more than a couple hand-placed lights hit an object. You still can have more, but IIRC it will do additional render passes on an object if it exceeds the number of lights its shaders handle (which tanks framerate, hence the design constraint).
Post Reply