Possible issue with shadow edge resolution?

Support for running, installing or compiling OpenMW

Before you submit a bug report for the first time, please read: Bug reporting guidelines
Time4Tea
Posts: 110
Joined: 01 Jan 2020, 00:27

Possible issue with shadow edge resolution?

Post by Time4Tea » 14 Apr 2020, 22:29

Hi, recently I've noticed something odd about the edges of shadows. The resolution of the shadow edges seems to change, depending on the viewing angle. For example, for the same shadow edge, from one angle it looks very sharp and crisp, but if I turn the camera a bit (without even moving the player), at some angles, the resolution of the edge becomes very low and pixellated. I only started noticing it recently, so I'm not 100% sure if something has changed or I just hadn't noticed it before. As far as I can tell, it seems to happen with all shadow edges.

I am using version 0.46.0 on Linux. My shadow settings are as follows:

Code: Select all

[Shadows]
actor shadows = false
enable shadows = true
object shadows = true
terrain shadows = true
shadow fade start = 0.7

maximum shadow map distance = 5000
I can try to take some screenshots, if it would help.

User avatar
akortunov
Posts: 760
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Re: Possible issue with shadow edge resolution?

Post by akortunov » 15 Apr 2020, 05:49

A default "shadow map resolution = 1024" is not enough for object and terran shadows.

Time4Tea
Posts: 110
Joined: 01 Jan 2020, 00:27

Re: Possible issue with shadow edge resolution?

Post by Time4Tea » 15 Apr 2020, 13:16

akortunov wrote:
15 Apr 2020, 05:49
A default "shadow map resolution = 1024" is not enough for object and terran shadows.
That might be the case, but I don't see how it would explain the behavior I am seeing, where the shadow edge resolution changes drastically depending on the camera orientation. I will take a couple of screenshots to show you what I mean.

I.e. if the shadow resolution is too low, shouldn't all the edges look bad, regardless of the camera orientation?

Time4Tea
Posts: 110
Joined: 01 Jan 2020, 00:27

Re: Possible issue with shadow edge resolution?

Post by Time4Tea » 15 Apr 2020, 13:45

Screenshots:

Here, you can see on the shadows in front of me - the edges look nice and sharp:

Image

Here, all I have done is turn the camera to the left, without moving the player, and the same edges are now much more 'blocky':

Image
Last edited by Time4Tea on 20 Apr 2020, 22:26, edited 6 times in total.

User avatar
akortunov
Posts: 760
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Re: Possible issue with shadow edge resolution?

Post by akortunov » 15 Apr 2020, 14:21

Time4Tea wrote:
15 Apr 2020, 13:16
shadow edge resolution changes drastically depending on the camera orientation.
It is a drawback of used shadowing approach (and it can be seen in many other games as well), and there is not much we can do here.
By the way, your screenshots are seems to be malformed.

Time4Tea
Posts: 110
Joined: 01 Jan 2020, 00:27

Re: Possible issue with shadow edge resolution?

Post by Time4Tea » 15 Apr 2020, 14:57

akortunov wrote:
15 Apr 2020, 14:21
By the way, your screenshots are seems to be malformed.
Yeah. I'm trying to add them as attachments, but they don't seem to be uploading properly, for some reason ...

(update: should be sorted now)
Last edited by Time4Tea on 20 Apr 2020, 22:26, edited 1 time in total.

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

Re: Possible issue with shadow edge resolution?

Post by AnyOldName3 » 16 Apr 2020, 01:29

If your 1024x1024 shadow map was spread over the whole of Vvardenfell, each texel would be several metres across, and shadows would look absolutely awful. Instead, it's focused so it just includes what's currently visible. That means that if your camera is pointed such that more things are in the viewing frustum (even if they're behind other things), your shadow maps will be stretched over more area, and the texels will end up bigger.
AnyOldName3, Master of Shadows

Time4Tea
Posts: 110
Joined: 01 Jan 2020, 00:27

Re: Possible issue with shadow edge resolution?

Post by Time4Tea » 16 Apr 2020, 12:42

AnyOldName3 wrote:
16 Apr 2020, 01:29
If your 1024x1024 shadow map was spread over the whole of Vvardenfell, each texel would be several metres across, and shadows would look absolutely awful. Instead, it's focused so it just includes what's currently visible. That means that if your camera is pointed such that more things are in the viewing frustum (even if they're behind other things), your shadow maps will be stretched over more area, and the texels will end up bigger.
Ok, so the camera orientations with lower shadow resolution should coincide with more drawables, if I check the profiler? I will try a higher resolution and see if it helps.

Hang on ... so that shadow resoluton of 1024x1024 refers to the entire shadow map as a whole, not each object?

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

Re: Possible issue with shadow edge resolution?

Post by AnyOldName3 » 16 Apr 2020, 15:13

Yeah, you don't have enough VRAM for 24 bits times 1024 times 1024 per drawable. That would be ludicrous.
AnyOldName3, Master of Shadows

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

Re: Possible issue with shadow edge resolution?

Post by Mistahtokyo » 16 Apr 2020, 16:11

Are there any other shadowing approaches that value consistency more? The transition from smooth to jagged is rather jarring unless you seriously bump up the resolution.

Post Reply