Jump to content
The Dark Mod Forums

Recommended Posts

Posted

A visually breaking change is planned for 2.13 (6354).

Environment mapping is used when material contains a stage like this:

{
    blend add
    cubeMap env/gen3
    texgen  reflect
}

Historically, there are two separate shaders for this case: one if the material has bumpmapping, and one if it does not.
Note that if the material has diffuse or specular stage, then bumpmap is added implicitly.
 

The shader with bumpmap was apparently "tweaked" by someone in TDM and got several major differences:

  1. it has fresnel term
  2. output color is tonemapped to [0..1] range using X / (1 + X)
  3. the color multiplier is hardcoded to (0.4, 0.4, 0.4)

I'd like to delete all of these differences and restore the same behavior as in non-bumpmapped case.
It is also the same behavior which is used in both cases in Doom 3 BFG (and supposedly in Doom 3 too).

Speaking of points 1 and 2, nobody will notice the difference except in rare corner cases.
The point 3 however is serious.
It is also the main reason behind the change.
Right now nobody can tweak the intensity of environment mapping: if you try to set red/green/blue/rgb, these settings are simply ignored.


Now the problem is that the intensity of most environment mapping materials will change.

In core files I see text like this (stainglass_saint_01) :

	{
		blend add
		maskalpha
		cubeMap env/gen3
		// tone down the reflection a bit      //I see no evidence that these values do anything
		red     Parm0 * 0.2
		green   Parm1 * 0.2
		blue    Parm2 * 0.2
		texgen  reflect
	}

Since the default parameter was 0.4, after the change this material will get 2x less intensity.

The situation is even worse if rgb multiplier is not specified, since then it will change from 0.4 to 1.0, i.e. envmapping will become 2.5 times brighter.


I can probably collect the list of all materials using environment mapping, but I'm not sure I'll be able to check them all one by one.
Perhaps I can delete existing rgb settings, blindly set "rgb 0.4" and hope for the best.

  • Like 2
Posted

I think we can use this script (mod) to extract all textures with specular maps, and if possible, create a map for testing. Unfortunately, I'm not yet familiar with the editor to help with this.

I came here because I plan to work on textures more thoroughly, and I'm currently reading the wiki on texturing issues. In general, I'm interested in this topic.

Maybe I'm not competent at all, but is it possible to make a texture have a constant reflection (yes/no) and a variable with a setting in the editor/accompanying document (?) that controls the intensity?

For example, the same object/texture can behave differently on different maps.

Posted
10 minutes ago, stgatilov said:

I can probably collect the list of all materials using environment mapping, but I'm not sure I'll be able to check them all one by one.
Perhaps I can delete existing rgb settings, blindly set "rgb 0.4" and hope for the best.

Collect them all in a testmap and then run an automation script that moves trough the map, making screenshots?

Posted

That bash script does not (as far as I can see) "extract all textures with specular maps". It extracts all materials to disk, then locates lines that include the word "specularmap" and blindly injects a couple of new material stages underneath. It does not identify the name of the material at all, and I'm not sure it will correctly handle materials where the specular map is part of a full stage block "{ blend specularmap ... }".

Posted
5 hours ago, stgatilov said:

Perhaps I can delete existing rgb settings, blindly set "rgb 0.4" and hope for the best.

Instead of deleting I would comment them out. Then later on it can be decided if these settings are worth it.

  • 2 weeks later...
Posted

I tried the script on the core assets, and find an interesting case called

  • textures/darkmod/metal/flat/tiling_1d/gen_smooth_gold01

This material has time-dependent envmap color:

    {
        blend add
        maskalpha
        cubeMap      env/gen1
            red      sintable[time*0.1]
            green    sintable[time*0.1]
            blue     sintable[time*0.1]
        texgen      reflect
    }

I wonder whether it was intentional or not.
Here is how it looks:

gen_smooth_gold01.gif.e0986815f5bb7f4735f9361e55b52c65.gif

I suppose it would be worthwhile to manually review the modified materials, because in some cases the color adjustment was actually meaningful...

 

  • Like 1
  • 2 weeks later...
