Jump to content
The Dark Mod Forums

Configuring Shaders and Effects in TDM [solved]


Jet v4.3.5

Recommended Posts

Hello! A few months back after TDM's first standalone release, I experienced a problem running TDM on a Windows 7 VM which was in turn running on my MacBook Pro. The thread for this issue is below:

 

http://forums.thedar...-issues-solved/

 

While I understand the actual heat shimmer effect generated by the engine shader will likely not ever function correctly on this laptop under these circumstances, I wanted to specifically ask whether or not there is a configuration file for configuring/disabling any selection of special effects employed throughout the game outside of the game itself, and also how likely that these configuration options would show up in later versions of TDM if they are not there now. It's not a demand or a hopeful inquiry of any sort, but as I have infrequent access to my full PC at home (TDM gets a lot of attention when I go home) and I'm also simply curious, it would be interesting to know how much configuration TDM's engine could potentially allow regarding the graphical effects it employs at a modular level.

 

EDIT

 

Solution:

If you create a glprogs folder in your darkmod folder and place a new heathaze.vfp file there, it should override the effect for all missions. All you need to do is to write a new shader that simple passes the image through.

 

!!ARBvp1.0
OPTION ARB_position_invariant;

END

!!ARBfp1.0
OPTION ARB_precision_hint_fastest;

TEMP cur;

# get current position on screen
MOV cur, fragment.position;
MUL cur, cur, program.env[1];
MUL cur, cur, program.env[0];

TEX cur, cur, texture[0], 2D;

MOV result.color.xyz, cur.xyz;
MOV result.color, 1.0;

END

 

Creating three more files in the glprogs folder called heatHazeWithMask.vfp, heatHazeWithMaskAndBlur.vfp, and heatHazeWithMaskAndVertex.vfp with the exact same code as is shown above. This removes any "Heat Haze" effects in missions (and as far as I know any distortion materials like glass and water), so unless you're having issues similar to that in the original half of the original post, you will likely not need to make this modification to the game's files.

Edited by Jet v4.3.5
Link to comment
Share on other sites

You could make a custom material definitions for materials that contain the heat haze shader then pack this definition in each mission and it

should override the ones that ship with the mod.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

If there were a way to alter the shader files, I don't think I'd be able to do it myself - at least not now. Altering things like this -especially in replacing pieces of packages written in assembly- is way out of my range of capabilities, even if it's simpler than it sounds. In that case I'd have to say I'm a little lost.

 

What is a residual decry

 

[shameless plug]

 

"Residual Decay". That .gif's been around for a while and that A has always looked a bit odd, but was never fixed or altered.

 

If you have played any of the single player mods for Unreal Tournament, you may have heard of campaigns like 7 Bullets and Xidia. Residual Decay is the "sequel" for those two campaigns, although presently it's become more a selection of episodic campaigns to better accommodate the content that's been produced for it and for varying workloads per the early campaigns (sticking mostly with vanilla content). The first episode is currently in the works, if anybody's interested, but for the most part I just attempted a copy of my sig from other forums and the linked image formatting didn't end up working on these boards. The out-of-date ModDB page: http://www.moddb.com.../residual-decay and (again, out-of-date) archived site: http://web.archive.o...yondunreal.com/

 

I'm working on the mod as a mapper and modeler/animator/texture artist fyi, so I have some moderate mapping chops (at least at a basic level). Been looking into working with TDM's content development tools but I've been busy with school and the sub-par experience with the mod on this laptop puts a damper on my enthusiasm.

 

[/shameless plug]

Link to comment
Share on other sites

No you don't need to alter shader assembly. Just get the call to the shader out of your material definitions.

 

I'll find an example this evening if I get a chance.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Hello! A few months back after TDM's first standalone release, I experienced a problem running TDM on a Windows 7 VM which was in turn running on my MacBook Pro. The thread for this issue is below:

Why arent you dual booting with bootcamp so you can use the macbook like a full blown PC..?

Link to comment
Share on other sites

Ok. Here is a glass shader from tdm_glass.mtr

 

 

 

