View Issue Details

IDProjectCategoryView StatusLast Update
0005867The Dark ModGraphicspublic30.11.2025 14:24
Reporterstgatilov Assigned Tostgatilov  
PrioritynormalSeverityfeatureReproducibilityN/A
Status feedbackResolutionopen 
Product VersionTDM 2.10 
Target VersionTDM 2.14 
Summary0005867: Try to support interactions on projected decals
DescriptionIt turns out that decals generated dynamically (e.g. blood splats) go through simplified processing in renderer frontend:
    // add the lightweight decal surfaces
    for ( idRenderModelDecal *decal = def.decals; decal; decal = decal->Next() ) {
        decal->AddDecalDrawSurf( vEntity );
    }
Most importantly, interactions are not generated for them.
It makes it impossible to apply bumpmapping to them.

Maybe we can change that...
Additional InformationInternal discussion:
  https://forums.thedarkmod.com/index.php?/topic/21214-normalmaps-for-temporary-decals/
TagsNo tags attached.

Relationships

related to 0005868 resolvedstgatilov Interactions rendering with polygonOffset 

Activities

stgatilov

stgatilov

04.11.2023 08:22

administrator   ~0016161

I currently see two ways:

1) Enable interactions for the current decals (idRenderModelDecal, which is actually not derived from idRenderModel).
The problem here is that interactions will be cached as part of interactions with the owner entity, which is usually static.
So one has to hack frontend to force regeneration of interactions with owner whenever that is a decal on it.

2) For every decal, create a separate idRenderEntityLocal which represents it.
This involves some lifetime management (store links, delete decal REs when owner RE dies).
But then frontend should work out of the box, and interactions too (basically everything should).
The model should probably be DM_CONTINUOUS, so that it can regenerate alpha every frame.
This might also be more costly performance-wise...
stgatilov

stgatilov

27.11.2025 11:26

administrator   ~0017080

Here are some generic changes:
  r11021 Renamed idRenderModelDecal -> idDecalOnRenderModel, idRenderModelOverlay -> idOverlayOnRenderModel.
  r11022 Optimized Bvh build slightly.
  r11023 For two-sided material with interactions, make sure to set ID for duplicated surfaces.
The last fix is quite critical: I won't be surprised if previously two-sided material randomly stopped working.

And here is the implementation of the feature:
  r11024 Implemented projected decals which can generate interactions.
  r11025 Force using decal models with interactions by default.

As of now, the new decal system is force on by default.
If we discover some issue with it, we'll use both system depending on material flag.
If not, then I guess material flag "forceInteractions" should be deleted.
stgatilov

stgatilov

30.11.2025 14:24

administrator   ~0017081

The crashes on start were noticed in Written in Stone.
Both on Linux and on Windows + Sanitizer.

Here are two fixes which make the mission stable with Sanitizer:
  r11027 Fixed bug of iterating over area references while being modified.
  r11029 Handle mirrored vertexes properly in reusing cached decal model.
And a bit of refactoring:
  r11026 Tiny refactor of local variables.
  r11028 Instead of flag geometryHasChanged, deleted cachedDynamicModel to make sure it's not reused.

Issue History

Date Modified Username Field Change
04.01.2022 03:25 stgatilov New Issue
04.01.2022 03:30 stgatilov Relationship added related to 0005868
15.11.2022 04:42 nbohr1more Target Version TDM 2.11 => TDM 2.12
04.11.2023 08:22 stgatilov Note Added: 0016161
05.12.2023 01:21 nbohr1more Target Version TDM 2.12 => TDM 2.13
08.01.2025 02:17 nbohr1more Target Version TDM 2.13 => TDM 2.14
27.11.2025 11:23 stgatilov Assigned To => stgatilov
27.11.2025 11:23 stgatilov Status new => assigned
27.11.2025 11:26 stgatilov Note Added: 0017080
27.11.2025 12:01 stgatilov Status assigned => feedback
30.11.2025 14:24 stgatilov Note Added: 0017081