View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0006076||The Dark Mod||Graphics||public||21.08.2022 15:40||28.11.2022 21:14|
|Product Version||TDM 2.10|
|Target Version||TDM 2.11||Fixed in Version||TDM 2.11|
|Summary||0006076: Optimize soft stencil shadows limit expensive sampling for near-penumbra regions|
|Description||Right now when user enables soft stencil shadows, expensive stencil + depth sampling is performed for all fragment of the surfaces being rendered.|
Most of the surfaces are fully lit of fully unlit and far enough from penumbra, so if we can detect such state, we can cull away this expensive sampling.
The idea is to divide screen into "tiles", and for each tile precompute if it only has "lit" or "unlit" values.
Then pass this tile texture into interaction shader, sample it there. If it says 0.0 or 1.0, then just use this value and avoid sampling.
Note that in order to make it work, we need hard upper bound on sampling radius in screen pixels.
Luckily, the original implementation of soft stencil shadows already have one.
|Additional Information||Internal discussion:|
|Tags||No tags attached.|
Committed in svn rev 10107.
Enabled by cvar r_softShadowsMipmaps: but only for stencil shadows, and only with new backend.
And interesting thing is that we now have a file used both from C++ and GLSL.
It's called tdm_shadowstencilsoft_shared.glsl and contains just a tiny function.
But this is first precedent, and I think such usage will increase in future.
It seems that this optimization is not always good.
Even though filling tiled mipmaps takes only 20 us, it causes performance degradation when there are many shadow-casting lights.
Attached Tracy view of single frame on New Job (on street near tavern entrance).
Newjob_TiledScencilShadows.png (286,828 bytes)
|A small shader compiler fix for Linux+AMD driver in svn rev 10140.|
|r10160. Fixed bug in idImage::GenerateAttachment.|
|Screen-shots in stencil mode are currently black when this feature is enabled.|
|Screen-shot issue fixed with Rev 10187|
|21.08.2022 15:40||stgatilov||New Issue|
|21.08.2022 15:40||stgatilov||Status||new => assigned|
|21.08.2022 15:40||stgatilov||Assigned To||=> stgatilov|
|03.09.2022 09:39||stgatilov||Note Added: 0015223|
|03.09.2022 09:39||stgatilov||File Added: Newjob_TiledScencilShadows.png|
|03.09.2022 09:39||stgatilov||Status||assigned => resolved|
|03.09.2022 09:39||stgatilov||Resolution||open => fixed|
|03.09.2022 09:39||stgatilov||Fixed in Version||=> TDM 2.11|
|24.10.2022 20:20||stgatilov||Note Added: 0015351|
|18.11.2022 21:16||stgatilov||Note Added: 0015450|
|28.11.2022 15:44||nbohr1more||Note Added: 0015497|
|28.11.2022 21:14||nbohr1more||Note Added: 0015503|