View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005718 | The Dark Mod | Feature proposal | public | 20.08.2021 20:00 | 03.11.2024 04:41 |
Reporter | Bikerdude | Assigned To | orbweaver | ||
Priority | normal | Severity | normal | Reproducibility | N/A |
Status | closed | Resolution | no change required | ||
Platform | PC | OS | Windows | OS Version | 10 |
Product Version | TDM 2.10 | ||||
Fixed in Version | TDM 2.10 | ||||
Summary | 0005718: Vertex blended model material unable to support two bumpmaps. | ||||
Description | As Greebo added a new function into DR 2.14 for exported .LWO models to retain vertex colours (blend data for vertex blended models) - - https://bugs.thedarkmod.com/view.php?id=5717 I figured it would be a good idea if support for more than one bump map's could be added for vertex blended models to the core mod. As it is, the mapper can only choose one atm, so blended models will look odd if the mapper isn't careful. | ||||
Additional Information | Here is an example blend material I made for NHAT4, no matter what I tried only tecond bump-map was ever shown in-game - textures/blend/cave_gravel_blend { qer_editorimage textures/darkmod/stone/natural/grey_cracked_001_ed surftype15 description "stone & gravel blend texture" // Vertex colour stage { blend diffusemap map textures/darkmod/stone/natural/grey_cracked_001 VertexColor } { blend bumpmap map textures/darkmod/stone/natural/grey_cracked_001_local (this bump-map 'is not' recognised by the engine) VertexColor } // Inverse Vertex colour stage { blend diffusemap map textures/darkmod/nature/dirt/stones_sand01 InverseVertexColor scale 3,3 } { blend bumpmap map textures/darkmod/nature/dirt/stones_sand01_local (this bump-map 'IS' recognised by the engine) InverseVertexColor scale 3,3 } } | ||||
Tags | No tags attached. | ||||
Ah, I just noticed: grey_cracked_001__local has two underscores... It should be: grey_cracked_001_local |
|
Corrected typo above, but this doesn't fix/effect the issue. The game will only recognise one bump-map per blended material. | |
All we need to do is have the bumpmap at the beginning of each vertex stage in the material def and only assign the 'vertex' and 'inversevertex' lines to the diffuse/specular stages. And on a side note we can add specular maps to the vertex stages aswell. |
|
I have a attached a test map so the team can get users to test this on low end GPU's such as Intel Arc or ATi/Amd to make sure it looks and works ok. | |
See note from 19.09.2023 15:35, 0005718:0016068 or fix. This can be closed, unless the team want to test further. | |
I downloaded BlendTest.7z, and I see material with vertex color there, but it is not applied to anything. Is there something with vertex color that it can be applied to? |
|
@Stgatilov Ive created an updated version of the map for you, see attached. |
|
Thanks! But how do I see that it does NOT work? I mean: grass + road look fine with this pk4. I can verify in debugger that proper normal map is combined with appropriate diffuse map. It is also OK if I set vertexColor / inverseVertexColor in all 4 stages, not just in 2 of them. UPDATE: I see that road gets grass bumpmap if I swap order of diffuse/bump stages. Although I don't see much difference visually to be honest... Is it the problem? Is there any kind of specification anywhere on how such multiple interaction materials? |
|
Nothing need to be fixed, see my note from the 22.12.2023 @14:35. | |
According to OrbWeaver , there are still some problems: https://forums.thedarkmod.com/index.php?/topic/22179-vertex-blending-not-working-with-bump-maps/#comment-495048 but the may be a red herring. Additional refs: https://wiki.thedarkmod.com/index.php?title=DrVertexBlend_(tutorial) https://wiki.thedarkmod.com/index.php?title=Vertex_Painting_in_Lightwave |
|
Well Ive used VB in several maps since resolving the issue so I know its works now. I cant speak to Orbweavers issue, as what is talking about is way above my head.. |
|
It has been concluded that the only problem is on the DR side. The correct material specification is: 1) Normal Map 2) Diffuse 3) Specular See "Rendering Order": https://iddevnet.dhewm3.org/doom3/index.html |
|
I agree this is not a bug to be fixed, but I believe issue should not be closed as is =) I'd like to try implementing a console warning for the cases where stages seemingly go in wrong order. |
|
I added a check that each block detected in SortInteractionStages has at most one instance of each stage type. Here is the list of warnings I get on all core materials: WARNING:Material 'bc_flaskglass': duplicate interaction stages B:1 D:1 S:2 WARNING:Material 'bc_lanternglass_unlit_colorme': duplicate interaction stages B:1 D:2 S:0 (hint: bump must be first) WARNING:Material 'hlantern': duplicate interaction stages B:1 D:2 S:1 (hint: bump must be first) WARNING:Material 'large_green_leaf_normals_alpha': duplicate interaction stages B:1 D:2 S:0 (hint: bump must be first) WARNING:Material 'sawblade': duplicate interaction stages B:1 D:2 S:1 (hint: bump must be first) WARNING:Material 'steam_engine_glassreadouton': duplicate interaction stages B:1 D:2 S:0 (hint: bump must be first) WARNING:Material 'tdm_grass_model_dense': duplicate interaction stages B:1 D:2 S:0 (hint: bump must be first) WARNING:Material 'tdm_grass_model_dense_colored': duplicate interaction stages B:1 D:2 S:0 (hint: bump must be first) WARNING:Material 'tdm_potglass2': duplicate interaction stages B:1 D:2 S:1 (hint: bump must be first) WARNING:Material 'textures/darkmod/door/wood/french_door': duplicate interaction stages B:1 D:2 S:0 WARNING:Material 'textures/darkmod/metal/grate/girder_victorian': duplicate interaction stages B:1 D:2 S:1 (hint: bump must be first) WARNING:Material 'textures/darkmod/metal/grate/girder_victorian_moss': duplicate interaction stages B:1 D:2 S:1 (hint: bump must be first) WARNING:Material 'textures/darkmod/metal/grate/grate_rusted_flat_seethru': duplicate interaction stages B:1 D:2 S:0 (hint: bump must be first) WARNING:Material 'textures/darkmod/weather/test_rain01': duplicate interaction stages B:1 D:2 S:0 (hint: bump must be first) WARNING:Material 'textures/darkmod/weather/test_rain03': duplicate interaction stages B:1 D:2 S:1 (hint: bump must be first) WARNING:Material 'textures/glass/dull_opaque01_moonlit': duplicate interaction stages B:1 D:2 S:1 (hint: bump must be first) WARNING:Material 'textures/water_source/sea_wave_01': duplicate interaction stages B:1 D:2 S:0 (hint: bump must be first) WARNING:Material 'utility_grate_001': duplicate interaction stages B:1 D:2 S:0 (hint: bump must be first) WARNING:Material 'washboard_tin': duplicate interaction stages B:1 D:1 S:2 (hint: bump must be first) Some materials have e.g. two diffuse stages with mutually exclusive conditions, which is supported by the engine. The full behavior is this: 1) If specular or diffuse stage is present but bump stage is missing, then "bumpmap _flat" is added implicitly to the end. 2) Then stages are broken into contiguous blocks, and each block is stable-sorted in order: bump, diffuse, specular. If the first stage is bump, then stages are split in such a way that: every block has exactly one bump stage, and it is the first stage in block. If the first stage is not bump, then all stages constitute a single block and are sorted together. 3) Renderer backend goes through stages in their order after sorting. Stages disabled by "if" condition are skipped. It seems that nodiffuse/nospecular also force skipping respective stage after 0004292. A new interaction block when 1) we meet a bump stage, or 2) we meet a second diffuse or specular stage. If a block has no bump stage (happens on duplicate diffuse/specular), then _flat is implicitly used. *) Ambient stages are completely irrelevant: while they are present and are reordered, you can assume the interaction behavior is the same is if they did not exist. As you see, this is a huge mess. Trying to fix anything here or add warnings will only make the situation worse. I think the only path forward is to add "interaction separator" syntax to materials, which would force interaction block split at all levels, and ensure no reordering across it happens. Also drop that stupid statically added implicit bump stage when at least one separator is present --- TDM already adds it in backend anyway. |
|
DarkRadiant: master 1704aeb7 11.06.2024 19:20 Details Diff |
0005718: fix rendering of vertex blend between two materials This required fixes in two places: - Remove the sorting of material stages in OpenGLShader, which placed ALL bump maps before ALL diffuse maps. This discarded vital information about which pairs or triplets of maps needed to be bound together in interaction passes. Sorting of bump maps before diffuse maps is necessary, but this must be done by the artist in the MTR decl, otherwise the engine will not render the blend correctly. - When we assemble the maps into D/B/S triplets in the RegularLight rendering code, treat bump maps as "delimiters" which start a new interaction pass (via a new clear() method). If we don't do this we end up with unwanted extra passes: a MTR which declares a sequence {B1, D1, B2, D2} generates interaction passes {B1, D1}, {D1, B2}, {B2, D2} which gives the wrong result. Note that 0005718 is actually a Dark Mod bug, but the investigation led to the discovery of this incorrect rendering behaviour in DarkRadiant. The actual engine renderer seems to produce correct results provided the material stages are correctly sorted bumpmap-first in the decl. |
Affected Issues 0005718 |
|
mod - include/ishaderlayer.h | Diff File | ||
mod - radiantcore/rendersystem/backend/OpenGLShader.cpp | Diff File | ||
mod - radiantcore/rendersystem/backend/RegularLight.cpp | Diff File | ||
mod - radiantcore/rendersystem/backend/RegularLight.h | Diff File | ||
DarkRadiant: master 94968963 21.08.2024 18:25 Details Diff |
0005718: fix newly-introduced compiler warnings |
Affected Issues 0005718 |
|
mod - include/ishaderlayer.h | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
20.08.2021 20:00 | Bikerdude | New Issue | |
20.08.2021 20:10 | Bikerdude | Relationship added | related to 0005717 |
20.08.2021 20:12 | Bikerdude | Description Updated | |
21.08.2021 01:02 | nbohr1more | Note Added: 0014308 | |
21.08.2021 09:46 | Bikerdude | Additional Information Updated | |
21.08.2021 09:49 | Bikerdude | Note Added: 0014309 | |
02.01.2022 12:36 | nbohr1more | Relationship added | related to 0005862 |
06.08.2022 10:23 | Bikerdude | Product Version | TDM 2.09 => TDM 2.10 |
19.09.2023 15:35 | Bikerdude | Note Added: 0016068 | |
19.09.2023 15:35 | Bikerdude | File Added: after.png | |
19.09.2023 15:35 | Bikerdude | File Added: before.jpg | |
19.09.2023 15:35 | Bikerdude | File Added: image.png | |
22.09.2023 10:46 | Bikerdude | Note Added: 0016078 | |
22.09.2023 10:46 | Bikerdude | File Added: before.png | |
22.09.2023 10:46 | Bikerdude | File Added: after-2.png | |
22.09.2023 10:46 | Bikerdude | File Added: BlendTest.7z | |
22.12.2023 14:35 | Bikerdude | Fixed in Version | => TDM 2.11 |
22.12.2023 14:35 | Bikerdude | Note Added: 0016253 | |
27.05.2024 17:07 | stgatilov | Fixed in Version | TDM 2.11 => |
27.05.2024 17:07 | stgatilov | Target Version | => TDM 2.13 |
06.06.2024 06:13 | stgatilov | Note Added: 0016726 | |
06.06.2024 08:29 | Bikerdude | Note Added: 0016727 | |
06.06.2024 08:29 | Bikerdude | File Added: blendtest.pk4 | |
06.06.2024 16:39 | stgatilov | Note Added: 0016728 | |
06.06.2024 16:39 | stgatilov | Note Edited: 0016728 | |
06.06.2024 16:42 | stgatilov | Note Edited: 0016728 | |
06.06.2024 16:58 | Bikerdude | Note Added: 0016729 | |
06.06.2024 17:04 | nbohr1more | Note Added: 0016730 | |
06.06.2024 17:04 | nbohr1more | Status | new => feedback |
06.06.2024 18:27 | Bikerdude | Note Added: 0016731 | |
06.06.2024 18:27 | Bikerdude | Status | feedback => new |
09.06.2024 05:16 | nbohr1more | Note Added: 0016733 | |
09.06.2024 05:17 | nbohr1more | Assigned To | => orbweaver |
09.06.2024 05:17 | nbohr1more | Status | new => closed |
09.06.2024 05:17 | nbohr1more | Resolution | open => no change required |
09.06.2024 05:17 | nbohr1more | Fixed in Version | => TDM 2.10 |
09.06.2024 05:17 | nbohr1more | Target Version | TDM 2.13 => |
09.06.2024 05:17 | nbohr1more | Note Edited: 0016733 | |
09.06.2024 09:01 | stgatilov | Note Added: 0016734 | |
09.06.2024 11:01 | stgatilov | Note Added: 0016735 | |
09.06.2024 11:01 | stgatilov | Status | closed => assigned |
09.06.2024 11:01 | stgatilov | Assigned To | orbweaver => stgatilov |
09.06.2024 11:01 | stgatilov | Status | assigned => new |
15.06.2024 13:49 | stgatilov | Assigned To | stgatilov => orbweaver |
15.06.2024 13:49 | stgatilov | Status | new => closed |
23.07.2024 11:36 | orbweaver | Changeset attached | => DarkRadiant master 1704aeb7 |
03.11.2024 04:41 | orbweaver | Changeset attached | => DarkRadiant master 94968963 |