Odd/Incorrect Lighting on Meshes

Support for running, installing or compiling OpenMW

Before you submit a bug report for the first time, please read: Bug reporting guidelines
User avatar
Mistahtokyo
Posts: 118
Joined: 07 Sep 2013, 18:31

Odd/Incorrect Lighting on Meshes

Post by Mistahtokyo » 28 Feb 2019, 17:07

Hello, I came across this issue while testing some atlased textures, but came to realize the problem seemed inherent to OpenMW. There are visible lighting differences between adjacent meshes whether they're atlased or not. The vanilla Morrowind rendering engine and textures do have seams, but not nearly as visible. The lighting is much more even across the meshes too. Is this an OpenMW issue? Asset issue? Something else entirely? Below are some comparison shots.

Vanilla Screenshot:
Image

OpenMW Screenshot:
Image

Notice how, on OpenMW, the left mesh (top right corner area) is brighter than the adjacent mesh, resulting in the seam popping out considerably.

User avatar
AnyOldName3
Posts: 1456
Joined: 26 Nov 2015, 03:25

Re: Odd/Incorrect Lighting on Meshes

Post by AnyOldName3 » 28 Feb 2019, 17:50

Huh.

Just to make comparisons easier, can you try and get a pair of screenshots from the exact same angle?

My first guess would be that maybe OpenMW and the vanilla engine are using different approaches to determine which lights get used for which objects, and in OpenMW, the two wall pieces are assigned different lights. I know Skyrim only applies up to four lights per object, and OpenMW does eight, so it's possible that vanilla Morrowind is only doing four and that's where the discrepancy comes from, but with either system, a light significant enough to make that big a difference should be used.

I guess some good questions to ask are:
  • Are you forcing shaders?
  • What other shader settings do you have (such as clamp lighting)?
  • What OpenMW version are you using?
  • Are you definitely using the same meshes in both cases?
AnyOldName3, Master of Shadows

User avatar
Capostrophic
Posts: 616
Joined: 22 Feb 2016, 20:32

Re: Odd/Incorrect Lighting on Meshes

Post by Capostrophic » 28 Feb 2019, 17:58

I'll answer the questions myself.

1. Using either fixed function or shader pipelines doesn't make a difference.
2. Lighting clamping doesn't make a difference either, and this happens on both per-pixel and per-vertex lighting.
3. master. At least I do.
4. This happens with the vanilla meshes.

User avatar
Mistahtokyo
Posts: 118
Joined: 07 Sep 2013, 18:31

Re: Odd/Incorrect Lighting on Meshes

Post by Mistahtokyo » 28 Feb 2019, 18:02

This happens regardless of angle. Only files loaded were Morrowind and the expansions. Nothing else. I enabled and disabled shadows. Enabled and disabled the "force per pixel lighting" and "clamp" options. Still having the issue.

User avatar
AnyOldName3
Posts: 1456
Joined: 26 Nov 2015, 03:25

Re: Odd/Incorrect Lighting on Meshes

Post by AnyOldName3 » 28 Feb 2019, 18:09

What happens if /resources/shaders/lighting.glsl is edited so at the top it says #define MAX_LIGHTS 4 instead of 8 (and also force shaders in enabled - this obviously won't make a difference without shaders being in use)? If it's due to light selection, the issue should be gone with MAX_LIGHTS as 1, and there should be a value where it looks the same as vanilla Morrowind.
AnyOldName3, Master of Shadows

User avatar
Capostrophic
Posts: 616
Joined: 22 Feb 2016, 20:32

Re: Odd/Incorrect Lighting on Meshes

Post by Capostrophic » 28 Feb 2019, 18:14

Changing the light source limit doesn't make a difference even if the sun is the only light source present.

User avatar
Mistahtokyo
Posts: 118
Joined: 07 Sep 2013, 18:31

Re: Odd/Incorrect Lighting on Meshes

Post by Mistahtokyo » 28 Feb 2019, 18:19

Both comparisons were taking using clear weather with no nearby lights. Any ideas as to what could be causing the difference? Just a fundamental difference in how Morrowind and OpenMW calculate lighting?

User avatar
AnyOldName3
Posts: 1456
Joined: 26 Nov 2015, 03:25

Re: Odd/Incorrect Lighting on Meshes

Post by AnyOldName3 » 28 Feb 2019, 18:38

When fixed-function mode is used, OpenMW and Morrowind are supposed to have identical lighting (as, IIRC, vanilla Morrowind uses DX8's fixed-function lighting, which should be identical to OpenGL's, but this is hard to google). When clamp lighting is on, our shaders and fixed-function mode are supposed to have identical lighting. I'm not really sure what's going on to make them different.
AnyOldName3, Master of Shadows

User avatar
wareya
Posts: 335
Joined: 09 May 2015, 13:07

Re: Odd/Incorrect Lighting on Meshes

Post by wareya » 28 Feb 2019, 22:16

Are the normals on these models normalized to a length of 1.0?
paying attention to #1751 #2473 #3609 #3862/#3929 #3807 #4297 #4623

User avatar
Mistahtokyo
Posts: 118
Joined: 07 Sep 2013, 18:31

Re: Odd/Incorrect Lighting on Meshes

Post by Mistahtokyo » 01 Mar 2019, 02:06

Both examples used unedited vanilla textures so I do not know how normal maps could be the issue.

Post Reply