View Issue Details

IDProjectCategoryView StatusLast Update
0005307The Dark ModGraphicspublic17.12.2023 11:20
Reportercabalistic Assigned Tostgatilov  
PrioritynormalSeveritynormalReproducibilityalways
Status resolvedResolutionfixed 
Product VersionTDM 2.09 
Target VersionTDM 2.12Fixed in VersionTDM 2.12 
Summary0005307: Accountant 1: machine arrows have black background
DescriptionLoad mission "The Accountant 1" and go to the coordinates from the screenshot. The depicted machinery has some gauges with an arrow that with 2.09 renders with a black background. In 2.08 the background is transparent as it should be, *unless* you set "image_useNormalCompression 2", in which case the same error is visible.

It happens during interaction rendering for the ambient light in both the old and new backend. Given the reproducibility in 2.08, it likely has to do with the normal map compression changes?
TagsNo tags attached.
Attached Files

Activities

duzenko

duzenko

21.07.2020 16:26

developer   ~0012665

Can we fix this on the map level?
tdm_epi_shader_electrical.mtr > transformer_needle_a

The bump stage (blend bumpmap) wants to alpha test which makes no sense

Same applies to transformer_needle_b
cabalistic

cabalistic

21.07.2020 18:49

developer   ~0012666

I guess it depends how many materials are affected, and how complicated it would be to work around it in code.
nbohr1more

nbohr1more

22.07.2020 02:22

developer   ~0012668

I believe that original Doom 3 respects alpha on the bump stage. It can be used to fade away the bump pattern at the edge of a decal (etc).

The needle material doesn't really need it though.
duzenko

duzenko

22.07.2020 07:09

developer   ~0012670

@nbohr1more

You're confusing alpha and alphaTest here, no?
nbohr1more

nbohr1more

22.07.2020 18:29

developer   ~0012671

Hmm, I suspect that this is another variant of "DDS does not work with Image Program functions" since we
always revert whenever someone accidentally converts a glass normalmap to DDS.

Does RGTC mode still respect:

forceHighQuality
highquality
uncompressed

keywords that prevent the on-the-fly conversion or fallback DDS loading?
duzenko

duzenko

22.07.2020 19:06

developer   ~0012672

Gee, @nbohr1more, your hard line breaks keep freaking me out :>

> Hmm, I suspect that this is another variant of "DDS does not work with Image Program functions" since we
> always revert whenever someone accidentally converts a glass normalmap to DDS.

I disagree. The image file in question is a .tga. It has been reported that image-normal-compression somehow affects this bug but I don't feel like bothering with that since I have already found what's causing it and suggested a fix not related to RGTC.
I could speculate that maybe it has something to do with the default alpha the GL spec requires RG format implicitly to generate which is different to what D3 filled in on 24-bit .tga files. But generally I don't care.

To be completely honest it's possible to fix this also on the renderer level, but it will have a side effect potentially causing other glitches somewhere else.

> Does RGTC mode still respect:

>forceHighQuality
>highquality
>uncompressed

> keywords that prevent the on-the-fly conversion or fallback DDS loading?

We don't really have DDS's for normal maps, do we? I can't remember which keyword controls dds/jpg/tga loading and which controls on-the-fly compression. But again I don't care because I assume the render quality difference to be negligible for bumpmaps, especially compared with stock TDM diffuse maps. It's more of a VRAM conservation/load speed choice than anything else.
VanishedOne

VanishedOne

30.08.2020 13:56

reporter   ~0012766

Re. alpha in normal maps, I just noticed this in the renderbump docs at https://www.iddevnet.com/doom3/bumpmaps.html

'The alpha channel of the normal map will contain a mask if there were areas in the map that did not directly map to geometry. This can be copied to a diffuse map to use with the alpha test option for per-pixel opacity. Note that if you use the normal map as a template for the specular map, you should explicitly clear or remove the alpha channel, because it will prevent more efficient compression forms from being used.'