Posted

The new behavior is available in the latest dev17026-10712.
If you set cvar r_envmapBumpyBehavior to 1, then you get new behavior.
The old behavior is for value 0, which is default yet.

The missions/core files are not adjusted yet.
But I'd say everything is ready to do it.

  • Like 1
  • 8 months later...
Posted

I'd like to remind that we plan a massive automatic change in all released missions related to this issue when 2.13 beta starts.
The goal is to make sure the update missions work with 2.13 beta just like they work now with 2.12.

  • Like 1
  • 3 weeks later...
Posted

The missions have been updated.

Here is the full list of missions/files which were modified:

Spoiler

ac1/ac1.pk4_dir/materials/kingsal.mtr
altham/altham.pk4_dir/materials/custom.mtr
altham/altham.pk4_dir/materials/models.mtr
at1_lucy/at1_lucy.pk4_dir/materials/g_g.mtr
at1_lucy/at1_lucy.pk4_dir/materials/g_gexp.mtr
bcd/bcd.pk4_dir/materials/metal.mtr
bcd/bcd.pk4_dir/materials/thief.mtr
blackgrove/blackgrove.pk4_dir/materials/tdm_glass.mtr
blackgrove/blackgrove.pk4_dir/materials/tdm_windows.mtr
byanyothername/byanyothername.pk4_dir/materials/custom.mtr
byanyothername/byanyothername.pk4_dir/materials/models.mtr
cauldron_v2_2/cauldron_v2_2.pk4_dir/materials/branded_skeleton.mtr
faffairs/faffairs.pk4_dir/materials/welli_latches.mtr
gem_of_souls/gem_of_souls.pk4_dir/materials/gem.mtr
gemcutter/gemcutter.pk4_dir/materials/branded_skeleton.mtr
gemcutter/gemcutter.pk4_dir/materials/volta_builder.mtr
gemcutter/gemcutter.pk4_dir/materials/volta_camp.mtr
gemcutter/gemcutter.pk4_dir/materials/volta_gemcutter.mtr
gemcutter/gemcutter.pk4_dir/materials/volta_objects.mtr
gemcutter/gemcutter.pk4_dir/materials/welli_latches.mtr
hazard/hazard.pk4_dir/materials/branded_skeleton.mtr
hazard/hazard.pk4_dir/materials/volta_camp.mtr
hazard/hazard.pk4_dir/materials/volta_noble.mtr
hazard/hazard.pk4_dir/materials/volta_objects.mtr
hazard/hazard.pk4_dir/materials/volta_warehouse.mtr
heartstmattis/heartstmattis.pk4_dir/materials/custom.mtr
imperial_sword/imperial_sword.pk4_dir/materials/bkd_metal.mtr
imperial_sword/imperial_sword.pk4_dir/materials/bkd_models.mtr
itb/itb.pk4_dir/materials/bugfix.mtr
itb/itb.pk4_dir/materials/itb.mtr
lookwhosmoving/lookwhosmoving.pk4_dir/materials/iri2.mtr
lookwhosmoving/lookwhosmoving.pk4_dir/materials/polyhaven02gothic_tdm_models_decorative.mtr
lookwhosmoving/lookwhosmoving.pk4_dir/materials/wellglass.mtr
lookwhosmoving/lookwhosmoving.pk4_dir/materials/welli_loot_imperialcurrencies.mtr
lookwhosmoving/lookwhosmoving.pk4_dir/materials/welli_loot_lampfirehills.mtr
lookwhosmoving/lookwhosmoving.pk4_dir/materials/welli_props_lampfirehills.mtr
lookwhosmoving/lookwhosmoving.pk4_dir/materials/welliadd_vacant.mtr
lookwhosmoving/lookwhosmoving.pk4_dir/materials/welliaddon01_tdm_metal_detailed.mtr
moongate/moongate.pk4_dir/materials/volta_builder.mtr
mother/mother.pk4_dir/materials/mother_materials.mtr
nobleaffairs/nobleaffairs.pk4_dir/materials/bentraxx.mtr
nobleaffairs/nobleaffairs.pk4_dir/materials/pleasejustwork.mtr
nobleaffairs/nobleaffairs.pk4_dir/materials/volta_camp.mtr
nobleaffairs/nobleaffairs.pk4_dir/materials/volta_noble.mtr
nobleaffairs/nobleaffairs.pk4_dir/materials/volta_objects.mtr
nobleaffairs/nobleaffairs.pk4_dir/materials/volta_warehouse.mtr
northdale1/northdale1.pk4_dir/materials/tdm_models_tools.mtr
northdale2/northdale2.pk4_dir/materials/kingsal.mtr
nowandthen/nowandthen.pk4_dir/materials/custom.mtr
nowandthen/nowandthen.pk4_dir/materials/models.mtr
prize/prize.pk4_dir/materials/bentraxx.mtr
prize/prize.pk4_dir/materials/glass.mtr
prize/prize.pk4_dir/materials/volta_objects.mtr
prize/prize.pk4_dir/materials/welli_loot_imperialcurrencies.mtr
prize/prize.pk4_dir/materials/welli_loot_lampfirehills.mtr
prize/prize.pk4_dir/materials/windows.mtr
scrooge/scrooge.pk4_dir/materials/bkd_windows.mtr
seeking/seeking.pk4_dir/materials/bkd_windows.mtr
seeking/seeking.pk4_dir/materials/mother_materials.mtr
seeking/seeking.pk4_dir/materials/precursor_book.mtr
seeking/seeking.pk4_dir/materials/volta_objects.mtr
snowed_inn/snowed_inn.pk4_dir/materials/branded_skeleton.mtr
snowed_inn/snowed_inn.pk4_dir/materials/tdm_models_lights.mtr
written/written.pk4_dir/materials/bkd_envshot.mtr
written/written.pk4_dir/materials/bkd_windows.mtr
ws4_warrens/ws4_warrens.pk4_dir/materials/ws4.mtr
ws5_commerce/ws5_commerce.pk4_dir/materials/steele.mtr