textures/darkmod/glass/clear_warp	 // almost clear transparent glass
{
   // Written by Tels, mainly based on
   // http://www.iddevnet.com/doom3/materials.php

   noSelfShadow
   noshadows
   twoSided
   translucent
   forceoverlays
   sort decal
   glass
   qer_editorimage    textures/darkmod/glass/clear_warp_ed

   description "A reflecting, translucent material suited for large, flat glass panes"

    // this block makes the glass distort what you see through it
    // one unwanted side-effect is that this effect does not stack
   // and distorbs objects in front of the glass, too
    {
		    vertexProgram heatHaze.vfp
		    vertexParm  0  0 , 0  // texture scrolling
		    vertexParm  1  .8  // magnitude of the distortion

		    fragmentProgram heatHaze.vfp
		    fragmentMap 0  _currentRender
		    fragmentMap 1  textures/sfx/vp1 // the normal map for distortion
    }

   // this stage sets up the alpha mask (it doesnt render anything)
   // we use another glass texture for the alpha map, so that the reflection
   // shows more clearly and different from what the alpha map of our glass
   // says, that makes it more interesting 
   {
       maskcolor                
       map makealpha(textures/glass/glass1)
   }
   // now use the alpha mask to add some fake reflections
   {
       blend gl_dst_alpha, gl_one
       maskalpha
       cubeMap env/gen2
       // tone down the reflection a bit
       red	 Parm0 * 0.2
       green   Parm1 * 0.2
       blue    Parm2 * 0.2
       texgen  reflect
   }
   // add our texture on top
   {
       blend   gl_dst_color, gl_one
       map    textures/darkmod/glass/crystal_milky
       red	 Parm0 * 0.2
       green   Parm1 * 0.2
       blue    Parm2 * 0.2
   }

   // This is the code required for frob highlighting this texture
   {
       if ( parm11 > 0 )
           blend	   gl_dst_color, gl_one
           map		 _white
           rgb		 0.40 * parm11
      }
   {
       if ( parm11 > 0 )
           blend	   add
           map		 textures/darkmod/glass/crystal_milky
           rgb		 0.15 * parm11
   }
}

 

 

 

To avoid the glasswarp shader, simply remove this stanza:

 


    // this block makes the glass distort what you see through it
    // one unwanted side-effect is that this effect does not stack
   // and distorbs objects in front of the glass, too
    {
		    vertexProgram heatHaze.vfp
		    vertexParm  0  0 , 0  // texture scrolling
		    vertexParm  1  .8  // magnitude of the distortion

		    fragmentProgram heatHaze.vfp
		    fragmentMap 0  _currentRender
		    fragmentMap 1  textures/sfx/vp1 // the normal map for distortion
    }

 

Any material that uses fragmentProgram heatHaze you would make the same change.

then save the changed material definition to a new file and include it in your mission pk4 files.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

What arent you dual booting with bootcamp so you can use the macbook like a full blown PC..?

 

The three biggest issues were:

  1. Unlocking the Windows 7 license from the VM for a full permanent install via bootcamp. There's a way or two to do it so this isn't a huge obstacle, but it was still a divisive obstacle.
  2. The fan control while using Windows via bootcamp is awful. The fans would never speed up to accommodate for what was literally an extreme heat built up by the processor and/or video card on the laptop. The surface just above the keyboard already gets pretty hot during a game or even with moderate rendering and video play, all with the fans running; in bootcamp, the lack of fan reactivity allowed the temperature to get up to some incredibly dangerous levels. I downloaded a command-prompt program for overriding the fan speeds and manually bumped them up quite high, but then the speeds stay the same until a system restart, which was also pretty annoying.
  3. Switching between Mac OS and Windows in an instant is much better suited for what I use this laptop for. TDM is a single piece of software I use, and its the only one that demonstrates any issues. I've played high-end PC games through the VM and the only obvious issue is heat, while in-game performance is just slightly lower than what it should be at worst. Overall keeping these things the way they are is a big comfort and convenience thing for me, and while I'm stoked about playing TDM more regularly, it as a single piece of software that I use out of many others makes installing and configuring a Windows boot partition a moot priority at this point.

Still, it is a bit of a goofy setup. I'll grant you that.

 

As far as nbohr1more's workaround goes, I'm not sure I fully understand but I did attempt to create a file with that single material replaced, then placed it into Saint Lucia's folder (because I have no idea what I'm doing). This did not work.

 

Should I edit the main tdm_glass.mtr file within the core material package for my TDM installation, or would some change need to be made to all of the FMs I wish to play? Also, as illustrated above, I don't think I understand the whole workflow you have in mind, but from what you're describing it doesn't sound too difficult.

Link to comment
Share on other sites

The three biggest issues were:

  1. Unlocking the Windows 7 license from the VM for a full permanent install via bootcamp. There's a way or two to do it so this isn't a huge obstacle, but it was still a divisive obstacle.
  2. The fan control while using Windows via bootcamp is awful.
  3. Switching between Mac OS and Windows in an instant is much better suited for what I use this laptop for.

  • I dont understand what your saying, is the copy of Win7 legitimate..?
  • There are apps that provide manual fan control for windows.
  • In that case them Vmware fusion is the way to go.