So it seems normal (no pun intended) for the internal renderbump tool to produce a normal map with an alpha channel, but as per id's docs you're expected to copy it to diffuse if you want it for alphaTest. It's quite likely not everyone who's used renderbump has actually seen that passage, though.

(The fish I ported from Arx:EoS has an unused normal map that's fully alpha transparent everywhere but the fish's eye; I experimented with it a bit, but I think in the end I packaged it without enabling it in the material decl.)
stgatilov

stgatilov

27.02.2021 09:04

administrator   ~0013734

"The alpha channel of the normal map will contain a mask if there were areas in the map that did not directly map to geometry"

It is normal to have alpha channel, but it is NOT normal if texels with nontrivial alpha value get mapped to some rendered geometry.
So this description does not contradict the general idea that alpha channel in bumpmap has undefined behavior.
stgatilov

stgatilov

27.02.2021 09:08

administrator   ~0013735

Anyway, can someone at least explain what change broke it?
Did it happen when RGTC compression was enabled?
duzenko

duzenko

28.02.2021 10:08

developer   ~0013742

@stgatilov
The more important question for me is what the material author wanted to achieve with alphaTest and why do we want to keep it here.
VanishedOne

VanishedOne

28.02.2021 14:37

reporter   ~0013744

Epifire made the arc transformer model. It looks as though he may have revised it for some reason: in DR I have

transformer_needle_a, transformer_needle_b -- in tdm_epi_shader.mtr. No bump map; alphaTest on the diffusemap.
transformer_needle_a2, transformer_needle_b2 -- in tdm_epi_shader_2.mtr. Diffuse and bumpmap stages with alphatest on both. Possibly he just copied the diffusemap stage to alter it for the bumpmap, and the alphatest got left in; I don't know of any reason to attempt a double alphatest in a material.

transformer_needle_local.tga from The Accountant's pk4 does not actually appear to have an alpha channel.
nbohr1more

nbohr1more

01.02.2022 04:49

developer   ~0014706

forceHighQuality does not cure this

commenting out the normal map stage appears to fix it for one of the needles in the scene?

Calling EpiFire...
Epifire

Epifire

01.02.2022 05:28

reporter   ~0014707

Thanks for notifying me here nbohr1more! The arc_transformer prop was one of my first bigger models I did for TDM. So chances are there are some unnecessary stages in the material.

Definitely go ahead and remove that redundant alphatest in the bumpmap. This all being said, I really need to get my SVN access back up and running so I can start making my own commits. I had taken a long break after that big server crash we had years ago and hadn't set it back up since then. Considering I'm back in full work mode (with some pretty big stuff coming) I'm gonna definitely need to get hooked back up.

Do let me know if there is any other weirdness or bugs in my assets.
nbohr1more

nbohr1more

16.02.2022 19:15

developer   ~0014727

@Epifire : Please let me know if you have any assets to commit and you need me to commit them since you currently have SVN woes?

Otherwise, I will move this to 2.11 so there will be more time.
Epifire

Epifire

16.02.2022 20:52

reporter   ~0014729

I removed the alphatest stage on those bumpmap stages in the epi_shader_2. I tested this in my beta 2.10 client and the needles worked; so I've attached it here.

@nbohr1more If someone has info or a page on getting setup to the SVN, I'd love to get hooked up on that again.
tdm_epi_shader_2.mtr (62,090 bytes)   
nbohr1more

nbohr1more

17.02.2022 03:11

developer   ~0014732

tdm_epi_shader_2-2.mtr (31,831 bytes)   
tdm_epi_shader.mtr (21,543 bytes)   
nbohr1more

nbohr1more

17.02.2022 03:17

developer   ~0014733

Sorry. I tried the new material and it did not correct the issue for me.

Your material significantly diverges from SVN.

Please review the attached files and apply edits to them to ensure that they comply with your intended design.

