View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005449 | The Dark Mod | Textures | public | 19.12.2020 06:12 | 29.12.2020 20:57 |
Reporter | stgatilov | Assigned To | stgatilov | ||
Priority | normal | Severity | text | Reproducibility | N/A |
Status | resolved | Resolution | fixed | ||
Product Version | SVN | ||||
Target Version | TDM 2.09 | Fixed in Version | TDM 2.09 | ||
Summary | 0005449: Remove obsolete "Ambient Method" stages form materials | ||||
Description | Most of the materials have stages which look like this: // TDM Ambient Method Related { if (global5 == 1) blend add map models/md5/chars/animals/horse scale 1, 1 red global2 green global3 blue global4 } { if (global5 == 2) blend add program ambientEnvironment.vfp vertexParm 0 1, 1, 1, 1 // UV Scales for Diffuse and Bump vertexParm 1 1, 1, 1, 1 // (X,Y) UV Scale for specular vertexParm 2 global2, global3, global4, 1 fragmentMap 0 cubeMap env/gen1 fragmentMap 1 models/md5/chars/animals/horse2/horse_local // Bump fragmentMap 2 models/md5/chars/animals/horse // Diffuse fragmentMap 3 models/md5/chars/animals/horse_s // Specular } The parameter global5 is passed from "tdm_ambient_method" cvar, which used to be tweakable in menu as Ambient method: Simple / Enhanced of something similar. Nobody actually used this switch, and we removed it in 2.08, leaving tdm_ambient_method at its default value 0. With such default value, the additional blocks are never used. The goal of this task is to remove these stages from stock material, and remove associated code. | ||||
Additional Information | See also: https://forums.thedarkmod.com/index.php?/topic/20686-fyi-ambient-stage-no-longer-needed-in-materials/ https://forums.thedarkmod.com/index.php?/topic/20692-devs-209-is-branched-out/&do=findComment&comment=454377 | ||||
Tags | No tags attached. | ||||
related to | 0003122 | closed | nbohr1more | Add ambient and frobhighlight macros to the material parser |
Done: r9044. Removed tdm_ambient_method cvar and associated code. r16038. Added script for automatic removal of "ambient method" stages from materials. r16039. Removed "ambient method" stages from all materials. The script removes two types of strings: 1) a line with "// TDM Ambient Method Related" and optional spaces/tabs at the beginning and at the end 2) a block starting with "{ if (global5" and ending with "}", with some optional spaces at various places It leaves some excessive EOLs intact, but I guess it would be hard to remove them automatically. Also, it reads/writes file in text mode, so it converts all EOL style to Windows (for some reason, half of .mtr files have EOL style set to LF in SVN, half of them don't). I have applied the script to our material files. Then I looked through all the diffs to make sure nothing bad happened (at pretty fast speed sometimes). Also removed a few additional comments about ambient method (manually). The total size of material files has reduced in almost two times =) I have verified that there are NO remaining occurences of "Ambient Method" and "global5" in material directory. |
|
During manual review I have noticed two types of suspicious cases. 1) There is "// TDM Ambient Method Related" comment, but the following block does not have "if global5" check. However, the block looks like ambient method-related. The script have not removed such blocks. Here is the list: textures/darkmod/decals/figure_shadow01 textures/darkmod/decals/vegetation/leaves_groundcover_02 textures/darkmod/decals/vegetation/tree_branch_04 models/props/misc/lightgem_surface arch_vine01 tdm_greenhouse_branch bc_mirror_silver_enviro gw_dm1/tree/tree_branch_01 gw_dm1/tree/tree_branch_02 gw_dm1/tree/tree_branch_03 tree_branch_04 gw_dm1/tree/trees_01 gw_dm1/tree/plant_01 bc_broomtrans tdm_feather textures/darkmod/window/roundtop_white02_single/roundtop_white02_single_brightlit textures/darkmod/window/roundtop_white02_single/roundtop_white02_single_softlit textures/darkmod/window/roundtop_white02_single/roundtop_white02_single_barelylit 2) Sometimes there is standard ambient method block PLUS one more block which looks like ambient block too. List of materials: spyglass_fancy bc_flower_pink tdm_taper |
|
Actually, there are much more blocks from p.1, I could not notice them they don't have the comment, so they are not visible in diffs. Searching for "global2" allows to find many more. |
|
Some more commits: r16040. Added regexp to remove ambient stages without "if global5". r16041. Removed more ambient stages (now without if) by the devel/remove_ambient_stages.py script. r16042. Removed some more ambient stages manually. Basically, I removed some more blocks which don't have "if global5" but have "red global2" + "green global3" + "blue global4". The only remaining occurence of global2-global5 is this one: lights/spot01_global // uses global parms { { forceHighQuality map lights/spot01.tga red parm0 * global0 green parm1 * global1 blue parm2 * global2 zeroClamp } } I guess it is something old from D3, which does not work in TDM. |
|
r16051 fixed dynamic ambient lights in Location System | |
Date Modified | Username | Field | Change |
---|---|---|---|
19.12.2020 06:12 | stgatilov | New Issue | |
19.12.2020 06:12 | stgatilov | Status | new => assigned |
19.12.2020 06:12 | stgatilov | Assigned To | => stgatilov |
19.12.2020 06:35 | stgatilov | Note Added: 0013162 | |
19.12.2020 06:36 | stgatilov | Note Edited: 0013162 | |
19.12.2020 06:39 | stgatilov | Note Added: 0013163 | |
19.12.2020 06:44 | stgatilov | Note Added: 0013164 | |
19.12.2020 16:06 | stgatilov | Note Added: 0013165 | |
19.12.2020 16:06 | stgatilov | Status | assigned => resolved |
19.12.2020 16:06 | stgatilov | Resolution | open => fixed |
19.12.2020 16:06 | stgatilov | Fixed in Version | => TDM 2.09 |
19.12.2020 20:51 | nbohr1more | Relationship added | related to 0003122 |
29.12.2020 20:57 | nbohr1more | Note Added: 0013311 |