zesterer / openmw-shaders

Photorealistic shaders for Morrowind
83 stars 7 forks source link

Sun flashing behind foliage #18

Closed Onyx47 closed 2 years ago

Onyx47 commented 2 years ago

Using shaders (default settings) the sun flashes as it passes behind foliage. See attached video.

https://user-images.githubusercontent.com/2098368/184554197-3f771ad9-fb30-4a35-9031-c49e5a2e2044.mp4

The problem is not present using default shaders. Using openmw I built today (commit 16922f80). Also using the volumetric clouds shader but turning that off doesn't impact the issue.

zesterer commented 2 years ago

That's very unusual and has not been reported by anybody else, so I'm inclined to assume that it's a driver issue. Perhaps try updating them?

Onyx47 commented 2 years ago

I'm using relatively up to date Nvidia 510.85.02 drivers on Debian Linux (no newer ones in the repo yet and I tend to stay away from their manual installer, it's a pain).

Either way, I just failed to notice earlier but it's a general z-buffer issue it seems, it also flashes over buildings and characters.

Here are the relevant settings I'm using:

[Shaders]
apply lighting to environment maps = true
auto use object normal maps = true
auto use object specular maps = true
auto use terrain normal maps = true
auto use terrain specular maps = true
lighting method = shaders
radial fog = true
light bounds multiplier = 2.2019
light fade start = 0.50235
max lights = 32
maximum light distance = 8192
minimum interior brightness = 0.19872
force per pixel lighting = true
clamp lighting = false
antialias alpha test = true

[Post Processing]
enabled = true
chain = clouds,fxaa
live reload = true

Might be a Linux + Nvidia problem or something else, I don't know, but if there's something else I can try to pinpoint the cause do tell me.

zesterer commented 2 years ago

Ah, right. Do you have reverse z enabled? I made sure it worked with both, but 95% of my testing was with reverse z enabled (and it's just objectively better anyway) so I recommend enabling that: https://openmw.readthedocs.io/en/latest/reference/modding/settings/camera.html#reverse-z

Onyx47 commented 2 years ago

I did not have it explicitly set (which should mean it was enabled according to docs), but I tried explicitly setting it to both true and false, made no difference either way.

AbduSharif commented 2 years ago

This happens because of a recent change missing here, that change is present in openmw shaders.

Onyx47 commented 2 years ago

Finally had a minute to take a look, this is the change in question, from what I saw you didn't touch that shader anyway so I just implemented those changes and it's all good now.

XC3N commented 2 years ago

Hello, I also have this problem (Win10 Geforce 1080ti driver 516.94)

modifying files/shaders/sky_fragment.glsl with the changes mentioned by @Onyx47 fixed it as well

zesterer commented 2 years ago

@Onyx47 @XC3N This issue should be fixed in the latest commit. Happy to reopen the issue if it's not, but I'm no longer observing it.