Also, adding a wrinkle to this whole mess is that the Accountant 1 mission has it's own material defs that are split between different "epi" files.
Once SVN is corrected we can see about removing the override materials in the mission.

I understand that this might sound a bit tedious. Let me know if we can move this to 2.11 if you aren't ready to touch it.
nbohr1more

nbohr1more

18.02.2022 01:59

developer   ~0014736

Too many materials are in this def to modify at the last minute ( 2.10 Release Candidate is out ).

Too risky.

Moving to 2.11
stgatilov

stgatilov

17.12.2023 11:08

administrator   ~0016246

Fixed ac1 mission in svn rev 242 (deleted alphatest on bumpmap).
Core materials are already fixed, as noted above.

Note however that these materials were copied over to many other missions:
  nobleaffairs
  northdale1
  northdale2
  itb
  penny3
  painterswife
  seeking
  ac2
Perhaps we'll see the same issue there.
Perhaps not: I guess people copied the whole thing, they not necessarily use it.
stgatilov

stgatilov

17.12.2023 11:17

administrator   ~0016247

Should I apply the same change to all these missions without testing?

Issue History

Date Modified Username Field Change
21.07.2020 15:41 cabalistic New Issue
21.07.2020 15:41 cabalistic Status new => assigned
21.07.2020 15:41 cabalistic Assigned To => duzenko
21.07.2020 15:41 cabalistic File Added: ac1_2020-07-21_12.41.06.jpg
21.07.2020 16:26 duzenko Note Added: 0012665
21.07.2020 18:49 cabalistic Note Added: 0012666
22.07.2020 02:22 nbohr1more Note Added: 0012668
22.07.2020 07:09 duzenko Note Added: 0012670
22.07.2020 18:29 nbohr1more Note Added: 0012671
22.07.2020 19:06 duzenko Note Added: 0012672
30.08.2020 13:56 VanishedOne Note Added: 0012766
05.12.2020 13:02 stgatilov Assigned To duzenko =>
05.12.2020 13:02 stgatilov Target Version TDM 2.09 => TDM 2.10
05.12.2020 13:02 stgatilov Status assigned => acknowledged
27.02.2021 09:04 stgatilov Note Added: 0013734
27.02.2021 09:08 stgatilov Note Added: 0013735
28.02.2021 10:08 duzenko Note Added: 0013742
28.02.2021 14:37 VanishedOne Note Added: 0013744
01.02.2022 04:49 nbohr1more Note Added: 0014706
01.02.2022 05:28 Epifire Note Added: 0014707
16.02.2022 19:15 nbohr1more Note Added: 0014727
16.02.2022 20:52 Epifire Note Added: 0014729
16.02.2022 20:52 Epifire File Added: tdm_epi_shader_2.mtr
17.02.2022 03:11 nbohr1more Note Added: 0014732
17.02.2022 03:11 nbohr1more File Added: tdm_epi_shader_2-2.mtr
17.02.2022 03:11 nbohr1more File Added: tdm_epi_shader.mtr
17.02.2022 03:17 nbohr1more Note Added: 0014733
18.02.2022 01:59 nbohr1more Note Added: 0014736
18.02.2022 01:59 nbohr1more Target Version TDM 2.10 => TDM 2.11
05.12.2022 20:55 nbohr1more Target Version TDM 2.11 => TDM 2.12
05.12.2023 01:45 nbohr1more Target Version TDM 2.12 => TDM 2.13
17.12.2023 11:08 stgatilov Note Added: 0016246
17.12.2023 11:17 stgatilov Note Added: 0016247
17.12.2023 11:20 stgatilov Target Version TDM 2.13 => TDM 2.12
17.12.2023 11:20 stgatilov Assigned To => stgatilov
17.12.2023 11:20 stgatilov Status acknowledged => resolved
17.12.2023 11:20 stgatilov Resolution open => fixed
17.12.2023 11:20 stgatilov Fixed in Version => TDM 2.12