View Issue Details

IDProjectCategoryView StatusLast Update
0006340The Dark ModGraphicspublic10.12.2023 11:25
Reporterstgatilov Assigned Tostgatilov  
PrioritynormalSeverityminorReproducibilitysometimes
Status resolvedResolutionfixed 
Product VersionTDM 2.11 
Target VersionTDM 2.12Fixed in VersionTDM 2.12 
Summary0006340: Discourage output color depending on input alpha due to gl_dst_alpha
DescriptionAfter some chatting with artists/mappers, it seems that they don't understand what gl_dst_alpha does and what perils it brings.

The current framebuffer has alpha channel, which is filled with undefined garbage at any moment.
This garbage is often just 1.0, but sometimes it can drop below that, or highly above that.
If color output after rendering material depends on alpha before rendering it, then visual look of the material depends on previously rendered (independent) objects in undefined way. This should never happen.

The only proper usage of gl_dst_alpha is when you certainly generate alpha channel in some prior stage of the same material.
This usage is even described in iddevnet (section "Shaders in Materials" in https://iddevnet.dhewm3.org/doom3/materials.html).

Most likely we should produce a warning if such a material is used.
TagsNo tags attached.

Relationships

related to 0006354 assignedstgatilov Envmap stage works very differently with bumpmap and without 

Activities

stgatilov

stgatilov

14.11.2023 20:09

administrator   ~0016177

Implemented in svn rev 10506.

Here is the list of materials generating the warning in load_all/materials.map:
WARNING:material 'textures/darkmod/metal/flat/tiling_1d/gen_smooth_gold01' output color depends on input alpha (0006340)
WARNING:material 'textures/darkmod/metal/flat/tiling_1d/gen_smooth_gold01_ns' output color depends on input alpha (0006340)
WARNING:material 'textures/darkmod/metal/flat/tiling_1d/gen_smooth_silver01' output color depends on input alpha (0006340)
WARNING:material 'textures/darkmod/stone/flat/smooth/marble_pattern01_centerrose_polished' output color depends on input alpha (0006340)
WARNING:material 'textures/darkmod/stone/flat/smooth/marble_pattern01_centersun_polished' output color depends on input alpha (0006340)
WARNING:material 'textures/darkmod/stone/flat/smooth/marble_pattern01_polished' output color depends on input alpha (0006340)
WARNING:material 'textures/darkmod/stone/flat/smooth/marble_pattern02_checker_polished' output color depends on input alpha (0006340)
WARNING:material 'textures/darkmod/stone/flat/smooth/marble_pattern02_crosshair_polished' output color depends on input alpha (0006340)
WARNING:material 'textures/darkmod/stone/flat/smooth/marble_pattern02_rings_polished' output color depends on input alpha (0006340)
WARNING:material 'textures/darkmod/stone/flat/smooth/marble_pattern02_star02_polished' output color depends on input alpha (0006340)
WARNING:material 'textures/darkmod/stone/flat/smooth/marble_pattern02_star_polished' output color depends on input alpha (0006340)
WARNING:material 'textures/darkmod/window/ornate/stainglass_saint_01' output color depends on input alpha (0006340)
WARNING:material 'textures/darkmod/window/ornate/stainglass_saint_02' output color depends on input alpha (0006340)
WARNING:material 'textures/darkmod/window/ornate/stainglass_saint_03' output color depends on input alpha (0006340)
WARNING:material 'textures/water_source/water_fake_reflect' output color depends on input alpha (0006340)
WARNING:material 'textures/water_source/water_fake_reflect_02' output color depends on input alpha (0006340)
stgatilov

stgatilov

18.11.2023 10:34

administrator   ~0016180

Last edited: 18.11.2023 10:39

Fixed the warnings in svn rev 16846 and rev 16487.

Note that stainglass_saint_0x materials look differently, because env-mapped stage now has 2x less effect.
Previously it had dst_alpha = 2 which caused the effect to have double magnitude.

Unfortunately, there is no mapper-controlled multiplier on bumpmapped and envmapped material stage.
One can in principle copy/paste the stage 2 times to replicate the old effect, but I decided to NOT do it yet.

Issue History

Date Modified Username Field Change
14.11.2023 19:50 stgatilov New Issue
14.11.2023 19:50 stgatilov Status new => assigned
14.11.2023 19:50 stgatilov Assigned To => stgatilov
14.11.2023 20:09 stgatilov Note Added: 0016177
18.11.2023 10:34 stgatilov Note Added: 0016180
18.11.2023 10:34 stgatilov Status assigned => resolved
18.11.2023 10:34 stgatilov Resolution open => fixed
18.11.2023 10:34 stgatilov Fixed in Version => TDM 2.12
18.11.2023 10:39 stgatilov Note Edited: 0016180
10.12.2023 11:25 stgatilov Relationship added related to 0006354