Shadows
Re: Shadows
You guys, nightlies and releases are what testing are for. If it's "too much work" to merge into 0.45, fine. And if code needs to be reviewed before it gets merged, fine. But please, no one is going to test it while it is sitting in an unmerged branch. Let's get this show on the road already.
- Capostrophic
- Posts: 794
- Joined: 22 Feb 2016, 20:32
Re: Shadows
The engine is still suffering from pathfinding PR being merged way too early for no reason, plz no.
Re: Shadows
First of all, a big thanks to AnyOldName3 for continuing to knock Shadows into shape. I tested a recent artifact while copying arkortunov's settings. What follows is a list of observations I didn't notice in AnyOldName3's list of issues.
Good news: I've been unable to reproduce the performance drop I had reported in certain bad-weather areas in earlier builds. Areas like Dagoth Ur now appear to run just fine, with no extraordinary framerate dips.
Now onto the rest... (click to view)
Good news: I've been unable to reproduce the performance drop I had reported in certain bad-weather areas in earlier builds. Areas like Dagoth Ur now appear to run just fine, with no extraordinary framerate dips.
Now onto the rest... (click to view)
- Spoiler: Show
Re: Shadows
One problem I'm getting testing with the latest build artifact that I haven't seen talked about is some objects getting a light-coloured lip at their bases at night:
Apart from that I'd say they work great 90% of the time, with the other 10% being jags and sawtooth effects to varying degrees of ugliness.
- faerietree
- Posts: 14
- Joined: 14 Aug 2018, 19:33
- Contact:
Re: Shadows
Nice testing.
Regarding the 10% of zig zag shadows, I don't consider the most recently posted image necessarily ugly. In nature a bark f.e. is rough and shadows also aren't perfect all the times, they are quite blurry. Of course this is only one screeny and the effect may be worse on others.
If performance is better the way it is now or if it is overwhelming, then I'd say 90% perfection is good enough. Let's not overdo it.
Regarding the 10% of zig zag shadows, I don't consider the most recently posted image necessarily ugly. In nature a bark f.e. is rough and shadows also aren't perfect all the times, they are quite blurry. Of course this is only one screeny and the effect may be worse on others.
If performance is better the way it is now or if it is overwhelming, then I'd say 90% perfection is good enough. Let's not overdo it.
Re: Shadows
Sawtooth artifacts on shadows are just going to happen with this type of shadowcasting method, stop looking at them and look at the other issues IMO. Edge filtering can be added after everything else is known to function properly.
- AnyOldName3
- Posts: 2685
- Joined: 26 Nov 2015, 03:25
Re: Shadows
That doesn't look like it's supposed to happen. Can I get a save game right there along with your settings (not just shadow settings as stuff like view distance makes a difference, too).Some strange behavior at extreme sunset angles. Note the area roughly where the soldiers are as the camera moves around.
https://streamable.com/fc7dw
Known. Sort of deliberate, too - the refraction camera uses a different view matrix and there'd be work involved with working out how to convert between the two coordinate spaces. It's a good candidate for a follow-up PR.Underwater shadows only appear in the underwater view.
https://streamable.com/jhx9d
Normals don't actually affect shadows at all. The thing that would make a difference would be a height map, and we don't have one of those for the water. It's maybe something that could be done in the future, but it might be pretty complex in practice.The shadow itself is unaffected by the water normals, which looks especially strange in choppy conditions.
https://imgur.com/m4Om94K
I've been considering alleviating this by adding a setting to control the maximum distance that shadows can be from the camera. This is pretty much how modern games with long view distances manage to do it (although sometimes they have prebaked lighting to fill in the gaps). Nothing else can really help except significantly increasing the shadow map resolution (which, in my testing, hasn't actually had a massive performance hit).It's well known that looking towards or away from the sun decimates the shadow quality. A high view distance + distant terrain makes this even more dramatic.
https://streamable.com/xd64t
And its especially noticeable effect on distant objects, such as the trees behind the fort in this before and after:
https://imgur.com/8WA0BGs
https://imgur.com/Lep52lk
These viewing angles are very common during play, and view distance is certain to be increased by future players, so I expect this to remain a conspicuous issue.
That's bad. Can you get me an APITrace of it being broken, please? There should be a thread somewhere explaining how. Maybe testing with an artefact from before normal offset shadows got merged, too, as that's the only thing I've done recently that might have broken it, and I'd have expected someone to have reported this already if it's been broken for a long time.Turning off shadows appears to break the water shader.
https://streamable.com/0s382 (shadows off)
https://streamable.com/l5i4w (shadows on)
Shadows basically require a whole extra rendering pass for each shadow map containing everything that might end up casting a shadow into the map. Even in modern games, that's a lot of extra work, and Morrowind's assets aren't especially amenable to being drawn efficiently when there are more than a few of them at once.Regarding that last video, I can't help but comment on the ruinous increase in draw time with shadows enabled. I appreciate that shadows are rather costly, but going from what was an average of 100+ fps in this scene to below 60 seems unusually severe. It also appears to make the fans of my GTX 970 spin up more than Skyrim SE, which is a first for OpenMW in my testing. I hope the subject of performance continues to be examined, as it feels like there's more to be discovered.
Do you know when this started? Has it been an issue for a while?One problem I'm getting testing with the latest build artifact that I haven't seen talked about is some objects getting a light-coloured lip at their bases at night:
At you end, this can be lessened with a higher shadow map resolution. In other games, there are two main solutions that actually ever get used.Zig-zags, pixels and general blockyness
The first is Percentage Closer Filtering. Basically, you do the shadow depth test on lots of nearby texels. GLSL 1.2 (what OpenMW uses) only provides a nice way of doing this for the closest 4 texels, and we already do this. Doing more is possible, but it will also make places where the shadows are already sharp look blurry.
The second is Variance Shadow Maps where as well as having a depth map, you have a depth squared map (both of which can be scaled and filtered like any other texture) and then you can work out the variance of the depth in the shrunken map and therefore estimate what ratio of samples would pass the depth test. Unfortunately, it has some major artefacts which look very bad. I've looked into it a little recently, and am beginning to think that these are more easily surpressed than I initially thought.
Either way, these are both things for a follow-up PR if ever.
Re: Shadows
Save FileAnyOldName3 wrote: ↑02 Feb 2019, 19:50That doesn't look like it's supposed to happen. Can I get a save game right there along with your settings (not just shadow settings as stuff like view distance makes a difference, too).Some strange behavior at extreme sunset angles. Note the area roughly where the soldiers are as the camera moves around.
https://streamable.com/fc7dw
Settings.cfg
I'll add that I could not reproduce this on older build artifacts.
It might be worth examining bzzt's MR on GitLab, as it appears he's got it working.Known. Sort of deliberate, too - the refraction camera uses a different view matrix and there'd be work involved with working out how to convert between the two coordinate spaces. It's a good candidate for a follow-up PR.Underwater shadows only appear in the underwater view.
https://streamable.com/jhx9d
I would hate to lose distant shadows. Is that really the only proper solution to alleviate this? Even in games where shadows can be several kilometers away (Star Citizen comes to mind), I can't think of an instance where shadows behave like this. Shouldn't we see at least a hint of this behavior in other games?I've been considering alleviating this by adding a setting to control the maximum distance that shadows can be from the camera. This is pretty much how modern games with long view distances manage to do it (although sometimes they have prebaked lighting to fill in the gaps). Nothing else can really help except significantly increasing the shadow map resolution (which, in my testing, hasn't actually had a massive performance hit).
I'll see if I can figure out APITrace. For now I can say it doesn't break like this on my pre-normal offset artifacts.That's bad. Can you get me an APITrace of it being broken, please? There should be a thread somewhere explaining how. Maybe testing with an artefact from before normal offset shadows got merged, too, as that's the only thing I've done recently that might have broken it, and I'd have expected someone to have reported this already if it's been broken for a long time.Turning off shadows appears to break the water shader.
https://streamable.com/0s382 (shadows off)
https://streamable.com/l5i4w (shadows on)
As far as assets go, I'm using Morrowind Optimization Patch and Project Atlas to be as draw-efficient as possible, though it's still not enough to maintain 60fps in all areas even at vanilla viewing distance. I'd like to hold out hope the situation can improve in the future, engine-side as well as assets.Shadows basically require a whole extra rendering pass for each shadow map containing everything that might end up casting a shadow into the map. Even in modern games, that's a lot of extra work, and Morrowind's assets aren't especially amenable to being drawn efficiently when there are more than a few of them at once.
Possibly because the sun is casting shadows through the ground at night. This also did not occur in older artifacts.Do you know when this started? Has it been an issue for a while?One problem I'm getting testing with the latest build artifact that I haven't seen talked about is some objects getting a light-coloured lip at their bases at night:
- AnyOldName3
- Posts: 2685
- Joined: 26 Nov 2015, 03:25
Re: Shadows
Have you made any progress with this?CMAugust wrote: ↑03 Feb 2019, 03:01I'll see if I can figure out APITrace. For now I can say it doesn't break like this on my pre-normal offset artifacts.That's bad. Can you get me an APITrace of it being broken, please? There should be a thread somewhere explaining how. Maybe testing with an artefact from before normal offset shadows got merged, too, as that's the only thing I've done recently that might have broken it, and I'd have expected someone to have reported this already if it's been broken for a long time.Turning off shadows appears to break the water shader.
https://streamable.com/0s382 (shadows off)
https://streamable.com/l5i4w (shadows on)
Are you 100% sure the casting through stuff at night is new? I've been seeing weird nighttime shadows since the very beginning. The only way I can think it might have changed would be if someone else changed the path light zero takes at night so it goes in a loop (as I think it might have been doing something else before) and this change only got into a recent artefact because I merged upstream changes.Possibly because the sun is casting shadows through the ground at night. This also did not occur in older artifacts.Do you know when this started? Has it been an issue for a while?One problem I'm getting testing with the latest build artifact that I haven't seen talked about is some objects getting a light-coloured lip at their bases at night:
Re: Shadows
I tested Shadows PR with the settings "enable shadows = false" and "enable shadows = true", and neither breaks the water for me. With shadows enabled, I can confirm the light artefacts below or at the base of the object, moving as the sun moves, likely the sun casting shadows through the ground.
edit: Tested right before commit 9b92943 Don't rely exclusively on a shadow map when out of its depth range.
edit: Tested right before commit 9b92943 Don't rely exclusively on a shadow map when out of its depth range.