zesterer / openmw-shaders

Photorealistic shaders for Morrowind
80 stars 7 forks source link

Extremely dark shadows in interiors #26

Closed DieuDeGlace closed 1 year ago

DieuDeGlace commented 1 year ago

The title says it all really. I am seeings that in a lot of the interiors around seyda neen (and other buildings i have been to) have this weird shadow effect going on where it over darkens spots while leaving the rest of it untouched. increasing interior brightness does nothing against it and i know its the shaders as when i go back to the default openmw ones it doesn't exist. I love these shaders simply because of the water caustics and underwater stuff; however, interiors are buggy as all hell for me. I have installed the shaders to a custom resources folder and have the game directed to that. clamp lighting is off and force per pixel lighting is needed to be on otherwise the shaders dont work.

below is an image showing exactly what im talking about. As you can see the npc off to the right is borderline impossible to see. this effect happens in some corners of homes/buildings and some dwemer ruins are borderline hard to see around.

openmw 2022-10-18 00-43-32

zesterer commented 1 year ago

Do you have any errors in the console/logs when running the game?

jtuu commented 1 year ago

I ran into the same problem. Game looks normal with stock shaders but with these shaders some interiors are dark. Dark interiors include Vivec mages guild and Aldruhn mages guild. Balmora mages guild is not dark. I'm using OpenMW master a00382d6.

Log of starting a new game and teleporting into Vivec mages guild. No mods enabled. openmw.log

Sometimes there would be a warning like this, but not every time: Warning: detected OpenGL error 'invalid operation' at after RenderBin::draw(..)

jtuu commented 1 year ago

https://github.com/zesterer/openmw-shaders/blob/69097f8c43207812ad639cf29ce7eadbee62a46c/shaders/pbr.glsl#L168-L169

Pretty sure this line is the culprit. Changing it to 1.0 fixes the dark interiors, but then everything else looks wrong of course.

zesterer commented 1 year ago

Hmm. It would be nice to have a better way to determine this in the shaders. Perhaps I should request this from the OpenMW team.

DieuDeGlace commented 1 year ago

No error logs on my end, and like jtuu mentioned I noticed that it could be somewhat "fixed" with that line being modified. I'm unsure if it's a limitation of the OpenMW platform or if it's just shaders being shaders. I don't want to remove them because I love the water caustics and effects and cannot live without them at this point lol

zesterer commented 1 year ago

So the issue is that OpenMW doesn't currently pass any information to the shaders saying "We're indoors right now". Knowing when we're indoors is important, because it changes how "sunlight" (the original Morrowind had a very cursed form of sunlight indoors too) gets applied to the scene.

As a result, this line tries to guess whether we're indoors based on the angle of the sun and also how bright it is, because 90% of indoor scenes in Morrowind have a very specific setup for the sun.

Except, some break this trend. Like the Mage's Guild in Vivec. For some reason, its sunlight is slightly different: different enough that this line breaks.

The 'proper' solution would be to get OpenMW to just tell the shaders when we're indoors. I did this to solve a similar-ish issue for reflections in this MR. I'm probably not going to have the time to look into this for about a week though, sadly.

jtuu commented 1 year ago

Looks like this might be fixed now?

zesterer commented 1 year ago

It should be, yes. Happy to re-open if anybody else hits this issue again.

DieuDeGlace commented 1 year ago

could be doing something wrong, but it seems the issue still remains on my end? dont know if jtuu can also confirm it, but the same spots i pointed out are still suffering from the original issue.

zesterer commented 1 year ago

Are you using the latest release? And do you have the names of the exact locations?

DieuDeGlace commented 1 year ago

Yeah I'm on the latest openmw, using the latest shaders. I apologize for being so picky about this lol, but its noticed at the start of the game when you are in the office (at least for me), and the lighthouse. (both are in seyda neen so again this is me being nitpicky but I fear that its existence here means it will be the same in other places). Ill provide pictures below.

openmw 2023-01-05 21-45-58

openmw 2023-01-05 21-45-38

DieuDeGlace commented 1 year ago

i will check other spots previously mentioned to make sure.

DieuDeGlace commented 1 year ago

openmw.log here is the log file

DieuDeGlace commented 1 year ago

seems previously mentioned places are fine so its just these spots from what ive gathered. dont know if its cell dependent or something.

NaturalHalfling commented 6 months ago

I'm also getting this issue, in that office in seyda neen near the fire and also in the lighthouse, and that house in ald ruhn with the corpus in it, it's compeltely pitch black downstairs. Removing the shader has not fixed it nor has changing lighting methods (shader/compatibility/legacy) done anything but I am sure it must be something to do with it because it was not there before installing the shader.

Edit: It's from "force per pixel lighting = true", which I found out from another page explaining a mod called "let there be darkness" and one of the optios was "Disable dark (negative) lights" which is described as:

Morrowind sometimes uses "negative lights" to simulate darkness or shadow. Unfortunately, these negative lights look like ass with MGE XE's per pixel lighting enabled. To see what I mean, go to the Census and Excise office in Seyda Neen (the room with Socucius Ergalla) and look in the corner near the fireplace.

This feature terminates these negative lights from your game with extreme prejudice. By default it's on, and I recommend leaving it that way. However, if you're not using per pixel lighting for some reason (say, for performance reasons), this feature isn't as necessary, because negative lights don't look as bad without PPL

So I disabled it and it fixes it. But if also messes with the rest of the shader so I don't know if something could be done to negate the effect of having that option turned on or something. I haven't seen any mention of this anywhere from what I can see (not used to this website, I have searched though) so I hope it's helpful to someone experiencing this issue.

I tried to upload a photo to show the difference (see: the fireplace shadow), all settings the same with the shader implemented, only difference is the pixel per lighting is turned off. Hope it works and that it's alright. ShaderComparisonWithWithout_smaller - Copy