View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004938||The Dark Mod||Graphics||public||01.01.2019 11:37||22.01.2019 22:52|
|Product Version||TDM 2.07|
|Target Version||TDM 2.07||Fixed in Version||TDM 2.07|
|Summary||0004938: Shadow maps: some lights are still not soft|
|Description||With shadow maps and soft shadows, not all shadows are actually soft.|
|Steps To Reproduce||0) Set Shadows to "Maps" and set positive soft shadows quality/radius.|
1) Load Arena FM.
2) Go to the Arena.
3) Notice that some lights are completely hard.
|Tags||No tags attached.|
Another example is a tiny "Swing" mission.
As soon as you get outdoors, you see the shadow of the whole construction on the surrounding mountains. It is soft with Stencil shadows, and perfectly hard with Maps shadows.
It strikes me that there are probably one or two issues at hand here.
Lights over the "r_maxShadowMapLight" cvar value are rendered as Stencil Shadows with no softening.
Parallel lights are rendered as Stencil Shadows with no softening.
If we want to cover both these "pathological" cases, we probably should apply
some small uniform amount of softening in both these scenarios rather than
distance based softening which breaks down for such large volumes.
Reminder sent to: duzenko
Can we still target this at 2.07?
Reminder sent to: stgatilov
2.07 or 2.08?
I'm afraid I don't understand the problem well enough to say if this is suitable for 2.07.
Is it true that the main difficulty lies in the fact the stencil texture does not exist in Maps case, so soft stencil shadows cannot be done?
It looks like a flag missing in a branch condition
Function name is pointInteractionProgram_t::UpdateUniforms but it might be more than just that one
|If you think it's a comparatively quick fix, implement it and we can then review it to see if it should be included in 2.07 or not. Otherwise, best leave it for 2.08, although I would really like Maps to be as feature-complete as possible in 2.07.|
training_mission_2019-01-18_00.47.21.jpg (1,103,503 bytes)
|I don't know what type of light it is, but there is also no soft shadow in the training mission at the bow shooting area.|
|At revision: 7920|
|Sorry, we are not there, yet. I have tested Flakebridge Monastery and Training Mission, both show the same behavior. It looks as if there is some softening going on, but the hard edged shadow map is rendered atop of that. Furthermore, the Softness slider seems to be ineffective in these cases (which may be by design, now that I think about it). I have uploaded comparison screenshots with SoftShadows "Off" and SoftShadows "Very High" for illustration.|
training_mission_rev7920_SoftOff.jpg (379,274 bytes)
training_mission_rev7920_SoftVeryHigh.jpg (380,740 bytes)
|Attached is how it looks to me|
Untitled.jpg (506,161 bytes)
The training map is a pretty bad test case.
With contact hardening shadows, the closer you are to a surface the harder the shadows.
The arrows are VERY close to the table...
@duzenko: I retested now and can verify that the behavior is dependent on anti aliasing. Enable it, and you see what I'm seeing. Disable it, shadows look like they should.
@NBohr: That's supposedly a parallel light there, so the shadows should revert to stencil + uniform softening, right?
Yes, I believe if that's a parallel light, we want uniform softening unless
Duzenko has developed some different cure to the issue like scaling down the size
of parallel light distances or some other fudge that makes them work better?
I guess the same would apply to oversized lights. There would either need to be a uniform value or fudge factors.
"In Remembrance of Him" kinda points to a number of edge cases where this is
working vs breaking down...
When I first started the mission, I did notice the big parallel skylight shadows
on the buildings had some sort of softening going on. Even with AA enabled.
I then zoomed in for a closer look and noticed that the shadows became pretty close to hard edged when really close to the wall.
Changing the soft shadow quality from medium to high hardened the shadow
All these effects sorta make sense if you have a hard-coded number of pixels for
softening regardless of distances (which was what I suggested as a solution).
I guess we might either need to increase that hard-coded amount or change it
depending on quality setting? Higher quality > larger sampling disk?
I also see the same good softening with Stencil and with Maps + AA off.
With Maps + AA on, the hard shadow becomes apparent.
I tried changing the softening in shader with Maps + AA on, and I believe that for some reason two shadows are drawn: one is completely hard and one is soft.
Or more likely problem is that the rendered shadow is soft, but stencil test is not disabled, so the inner part of the shadow gets completely black.
Attached two screenshots with interaction color hardcoded to 50%-white.
In remembrance_maps_noaa.jpg, the shadow is softened properly. In remembrance_maps_aa.jpg, the inner half of the shadow boundary is cut out.
remembrance_maps_aa.jpg (559,788 bytes)
remembrance_maps_noaa.jpg (565,394 bytes)
|At revision: 7921|
Fix confirmed on both Training Mission and Flakebridge Monastery. Thanks!
By the way, auto for booleans?? ;-P
auto stencilPath = r_shadows.GetInteger() == 1 || backEnd.vLight->tooBigForShadowMaps;
|People say that the more of "auto" you use, the harder it is to read the code =)|
Call me Automan LOL
Being a C++ noob I am entitled to put auto's everywhere
I believe this change caused r_shadowMapSinglePass to crash:
|At revision: 7926|
|01.01.2019 11:37||stgatilov||New Issue|
|01.01.2019 11:37||stgatilov||Status||new => assigned|
|01.01.2019 11:37||stgatilov||Assigned To||=> duzenko|
|02.01.2019 11:12||stgatilov||Note Added: 0011218|
|02.01.2019 13:54||nbohr1more||Note Added: 0011221|
|02.01.2019 13:55||nbohr1more||Note Edited: 0011221||View Revisions|
|17.01.2019 11:09||STiFU||Note Added: 0011382|
|17.01.2019 12:03||duzenko||Note Added: 0011387|
|17.01.2019 12:17||stgatilov||Note Added: 0011389|
|17.01.2019 15:33||duzenko||Note Added: 0011395|
|17.01.2019 15:40||STiFU||Note Added: 0011398|
|17.01.2019 23:51||STiFU||File Added: training_mission_2019-01-18_00.47.21.jpg|
|17.01.2019 23:52||STiFU||Note Added: 0011401|
|18.01.2019 13:10||duzenko||Note Added: 0011407|
|18.01.2019 13:10||duzenko||Status||assigned => resolved|
|18.01.2019 13:10||duzenko||Fixed in Version||=> SVN|
|18.01.2019 13:10||duzenko||Resolution||open => fixed|
|18.01.2019 14:22||STiFU||Note Added: 0011409|
|18.01.2019 14:22||STiFU||Status||resolved => assigned|
|18.01.2019 14:22||STiFU||Resolution||fixed => reopened|
|18.01.2019 14:22||STiFU||File Added: training_mission_rev7920_SoftOff.jpg|
|18.01.2019 14:22||STiFU||File Added: training_mission_rev7920_SoftVeryHigh.jpg|
|18.01.2019 15:48||duzenko||Note Added: 0011413|
|18.01.2019 15:48||duzenko||File Added: Untitled.jpg|
|18.01.2019 15:59||nbohr1more||Note Added: 0011414|
|18.01.2019 16:00||nbohr1more||Note Edited: 0011414||View Revisions|
|18.01.2019 16:12||STiFU||Note Added: 0011415|
|18.01.2019 16:30||nbohr1more||Note Added: 0011416|
|18.01.2019 16:31||nbohr1more||Note Edited: 0011416||View Revisions|
|19.01.2019 05:06||nbohr1more||Note Added: 0011419|
|19.01.2019 05:54||stgatilov||Note Added: 0011420|
|19.01.2019 05:55||stgatilov||File Added: remembrance_maps_aa.jpg|
|19.01.2019 05:55||stgatilov||File Added: remembrance_maps_noaa.jpg|
|19.01.2019 05:56||stgatilov||Note Edited: 0011420||View Revisions|
|19.01.2019 08:56||duzenko||Note Added: 0011426|
|19.01.2019 08:56||duzenko||Status||assigned => resolved|
|19.01.2019 08:56||duzenko||Resolution||reopened => fixed|
|19.01.2019 13:05||STiFU||Note Added: 0011431|
|19.01.2019 13:53||stgatilov||Note Added: 0011432|
|19.01.2019 14:16||duzenko||Note Added: 0011433|
|19.01.2019 14:18||duzenko||Note Edited: 0011433||View Revisions|
|20.01.2019 09:23||stgatilov||Fixed in Version||SVN => TDM 2.07|
|20.01.2019 09:23||stgatilov||Target Version||=> TDM 2.07|
|20.01.2019 21:35||nbohr1more||Note Added: 0011449|
|21.01.2019 09:53||duzenko||Note Added: 0011462|
|22.01.2019 22:52||nbohr1more||Note Edited: 0011221||View Revisions|