Link to comment
Share on other sites

  • I dont understand what your saying, is the copy of Win7 legitimate..?
  • There are apps that provide manual fan control for windows.
  • In that case them Vmware fusion is the way to go.

  • The license is legitimate, but it's for a single install of Windows. I would have to redeem the license from the VM's install, making it an illegitimate install, then install Windows via Bootcamp and re-apply the license to the new install. At least that's the issue I had before. It seems like I attempted to unlock the license from the VM once before, but after about a week was prompted by the system for a new key in place of the one that was apparently still "active".
  • Other than the one I used before going back to the VM? By all classifications the program I used did provide manual fan control in Windows.
  • Not free I take it? I assume the free trial has a limited period of use before becoming useless? It sounds interesting, and if I were to purchase it it seems like there will be a discount for upgrading from Parallels, which is compelling, but I'm not going to make that purchase any time soon I'm afraid.

Link to comment
Share on other sites

  • Not free I take it? I assume the free trial has a limited period of use before becoming useless? It sounds interesting, and if I were to purchase it it seems like there will be a discount for upgrading from Parallels, which is compelling, but I'm not going to make that purchase any time soon I'm afraid.

 

I think its about $50/£50

Link to comment
Share on other sites

OK, more explicit steps:

 

1) locate the tdm_textures_base01.pk4 in your darkmod directory

2) Copy it to another folder or your Desktop

3) Rename the file with a .zip extension and extract it to a folder

4) Locate the materials folder inside the folder you extracted

5) Open every material file (*.mtr) at once in Notepad++ text editor

6) search for "heatHaze" in all documents

7) once you know which materials have this in them you can close all the open tabs in notepad++ then delete all the material

files that don't contain the heatHaze stanza

8) Edit the remaining materials (mtr) to remove the heatHaze stanza as per my original post above

 

9) Locate a mission.pk4 file of your choice in darkmod/fms/<NamedMissionFolder>

10) copy it to another folder or your desktop

11) rename it with a .zip extension and extract it

12) copy the materials folder which contains the edited materials into the extracted mission folder

Eg alberics/materials/example.mtr

 

13) Select all items inside the mission folder and create a zip archive

14) rename with a pk4 extension

15) Delete the original mission folder where you got the mission.pk4

16) Copy your new pk4 into darkmod/fms

17) Start TDM

18) Check New Missions

19) You should see the mission you edited as a pop-up saying it's available to install

20) If not, a restart should allow steps 18 and 19 to work

21) Install the mission and you will see the heatHaze artifacts should be gone.

Edited by nbohr1more

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

If you create a glprogs folder in your darkmod folder and place a new heathaze.vfp file there, it should override the effect for all missions. All you need to do is to write a new shader that simple passes the image through.

 

!!ARBvp1.0
OPTION ARB_position_invariant;

END

!!ARBfp1.0
OPTION ARB_precision_hint_fastest;

TEMP cur;

# get current position on screen
MOV cur, fragment.position;
MUL cur, cur, program.env[1];
MUL cur, cur, program.env[0];

TEX cur, cur, texture[0], 2D;

MOV result.color.xyz, cur.xyz;
MOV result.color, 1.0;

END

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

If you create a glprogs folder in your darkmod folder and place a new heathaze.vfp file there, it should override the effect for all missions. All you need to do is to write a new shader that simple passes the image through.

 

!!ARBvp1.0
OPTION ARB_position_invariant;

END

!!ARBfp1.0
OPTION ARB_precision_hint_fastest;

TEMP cur;

# get current position on screen
MOV cur, fragment.position;
MUL cur, cur, program.env[1];
MUL cur, cur, program.env[0];

TEX cur, cur, texture[0], 2D;

MOV result.color.xyz, cur.xyz;
MOV result.color, 1.0;

END

 

So I did try your suggestion exactly as you described it and it didn't work. However, your solution was correct, and I considered making proxy .vfp files for other default shaders with "heatHaze" in their names, and this effectively removed the effect. Things look great now, so thanks for that.

 

Might pick up Dark Radiant at some point if I fancy playing around and learning some mission design for TDM now that it works well-enough.

Link to comment
Share on other sites

FYI my "Window of Opportunity" mission includes a lava material using HeatHaze, in case you play that.

 

If I play it, I'll see how it looks and make a judgement. What disabling the effect does is allow me to eradicate an issue that would otherwise appear in almost every single mission for the game considering how commonly torches are used. I would probably say that as long as the lava looks effectively lava-ish, I won't have a problem. If it looks off, I'm still leaving the effect off to cover the more prominent problem with torches.

 

That said, I also occasionally go home some weekends, and I have a fantastic gaming PC there where I can play TDM or any other game for that matter on full graphical fidelity without worrying about the same things I have to worry about with my laptop, and that's a pretty good deal for me.

Link to comment
Share on other sites

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

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...