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 »

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: 899
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Re: Possible issue with shadow edge resolution?

Post by akortunov »

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 »

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 »

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: 899
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Re: Possible issue with shadow edge resolution?

Post by akortunov »

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 »

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: 2674
Joined: 26 Nov 2015, 03:25

Re: Possible issue with shadow edge resolution?

Post by AnyOldName3 »

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.
Time4Tea
Posts: 110
Joined: 01 Jan 2020, 00:27

Re: Possible issue with shadow edge resolution?

Post by Time4Tea »

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: 2674
Joined: 26 Nov 2015, 03:25

Re: Possible issue with shadow edge resolution?

Post by AnyOldName3 »

Yeah, you don't have enough VRAM for 24 bits times 1024 times 1024 per drawable. That would be ludicrous.
User avatar
Mistahtokyo
Posts: 139
Joined: 07 Sep 2013, 18:31

Re: Possible issue with shadow edge resolution?

Post by Mistahtokyo »

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