The changes look like this:

image.png.aa4ab56e00957652b7f6357680459db7.png

All color settings on envmap / "texgen reflect" stage are commented out, and single "rgba 0.4" is added at the end.
Since TDM 2.12 and before uses hardcoded color multiplier 0.4, the behavior in older versions should not change, but the behavior in 2.13 should become almost as it was in 2.12.

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Goblin of Akenash

      Goblin-Secrets episode 2 is out now!
       
      · 3 replies
    • Airship-Ballet

      https://www.twitch.tv/airshipballet2 There was a mapping stream here, it's gone now.
      · 8 replies
    • peter_spy

      Stumbled upon a documentary on Enki Bilal, he is one of the most influential comic book artists of my adolescence. English auto-subtitles is rubbish, so you might need to brush up on your French
      · 3 replies
    • Goblin of Akenash

      Today I did a bit of an experiment! I wanted to see if I could get a dark radiant map into garry's mod, the quickest and dirtiest and not-workiest method is "OBJ2VMF" which converts .obj models into VMF files for hammer to then compile, the way its supposed to work is that you input a 6 sided cube and it turns it into a 6 brush room (not exactly ideal for this since that's not how TDM maps work, this honestly would have been a better idea with any thief game from 1 to the one from 2014 since they all work like that) so what ended up happening was that for every brush there was 6 brushes would be ontop of that almost inflating everything in the map like a balloon, map scale was also an issue that I couldn't fine-tune easily either so the scale is way off ontop of everything being inflated making the space inside the map very tiny! anyways heres the result of that and it looks almost nothing like footloose (plus I did add a bunch of random props in gmod for funsies and better visibility since the process involved replacing all the textures with dev ones that look very flat when in full-bright)

      https://streamable.com/ctmh58

      (streamable link will expire in 2 days but I'll have a spoken word version of this post along side the video and other fun images relating to the bsp inflation effect in the next "Goblin Secrets" video next month)
      · 0 replies
    • Frost_Salamander

      @taaaki Wiki seems broken. Main page works but click any link and:

      · 2 replies
×
×
  • Create New...