View Issue Details

IDProjectCategoryView StatusLast Update
0005880The Dark ModCodingpublic05.01.2023 22:13
Reporterstgatilov Assigned Tostgatilov  
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Product VersionTDM 2.10 
Target VersionTDM 2.11Fixed in VersionTDM 2.11 
Summary0005880: Shadow maps backend should use shadow surfaces
DescriptionRight now:
  shadow maps backend renders all light surfaces into shadow maps.
  stencil backend renders shadow surfaces into shadow maps.
The way stencil does it is much better, because frontend can decide what should cast shadows and should not.
The way shadow maps do that, either backend has to decide when to cast shadows and when not (it does not have much information for that), or all surfaces must be shadow-casting.

Of course, the shadow surfaces for stencil lights contains geometry of "shadow volume", which totally different from the geometry of the object.
For shadow maps, these shadow surfaces should usually contain the same geometry as in the light surfaces.
Of course, one must ensure that this geometry is not duplicated in vertex cache, i.e. the same data should be reused.
However, we should still create shadow geometry struct, pass it, and use it properly in backend.
TagsNo tags attached.

Relationships

related to 0005189 assignedstgatilov noshadows mask spawnarg for shadows optimization 

Activities

stgatilov

stgatilov

25.07.2022 20:12

administrator   ~0015074

Done:
  r10037 Create shadow surfaces in interaction in shadow maps mode (usually same as light tris).
  r10038 Removed DSF_SHADOW_MAP_IGNORE and DSF_SHADOW_MAP_ONLY.

Aside from that, I looked at all r_shadows references, and replaced most of them with check against "shadows" member of viewLight or idRenderLightLocal.
This should simplify mixing two shadows implementations in the future (e.g. force shadow maps for volumetric lights?)
stgatilov

stgatilov

25.07.2022 20:33

administrator   ~0015075

And found one more case of forcing stuff simply because of shadow maps:
  r10039 Don't force ambient surfaces when shadow maps mode is enabled.
stgatilov

stgatilov

26.07.2022 19:48

administrator   ~0015076

One more place with dependency on global cvar fixed:
  r10040 Don't block assigning shadow map pages by r_shadows cvar.

All of this allowed to force shadow maps for lights with volumetrics in stencil shadows mode =)
stgatilov

stgatilov

05.01.2023 22:13

administrator   ~0015704

Some more commits here:
  r10234 Some kind of fix in old backend multi-light code?
  r10235 Deleted R_HasVisibleShadows and its usages to fix performance regression on r_shadowMapSinglePass.

The last one fixes performance issue with unofficial "single pass shadow maps".
It used to force ambient surfaces for offscreen shadow casters, along with a flag of course which is already removed.

Issue History

Date Modified Username Field Change
13.01.2022 15:30 stgatilov New Issue
13.01.2022 15:30 stgatilov Status new => assigned
13.01.2022 15:30 stgatilov Assigned To => stgatilov
25.07.2022 18:02 stgatilov Relationship added related to 0005189
25.07.2022 19:56 stgatilov Status assigned => resolved
25.07.2022 19:56 stgatilov Resolution open => fixed
25.07.2022 19:56 stgatilov Fixed in Version => TDM 2.11
25.07.2022 20:12 stgatilov Note Added: 0015074
25.07.2022 20:33 stgatilov Note Added: 0015075
26.07.2022 19:48 stgatilov Note Added: 0015076
05.01.2023 22:13 stgatilov Note Added: 0015704