View Issue Details

IDProjectCategoryView StatusLast Update
0005325The Dark ModGraphicspublic04.01.2022 14:21
ReporterGeep Assigned Tostgatilov  
PrioritynormalSeveritynormalReproducibilityhave not tried
Status resolvedResolutionfixed 
OSWindows 10 
Product VersionTDM 2.08 
Target VersionTDM 2.10Fixed in VersionTDM 2.10 
Summary0005325: New error reported about texture stain01b_s
DescriptionDuring dmap processing of worldspawn, this error appears under 2.08:
WARNING:Couldn't load image: makeIntensity( textures/decals/stain01b_s)

The map in question used stain01b and stain01bwet. But even after replacing those with other textures, the error persisted.

This was traced to the distributed tdm_decals_dirt.mtr, material "stain01bwet", which includes the map call in question. Perhaps it should be "makeintensity(...)" (all lower case) or, more likely "makealpha(...)", or stain01b_s texture file is bad.

Also, tdm_legacy_dirt.mtr, material "stain01bwet" also has the same problematic call. These are the only 2 places where a material definition uses "MakeIntensity".
Steps To ReproduceI don't know if this error appears in all maps under 2.08. In any event, you should be able to see it if you create a decal with stain01bwet. Unless this is specific to my graphics chip/driver, which I doubt.
TagsNo tags attached.

Relationships

related to 0005781 resolvedstgatilov Image programs don't work with DDS source files. 
related to 0005868 resolvedstgatilov Interactions rendering with polygonOffset 
child of 0005044 resolvedstgatilov Adjusting specular RGB in material stages fails under enhanced interaction shader 

Activities

VanishedOne

VanishedOne

10.08.2020 21:59

reporter   ~0012720

It's a DDS file. Image programs like makeIntensity() don't work on compressed images.
Geep

Geep

16.08.2020 19:43

reporter   ~0012737

Thanks for that insight, VanishedOne. Neither 2.07 nor 2.08 contains, in the standard distribution, stain01b_s.tga, only stain01b_s.dds . So perhaps the MakeIntensity call was bad before, but the error wasn't reported to the console until 2.08. I didn't find any copy of stain01b_s.tga within the FMs I have locally (not at all a complete set).

Since the whole point of stain01bwet is evidently to use MakeIntensity, if that can't happen, probably it needs to be dropped from future distributions.
VanishedOne

VanishedOne

16.08.2020 22:33

reporter   ~0012738

If any released maps have used that material, it can't really be dropped; a missing material would render black, I think. Either the material decl needs to change or someone with assets SVN access needs to add the missing .tga.

Since the image appears to be monochrome anyway, I'm not sure makeIntensity() is actually needed (its definition from idDevNet: 'Copies the red channel to the G, B, and A channels').
Geep

Geep

17.08.2020 16:50

reporter   ~0012740

Clearly the intention from the name "stain01b_wet" is to simulate, say, a beer spill on a bartop. I don't know if that was ever successfully realized.
nbohr1more

nbohr1more

17.08.2020 23:36

developer   ~0012741

See here:

https://forums.thedarkmod.com/index.php?/topic/20291-beta-testing-208/&do=findComment&comment=446849

If you remove the "makeintensity" keyword, you will see the decal flicker.

Prior to 0005044 this material didn't work at all. When it was enabled, the flicker arrived too.
VanishedOne

VanishedOne

18.08.2020 12:05

reporter   ~0012742

I'm having trouble reproducing this flicker on my machine, even after reverting to TWOSIDED_DECAL_MACRO. I did manage to find some on the stairs just before the chute in St. Lucia, but then it persisted if I set the specularmap to _white and turned DECAL_MACRO off, so I'm guessing the decals are coplanar with the stairs and that makes a light-interactive decal z-fight.
Geep

Geep

18.08.2020 15:33

reporter   ~0012743

I've seen other decals z-fight when coplanar too (e.g., straw). Probably the guidance to mappers needs to change, to avoid coplanarity in those cases. Maybe add a warning in the DR viewer with those? More tediously, scan & revise old FMs to remove coplanarity for those decals?
stgatilov

stgatilov

02.01.2022 11:31

administrator   ~0014630

This material was first broken by 0005044, which applied specular color to specular light.
Nbohr1more "fixed" it by replacing .tga image with .dds, which was simple replaced with black texture because DDS textures don't support image programs.
Then with 0005781 image programs started working with DDS textures, so the flickering has returned.
At least at the Saint Lucia mission (near the statue).

In my opinion the best idea now is to set specular texture to black (or specular color to zero), and thus return the state of things in 2.09 at least.
stgatilov

stgatilov

02.01.2022 15:49

administrator   ~0014633

I think I found the core reason behind all of this.
Our C++ code for interactions rendering NEVER sets polygonOffset.
As the result, all interactions with polygon-offset-ed surfaces (i.e. decals) on solid surfaces are doomed to cause depth fighting.

I tried to add polygon offset there, and it helps for Saint Lucia map.
Geep

Geep

02.01.2022 20:46

reporter   ~0014634

Sounds promising
stgatilov

stgatilov

04.01.2022 03:19

administrator   ~0014640

Last edited: 04.01.2022 03:31

SVN revs 16426 and 16427.

We changed specularmap on this material to _black because:
  1) It removes depth fighting.
  2) It restores the original appearance of this material (the one it has in TDM 2.00).
It turns out that specular lighting never worked on it.

Trying to actually support specular term on polygon-offsetted surfaces is extracted to 0005868.

Internal discussion:
  https://forums.thedarkmod.com/index.php?/topic/21231-stain01bwet-interactions-and-polygonoffset
Geep

Geep

04.01.2022 14:21

reporter   ~0014644

Thanks for the deep dive.

Issue History

Date Modified Username Field Change
10.08.2020 01:30 Geep New Issue
10.08.2020 01:48 Geep Reproducibility always => have not tried
10.08.2020 01:48 Geep Description Updated
10.08.2020 01:48 Geep Steps to Reproduce Updated
10.08.2020 21:59 VanishedOne Note Added: 0012720
16.08.2020 19:43 Geep Note Added: 0012737
16.08.2020 22:33 VanishedOne Note Added: 0012738
17.08.2020 16:50 Geep Note Added: 0012740
17.08.2020 23:36 nbohr1more Note Added: 0012741
17.08.2020 23:36 nbohr1more Relationship added child of 0005044
18.08.2020 12:05 VanishedOne Note Added: 0012742
18.08.2020 15:33 Geep Note Added: 0012743
15.10.2021 03:01 stgatilov Relationship added related to 0005781
02.01.2022 11:31 stgatilov Note Added: 0014630
02.01.2022 15:49 stgatilov Note Added: 0014633
02.01.2022 20:46 Geep Note Added: 0014634
04.01.2022 03:19 stgatilov Note Added: 0014640
04.01.2022 03:20 stgatilov Note Edited: 0014640
04.01.2022 03:30 stgatilov Relationship added related to 0005868
04.01.2022 03:31 stgatilov Note Edited: 0014640
04.01.2022 03:31 stgatilov Note Edited: 0014640
04.01.2022 03:32 stgatilov Assigned To => stgatilov
04.01.2022 03:32 stgatilov Status new => resolved
04.01.2022 03:32 stgatilov Resolution open => fixed
04.01.2022 03:32 stgatilov Fixed in Version => TDM 2.10
04.01.2022 03:32 stgatilov Target Version => TDM 2.10
04.01.2022 14:21 Geep Note Added: 0014644