<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.thedarkmod.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Peter+spy</id>
	<title>The DarkMod Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.thedarkmod.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Peter+spy"/>
	<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Special:Contributions/Peter_spy"/>
	<updated>2026-04-29T06:24:41Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Alert_%26_Suspicion_Triggers&amp;diff=33886</id>
		<title>Alert &amp; Suspicion Triggers</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Alert_%26_Suspicion_Triggers&amp;diff=33886"/>
		<updated>2025-03-13T17:13:42Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: /* Controlling AI Reactions to Missing Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;TODO PLACEHOLDER&lt;br /&gt;
&lt;br /&gt;
AI will alert if they see or hear the player but alerts and suspicion (low alert) can be triggered by the AI noticing suspicious or missing objects and other situations. This article describes how to control this.&lt;br /&gt;
&lt;br /&gt;
==Controlled Alerts==&lt;br /&gt;
&lt;br /&gt;
Alarms etc.&lt;br /&gt;
&lt;br /&gt;
For atdm:alarm_sound, alert_volume_mod ranges from -60 (no sounds at all) to positive 10.&lt;br /&gt;
&lt;br /&gt;
One thing I&#039;d like to know is how to start AI off (at map start) at an elevated alert level rather than their default, casual state.&lt;br /&gt;
&lt;br /&gt;
alert_initial is the spawnarg you need. This is a floating point value.&lt;br /&gt;
&lt;br /&gt;
These are the thresholds.&lt;br /&gt;
&lt;br /&gt;
idle: 0 ... 1.5 &lt;br /&gt;
observant: 1.5 ... 6&lt;br /&gt;
suspicious: 6 ... 8&lt;br /&gt;
searching: 8 ... 18&lt;br /&gt;
agitated searching: 18 ... 23&lt;br /&gt;
combat: &amp;gt;23 (but alert_initial doesn&#039;t work in this case, AI need an enemy to go into combat)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;edit:  These were changed in 2.0 so that suspicious wasn&#039;t so tiny, but I forget the new values.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Which number is the one they go to after having spotted the player? The one where they go back to their regular patrols but keep their weapon out? &lt;br /&gt;
&lt;br /&gt;
	This is still idle &amp;lt; 1.5. &lt;br /&gt;
&lt;br /&gt;
The code switches to a different AlertIdle state when the AI has encountered an enemy before. There&#039;s no difference in terms of the numbers.&lt;br /&gt;
&lt;br /&gt;
==Suspicious Objects==&lt;br /&gt;
TO DO&lt;br /&gt;
noisemaker arrow on floor&lt;br /&gt;
&lt;br /&gt;
CHECK OUT &lt;br /&gt;
AIUSE_&lt;br /&gt;
STIM_VISUAL&lt;br /&gt;
&lt;br /&gt;
That&#039;s what is issued by STIM_VISUAL on arrows, doors and AI by default. The AI code reacts to those stims based on the AI_USE spawnarg.&lt;br /&gt;
&lt;br /&gt;
NOTES PASTED FOR REF TO REWRITE. SOME OF THIS MAY BE OBOSOLETE OR IRRELEVANT FOR THE MAPPER - I&#039;VE GOT TO FIGURE IT OUT YET...&lt;br /&gt;
&lt;br /&gt;
script function for responding to STIM_VISUAL in ai_darkmod_base, and made some tweaks to the visibility tests in the dll (not in the pk4 yet). By adding a visual stim to the arrow and arrow result defs, I&#039;ve got the AI reacting to arrows that it sees (only the first time it sees each one, using the ResponseIgnore script function.)&lt;br /&gt;
&lt;br /&gt;
However, I&#039;d like to have the AI react differently to different sorts of objects.&lt;br /&gt;
&lt;br /&gt;
variable to classify the response to stim_visual:&lt;br /&gt;
IMO, I think it&#039;s easier to just create different stims for these different cases, with the functionality in the response. E.g., stim_body, stim_suspicious_item, stim_missing_item, etc.&lt;br /&gt;
&lt;br /&gt;
Ok, I&#039;ve implemented a bunch of .def variables that contain what I need. I have them all documented in a file that is intended to be included by scriptors that I will check in with the source.&lt;br /&gt;
&lt;br /&gt;
Here are the contents that I&#039;ve added so far&lt;br /&gt;
&lt;br /&gt;
// This is the key name for the AIUse spawn arg&lt;br /&gt;
#define AIUSE_KEY &amp;quot;AIUse&amp;quot;&lt;br /&gt;
&lt;br /&gt;
// And below are values in use&lt;br /&gt;
&lt;br /&gt;
#define AIUSE_WEAPON &amp;quot;AIUSE_WEAPON&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#define AIUSE_LIGHTSOURCE &amp;quot;AIUSE_LIGHTSOURCE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#define AIUSE_BLOOD_EVIDENCE &amp;quot;AIUSE_BLOOD_EVIDENCE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#define AIUSE_SEAT &amp;quot;AIUSE_SEAT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#define AIUSE_COOK &amp;quot;AIUSE_COOK&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#define AIUSE_EAT &amp;quot;AIUSE_EAT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#define AIUSE_PET &amp;quot;AIUSE_PET&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#define AIUSE_CATTLE &amp;quot;AIUSE_CATTLE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#define AIUSE_PERSON &amp;quot;AIUSE_PERSON&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#define AIUSE_PEST &amp;quot;AIUSE_PEST&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#define AIUSE_DRINK &amp;quot;AIUSE_DRINK&amp;quot;&lt;br /&gt;
&lt;br /&gt;
//----------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
All the FOLLOWING are in effect are strings. The AI scripts look to see what strings are attached as spawnargs under the specified keys, and use those to decide what &amp;quot;type&amp;quot; of entity it is. So if its a noble, they can adress it as a noble. If its a rat, they can address it as a pest.&lt;br /&gt;
&lt;br /&gt;
// The following strings define classes of person, these are used if AIUse is AIUSE_PERSON &lt;br /&gt;
&lt;br /&gt;
// This is the key value&lt;br /&gt;
#define PERSONTYPE_KEY &amp;quot;personType&amp;quot;&lt;br /&gt;
&lt;br /&gt;
// And these are values in use, add to this list as needed&lt;br /&gt;
#define PERSONTYPE_GENERIC &amp;quot;PERSONTYPE_GENERIC&amp;quot;&lt;br /&gt;
#define PERSONTYPE_NOBLE &amp;quot;PERSONTYPE_NOBLE&amp;quot;&lt;br /&gt;
#define PERSONTYPE_CITYWATCH &amp;quot;PERSONTYPE_CITYWATCH&amp;quot;&lt;br /&gt;
#define PERSONTYPE_MERC_PROGUARD &amp;quot;PERSONTYPE_MERC_PROGUARD&amp;quot;&lt;br /&gt;
#define PERSONTYPE_BUILDER &amp;quot;PERSONTYPE_BUILDER&amp;quot;&lt;br /&gt;
#define PERSONTYPE_PAGAN &amp;quot;PERSONTYPE_PAGAN&amp;quot;&lt;br /&gt;
&lt;br /&gt;
//----------------------------------------------------------------------------------------&lt;br /&gt;
// The following strings define genders of person, these are used if AIUse is AIUSE_PERSON &lt;br /&gt;
// I don&#039;t want to get into the politics of gender identity here, this is just because the recorded&lt;br /&gt;
// voices will likely be in gendered languages. As such, I&#039;m just including the categories&lt;br /&gt;
// that are involved in word gender selection in many languages.&lt;br /&gt;
#define PERSONGENDER_KEY &amp;quot;personGender&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#define PERSONGENDER_MALE &amp;quot;PERSONGENDER_MALE&amp;quot;&lt;br /&gt;
#define PERSONGENDER_FEMALE &amp;quot;PERSONGENDER_FEMALE&amp;quot;&lt;br /&gt;
#define PERSONGENDER_UNKNOWN &amp;quot;PERSONGENDER_UNKNOWN&amp;quot;&lt;br /&gt;
&lt;br /&gt;
//----------------------------------------------------------------------------------------&lt;br /&gt;
// The following key and values are used for identifying types of lights&lt;br /&gt;
#define AIUSE_LIGHTTYPE_KEY &amp;quot;lightType&amp;quot;&lt;br /&gt;
#define AIUSE_LIGHTTYPE_TORCH &amp;quot;AIUSE_LIGHTTYPE_TORCH&amp;quot;&lt;br /&gt;
#define AIUSE_LIGHTTYPE_GASLAMP &amp;quot;AIUSE_LIGHTTYPE_GASLAMP&amp;quot;&lt;br /&gt;
#define AIUSE_LIGHTTYPE_ELECTRIC &amp;quot;AIUSE_LIGHTTYPE_ELECTRIC&amp;quot;&lt;br /&gt;
#define AIUSE_LIGHTTYPE_MAGIC &amp;quot;AIUSE_LIGHTTYPE_MAGIC&amp;quot;&lt;br /&gt;
&lt;br /&gt;
//----------------------------------------------------------------------------------------&lt;br /&gt;
// The following defines a key that should be non-0 if the device should be on&lt;br /&gt;
#define AIUSE_SHOULDBEON_KEY &amp;quot;shouldBeOn&amp;quot;&lt;br /&gt;
&lt;br /&gt;
//----------------------------------------------------------------------------------------&lt;br /&gt;
// The following defines a key that should be non-0 if the device should be closed&lt;br /&gt;
#define AIUSE_SHOULDBECLOSED_KEY &amp;quot;shouldBeClosed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
torch and candle flames turning on a visual stimulus if they are marked as supposed to be on and get doused. The stimulus turns off if it is relit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I&#039;m adding the following spawn args. Note that they are spawn args, not variables, so they can&#039;t be changed other than in a .def file.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;canLightTorches&amp;quot; : &amp;gt; 0.0 indicates the AI can light torches&lt;br /&gt;
&amp;quot;canOperateSwitchLights&amp;quot; : &amp;gt; 0.0 indicates AI can turn on switched lights&lt;br /&gt;
&lt;br /&gt;
&amp;quot;chanceNoticeWeapon&amp;quot;: 0.0 to 1.0, probability of noticing a seeable weapon not belonging to a friend&lt;br /&gt;
&amp;quot;chanceNoticePerson&amp;quot;: 0.0 to 1.0, probability of noticing (reacting to) a seeable person be it friend, foe or enemy. &lt;br /&gt;
&amp;quot;chanceNoticeBlood&amp;quot;: 0.0 to 1.0, probability of noticing a see-able patch of blood.&lt;br /&gt;
&amp;quot;chanceNoticeLight&amp;quot;: 0.0 to 1.0, probability of noticing a visible light source that is in the wrong state&lt;br /&gt;
&amp;quot;chanceNoticeMissingItem&amp;quot;: 0.0 to 1.0, probability of noticing a visible missing item&lt;br /&gt;
&amp;quot;chanceNoticeDoor&amp;quot;: 0.0 to 1.0, probability of noticing a visible open door that should be closed&lt;br /&gt;
&lt;br /&gt;
New values&lt;br /&gt;
&amp;quot;AIUSE_MONSTER&amp;quot;&lt;br /&gt;
&amp;quot;AIUSE_UNDEAD&amp;quot;&lt;br /&gt;
&amp;quot;PERSONTYPE_THIEF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
They are in the .def files. The defintions of the tags are in the AIUseValues.script file for inclusion in scripts.&lt;br /&gt;
&lt;br /&gt;
==Suspicious Changes==&lt;br /&gt;
&lt;br /&gt;
TO DO&lt;br /&gt;
&lt;br /&gt;
Doors ajar, torches extinguished&lt;br /&gt;
&lt;br /&gt;
Q: If an AI is looking at a torch and the player shoots it out, will the AI react to it with more suspicion than just a general &#039;when did this go out?&#039;?&lt;br /&gt;
&lt;br /&gt;
A: If the AI is close enough to catch some spray from the water arrow then he alerts but not otherwise.&lt;br /&gt;
&lt;br /&gt;
==Missing or Moved Objects, Absence Markers==&lt;br /&gt;
&lt;br /&gt;
By default AI will take no notice if loot or other objects are missing or moved so it is up to the mapper to judge whether any prominent items ought to be noticed by their absence. The contents of a jewellery box or just a broom moved in a cupboard need not be a cause for attention whereas a guard protecting a precious artifact on a plinth in the middle of a hall should react if it is stolen or even moved off the pedestal onto the floor.&lt;br /&gt;
&lt;br /&gt;
===Making AI Notice a Missing Object===&lt;br /&gt;
&lt;br /&gt;
To make AI notice, become suspicious or alert if an object is missing or moved add to any kind of moveable entity including loot, corpses, any moveable object you think the AI should notice is missing, the following property and values:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;absence_noticeability&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
...with a decimal fraction anywhere in the range from 0 to 1. The closer to 1 then the more likely the AI will notice. Examples:&lt;br /&gt;
&lt;br /&gt;
* 1 means the AI will always notice the object is missing 100% of the time&lt;br /&gt;
* 0.5  means the AI will only notice the object is missing 50% of the time&lt;br /&gt;
* 0  means the AI will never notice the object is missing (default)&lt;br /&gt;
&lt;br /&gt;
It works this way: If the object is moved or taken away then an absence marker is created at the original location (at the center of the bounds) which emits a visual stim. When the item is put back at its original location (within the original bounds of the entity), the absence marker is destroyed again.&lt;br /&gt;
&lt;br /&gt;
Currently the AI will notice at a range of 500 units. Check later if this is changed. It may even become a spawnarg you can adjust to AI do not alert too far away if a tiny ring is missing 25 metres away.&lt;br /&gt;
&lt;br /&gt;
IMPORTANT: The object must be illuminated well enough for the AI to see. If the AI do not notice then this is the first thing to check. It must also of course, not be obscured.&lt;br /&gt;
&lt;br /&gt;
The marker also may physically impede the player (in one instance, blocked jumping and forced crouching beneath).&lt;br /&gt;
&lt;br /&gt;
===How Far Can the Object can be Moved Without Suspicion?===&lt;br /&gt;
&lt;br /&gt;
By default  the player can move an object (with the &#039;&#039;absence_noticeability&#039;&#039; property) within the original boundaries of the entity&#039;s start position without arousing suspicion. So a crate that is only pushed a foot or so to one side will not arouse suspicion. If it is pushed further than half its own width then it will. But this can be controlled:&lt;br /&gt;
&lt;br /&gt;
You can add to the object the property:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;absence_bounds_tolerance&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
...with any value in doom units and this will be added to the boundaries of the entity&#039;s start position. So a crate sized 30 units cube even without this property can be pushed one foot and still clip its original boundaries and so not be noticed. But set this spawnarg to 100 and now it can be moved an extra 100 units in any direction without being noticed.&lt;br /&gt;
&lt;br /&gt;
If you want it to be moveable anywhere within a set area, eg, anywhere on a table top, then see next section....&lt;br /&gt;
&lt;br /&gt;
===Moving within a Location or to a New Location Without Suspicion===&lt;br /&gt;
&lt;br /&gt;
What if you want the player to be able to move a vase anywhere on a table top or to a separate location completely - to another table or another room - without arousing suspicion? You can define the location: Do the following:&lt;br /&gt;
&lt;br /&gt;
* Create a brush entity to cover the table top and at least the height of the vase.&lt;br /&gt;
* Texture the brush with clip texture, convert it to func_static, then give it a suitable name, eg &#039;vase_area&#039;. &lt;br /&gt;
* To the original vase add the property &#039;&#039;&#039;&#039;&#039;absence_location_1&#039;&#039;&#039;&#039;&#039; and give it the name of the brush, eg, &#039;vase_area&#039;.&lt;br /&gt;
&lt;br /&gt;
So long as the vase is partly within that brush then the AI will not be concerned it has been moved about (eg, by a servant for cleaning.)&lt;br /&gt;
&lt;br /&gt;
And you can put the location brush elsewhere too so the vase can be given the property &#039;&#039;absence_bounds_tolerance&#039;&#039; (see above) to extend its coverage around its original location plus the new location brush might be placed on another table or in the kitchen sink if you want.&lt;br /&gt;
&lt;br /&gt;
It is planned to enable multiple alternate locations where it is OK for the object to be (eg, the cleaner put the vase on the next table.) Check at a later time if you can use absence_location_2, 3, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Restricting Alerts to one Type(team) of AI==&lt;br /&gt;
&lt;br /&gt;
Normally all AI will respond to an absence marker. If you only want one AI team to react then give the object the &#039;&#039;&#039;&#039;&#039;team&#039;&#039;&#039;&#039;&#039; property with the value of the team type (see [[AI Relations (Editing)#AI Types (Teams)|teams]].) Missing objects without this property may be noticed by all AI on all teams.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Controlling AI Reactions to Missing Objects==&lt;br /&gt;
&lt;br /&gt;
The reaction of AI on noticing an object is missing can be controlled from slight suspicion up to full alert. Add this property to the object:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;absence_alert_increase&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
And give it a value 0 to 23. This value will be added to the AI&#039;s current state in the range:&lt;br /&gt;
&lt;br /&gt;
* 0 to 1.5 = idle&lt;br /&gt;
* 1.5 to 6 = observant&lt;br /&gt;
* 6 to 8 = suspicious&lt;br /&gt;
* 8 to 18 = searching&lt;br /&gt;
* 18 to 23 = agitated searching&lt;br /&gt;
&lt;br /&gt;
So if the AI is already suspicious (say 7) then notices an object missing which had &#039;&#039;absence_alert_increase 4&#039;&#039; on it then the AI state will now be 11 and it will start searching.&lt;br /&gt;
 &lt;br /&gt;
If this property is not set then the AI&#039;s alert level will be set to a default of just below agitated searching.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Editing]]&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Virtual_Darkness&amp;diff=26788</id>
		<title>Virtual Darkness</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Virtual_Darkness&amp;diff=26788"/>
		<updated>2020-12-11T07:39:36Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: Deleted section on virtual ambient light as this is no longer relevant.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;written by Fidcal&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The &#039;&#039;&#039;[[Location Settings]]&#039;&#039;&#039; article shows you an easy-to-use and general system to get different ambient light levels and colors for each location/zone the player is in. Since this system also covers different ambient sounds and script calls at zone boundaries, you should really use it.&lt;br /&gt;
&lt;br /&gt;
This article here is just a general introduction into &amp;quot;ambient light settings&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Being a stealth game system and as its name implies, most Dark Mod missions will take place at night and require darkness as cover. Generally, absolute blackness is unpopular in this type of game and is not recommended. It can make navigation difficult, uncomfortable, and gives an impoverished visual display. Instead, very low ambient light is used to represent blackness. We call this virtual darkness. This main ambient light should not be so dark that the player cannot make out some detail of nearby surfaces textures. Yet because it represents complete darkness it should not be so light that it seems strange that in-game characters cannot see you (see later.)&lt;br /&gt;
&lt;br /&gt;
Ambient light can be coloured to provide atmosphere and realism depending on the environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Brightness Standard ==&lt;br /&gt;
&lt;br /&gt;
From Release 1, The Dark Mod includes a test map (may be included in a trainer mission.) for both players and mappers to standardise their gamma and brightness settings. I emphasise that this does &#039;&#039;&#039;not&#039;&#039;&#039; force all missions to be the exact same brightness. What it does is provide a standard setting so everyone can know what a particular mission is intended to look like. If a player then prefers to generally have their settings darker or brighter then at least they know. Likewise, if a mapper wants to produce a darker or brighter mission then they are free to do so but at least they will not do it without knowing. The advantages of all this is that in most cases players will not have to keep fiddling with the brightness setting for every individual mission.&lt;br /&gt;
&lt;br /&gt;
==Ambient Light==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike normal lights, ambient light does not by default fade to the edge of its radius but is the same constant brightness throughout. Rich variation of fading or patterning can be introduced with a light texture. For general use, ambientLightnfo is recommended as it has no patterning and so its brightness is consistent throughout its volume. Regard it as the one to use by default.&lt;br /&gt;
&lt;br /&gt;
The main ambient light &#039;&#039;&#039;ambient_world&#039;&#039;&#039; illuminates the player like a regular light.  If you&#039;re using the recommended &#039;&#039;&#039;low level of 6&#039;&#039;&#039;, there should only be a negligible effect.  The AI characters will not see the player too easily, the lightgem will provide a bonus for crouching, and thus complete darkness is simulated without blinding the player.&lt;br /&gt;
&lt;br /&gt;
Mappers are not bound to an ambient_world of 6 though, higher settings are possible.  Settings of 7 or 8 are not all that visually different from a setting of 6 to the player though, so a player might find that the AI are reacting too quickly, and spotting the player far too easily...even though it feels like they are lit the same as they were in the previous mission with a 6 ambient_world.  In these cases, the arg &#039;&#039;&#039;lightgem_adjust&#039;&#039;&#039; can be applied to any piece of &#039;&#039;&#039;worldspawn&#039;&#039;&#039; to offset the lightgem and bring balance back to the gameplay.  For an &#039;&#039;&#039;ambient_world&#039;&#039;&#039; setting of 7, a lightgem_adjust setting of &#039;&#039;&#039;-1&#039;&#039;&#039; should be sufficient. For ambient_world of 8, a lightgem_adjust of &#039;&#039;&#039;-1.5&#039;&#039;&#039;.  If a mapper wanted to go as high as an ambient_world of 9, a lightgem_adjust of -2 would be required.  Ambient_world of 10 and above should not be offset as this is entering a realm where the brightness is not believable for hiding. &lt;br /&gt;
&lt;br /&gt;
Other local ambient lights can be used to produce highlights, mood, or any purpose the mapper can imagine so can be any brightness.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Enabling Virtual Ambient Light==&lt;br /&gt;
&lt;br /&gt;
All that mappers need to do to allow players to select virtual ambient light is to name their main ambient light &#039;&#039;&#039;&amp;quot;ambient_world&amp;quot;&#039;&#039;&#039;. That&#039;s it. If the player selects this feature then Dark Mod takes the color/brightness values of that light and passes it to all the textures then switches off that ambient light. It is therefore important for mappers to do this to provide the best performance for players with slower machines.&lt;br /&gt;
&lt;br /&gt;
Note: Some special materials have a background texture plus detail that is only visible with a real ambient light, for example, darkmod/stone/sculpted/corpse. The mapper can place normal lights or local ambient light for those surfaces where possible or leave them with their background texture.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* The [[Location Settings]] article.&lt;br /&gt;
&lt;br /&gt;
{{tutorial-lighting}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Ambient Light]]&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Virtual_Ambient_Light_Textures&amp;diff=26787</id>
		<title>Virtual Ambient Light Textures</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Virtual_Ambient_Light_Textures&amp;diff=26787"/>
		<updated>2020-12-11T07:35:24Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Edited by peter_spy, 2020&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
As of TDM 2.08 none of the below is needed, as TDM uses ambient lights to calculate this instead of textures. The option to switch between this and legacy system is no longer in the menu, but you can type &#039;&#039;&#039;tdm_ambient_method 0&#039;&#039;&#039; in the game console to make sure you use the correct system.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;OLD VERSION:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
To improve performance on some low-end systems, Dark Mod textures can simulate the main ambient light. This feature pre-calculates how much textures should be illuminated once only instead of continuously. Players can select between three methods for ambient rendering, so those with faster machines can use the true ambient light which gives better quality.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;So all textures should include these two stages:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Please note that there is also a command for automatically converting all materials to fulfill the TDM 1.03 requirements called tdm_batchConvertMaterials (see [[TDM Material Batch Conversion]])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        // TDM Ambient Method Related&lt;br /&gt;
        {&lt;br /&gt;
                if (global5 == 1)&lt;br /&gt;
                blend add&lt;br /&gt;
                map                     textures/darkmod/yourname                         // Diffuse&lt;br /&gt;
                scale                   1, 1&lt;br /&gt;
                red                     global2&lt;br /&gt;
                green                   global3&lt;br /&gt;
                blue                    global4&lt;br /&gt;
        }&lt;br /&gt;
       &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first stage is for the simple ambient method, whereas the second one is for enhanced ambient rendering, which obviously also processes the normal- and specularmap of the material.&lt;br /&gt;
&lt;br /&gt;
If a material does not contain a specularmap, the fragmentMap parameter 3 in the enhanced ambient rendering stage has to be changed to _black, e.g. &amp;quot;textures/darkmod/yourname_s&amp;quot; becomes &amp;quot;_black&amp;quot;. If on the contrary a material does not contain a normalmap, the proper replacement is &amp;quot;_flat&amp;quot;, meaning a flat surface, e.g. &amp;quot;textures/darkmod/yourname_local&amp;quot; becomes &amp;quot;_flat&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For [[DrVertexBlend (tutorial)|vertex-blended materials]], the ambient stages have to be altered in the following way:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        // TDM Ambient Method Related &lt;br /&gt;
	{							&lt;br /&gt;
		if (global5 == 1)		&lt;br /&gt;
		blend add				&lt;br /&gt;
		map			textures/darkmod/materialA                         // Diffuse A&lt;br /&gt;
		scale			1, 1		&lt;br /&gt;
		red			global2	&lt;br /&gt;
		green			global3	&lt;br /&gt;
		blue			global4	&lt;br /&gt;
		vertexColor				&lt;br /&gt;
	}							&lt;br /&gt;
	{							&lt;br /&gt;
		if (global5 == 1)		&lt;br /&gt;
		blend add				&lt;br /&gt;
		map			textures/darkmod/materialB                         // Diffuse B&lt;br /&gt;
		scale			1, 1		&lt;br /&gt;
		red			global2	&lt;br /&gt;
		green			global3	&lt;br /&gt;
		blue			global4	&lt;br /&gt;
		inverseVertexColor		&lt;br /&gt;
	}							&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
AS OF TDM 2.0 the old Enhanced Ambient Stages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{							&lt;br /&gt;
		if (global5 == 2)		&lt;br /&gt;
		blend add				&lt;br /&gt;
		program	ambientEnvVertexBlend.vfp	&lt;br /&gt;
		vertexParm		0		1, 1, 1, 1		          // UV Scales for Diffuse A and Bump A	resp.	&lt;br /&gt;
		vertexParm		1		1, 1, 1, 1		          // UV Scale for specular A and Diffuse B resp.&lt;br /&gt;
		vertexParm		2		1, 1, 1, 1		          // UV Scale for Bump B and specular B resp.	&lt;br /&gt;
		vertexParm		3		global2, global3, global4, 1	&lt;br /&gt;
		//----------- VertexColored -------------------			&lt;br /&gt;
		fragmentMap		0		cubeMap env/gen1				&lt;br /&gt;
		fragmentMap		1		textures/darkmod/materialA_local  // Bump A			&lt;br /&gt;
		fragmentMap		2		textures/darkmod/materialA	  // Diffuse A&lt;br /&gt;
		fragmentMap		3		textures/darkmod/materialA_s	  // Specular A		&lt;br /&gt;
		//----------- InverseVertexColored ------------			&lt;br /&gt;
		fragmentMap		4		textures/darkmod/materialB_local  // Bump B		&lt;br /&gt;
		fragmentMap		5		textures/darkmod/materialB	  // Diffuse B		&lt;br /&gt;
		fragmentMap		6		textures/darkmod/materialB_s	  // Specular B&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
are &#039;&#039;&#039;no longer needed&#039;&#039;&#039; as the Ambient light now has it&#039;s own dedicated render path.&lt;br /&gt;
&lt;br /&gt;
[[Category:Textures]]&lt;br /&gt;
[[Category:Ambient Light]]&lt;br /&gt;
[[Category:Lighting]]&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Virtual_Ambient_Light_Textures&amp;diff=26786</id>
		<title>Virtual Ambient Light Textures</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Virtual_Ambient_Light_Textures&amp;diff=26786"/>
		<updated>2020-12-11T07:31:16Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: This is no longer needed.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As of TDM 2.08 none of the below is needed, as TDM uses ambient lights to calculate this instead of textures. The option to switch between this and legacy system is no longer in the menu, but you can type &#039;&#039;&#039;tdm_ambient_method 0&#039;&#039;&#039; in the game console to make sure you use the correct system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;OLD VERSION:&#039;&#039;&#039;&lt;br /&gt;
To improve performance on some low-end systems, Dark Mod textures can simulate the main ambient light. This feature pre-calculates how much textures should be illuminated once only instead of continuously. Players can select between three methods for ambient rendering, so those with faster machines can use the true ambient light which gives better quality.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;So all textures should include these two stages:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Please note that there is also a command for automatically converting all materials to fulfill the TDM 1.03 requirements called tdm_batchConvertMaterials (see [[TDM Material Batch Conversion]])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        // TDM Ambient Method Related&lt;br /&gt;
        {&lt;br /&gt;
                if (global5 == 1)&lt;br /&gt;
                blend add&lt;br /&gt;
                map                     textures/darkmod/yourname                         // Diffuse&lt;br /&gt;
                scale                   1, 1&lt;br /&gt;
                red                     global2&lt;br /&gt;
                green                   global3&lt;br /&gt;
                blue                    global4&lt;br /&gt;
        }&lt;br /&gt;
       &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first stage is for the simple ambient method, whereas the second one is for enhanced ambient rendering, which obviously also processes the normal- and specularmap of the material.&lt;br /&gt;
&lt;br /&gt;
If a material does not contain a specularmap, the fragmentMap parameter 3 in the enhanced ambient rendering stage has to be changed to _black, e.g. &amp;quot;textures/darkmod/yourname_s&amp;quot; becomes &amp;quot;_black&amp;quot;. If on the contrary a material does not contain a normalmap, the proper replacement is &amp;quot;_flat&amp;quot;, meaning a flat surface, e.g. &amp;quot;textures/darkmod/yourname_local&amp;quot; becomes &amp;quot;_flat&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For [[DrVertexBlend (tutorial)|vertex-blended materials]], the ambient stages have to be altered in the following way:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        // TDM Ambient Method Related &lt;br /&gt;
	{							&lt;br /&gt;
		if (global5 == 1)		&lt;br /&gt;
		blend add				&lt;br /&gt;
		map			textures/darkmod/materialA                         // Diffuse A&lt;br /&gt;
		scale			1, 1		&lt;br /&gt;
		red			global2	&lt;br /&gt;
		green			global3	&lt;br /&gt;
		blue			global4	&lt;br /&gt;
		vertexColor				&lt;br /&gt;
	}							&lt;br /&gt;
	{							&lt;br /&gt;
		if (global5 == 1)		&lt;br /&gt;
		blend add				&lt;br /&gt;
		map			textures/darkmod/materialB                         // Diffuse B&lt;br /&gt;
		scale			1, 1		&lt;br /&gt;
		red			global2	&lt;br /&gt;
		green			global3	&lt;br /&gt;
		blue			global4	&lt;br /&gt;
		inverseVertexColor		&lt;br /&gt;
	}							&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
AS OF TDM 2.0 the old Enhanced Ambient Stages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{							&lt;br /&gt;
		if (global5 == 2)		&lt;br /&gt;
		blend add				&lt;br /&gt;
		program	ambientEnvVertexBlend.vfp	&lt;br /&gt;
		vertexParm		0		1, 1, 1, 1		          // UV Scales for Diffuse A and Bump A	resp.	&lt;br /&gt;
		vertexParm		1		1, 1, 1, 1		          // UV Scale for specular A and Diffuse B resp.&lt;br /&gt;
		vertexParm		2		1, 1, 1, 1		          // UV Scale for Bump B and specular B resp.	&lt;br /&gt;
		vertexParm		3		global2, global3, global4, 1	&lt;br /&gt;
		//----------- VertexColored -------------------			&lt;br /&gt;
		fragmentMap		0		cubeMap env/gen1				&lt;br /&gt;
		fragmentMap		1		textures/darkmod/materialA_local  // Bump A			&lt;br /&gt;
		fragmentMap		2		textures/darkmod/materialA	  // Diffuse A&lt;br /&gt;
		fragmentMap		3		textures/darkmod/materialA_s	  // Specular A		&lt;br /&gt;
		//----------- InverseVertexColored ------------			&lt;br /&gt;
		fragmentMap		4		textures/darkmod/materialB_local  // Bump B		&lt;br /&gt;
		fragmentMap		5		textures/darkmod/materialB	  // Diffuse B		&lt;br /&gt;
		fragmentMap		6		textures/darkmod/materialB_s	  // Specular B&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
are &#039;&#039;&#039;no longer needed&#039;&#039;&#039; as the Ambient light now has it&#039;s own dedicated render path.&lt;br /&gt;
&lt;br /&gt;
[[Category:Textures]]&lt;br /&gt;
[[Category:Ambient Light]]&lt;br /&gt;
[[Category:Lighting]]&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=How_to_add_Textures_to_The_Dark_Mod&amp;diff=26785</id>
		<title>How to add Textures to The Dark Mod</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=How_to_add_Textures_to_The_Dark_Mod&amp;diff=26785"/>
		<updated>2020-12-11T07:25:06Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: /* Create your Shader Definition (Material) */ - removed the section about ambient textures&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Create your texture ==&lt;br /&gt;
This is mostly artwork. Be sure to start off with useful raw material with a reasonably high resolution.  Where possible, work from photo-references. A basic guide can be found here: [[Texture Creation - Basic Tutorial]].&lt;br /&gt;
&lt;br /&gt;
A few things to remember:  Make sure your texture dimensions are a power of 2 (eg, 128, 256, 512, 1024, etc).  Other common mistakes can be found here:  [[Common Texture Mistakes]]&lt;br /&gt;
{{Things-To-Remember|&lt;br /&gt;
* Use good source material&lt;br /&gt;
* All image dimensions must be powers of two: 64, 128, 256, 512, 1024 (don&#039;t go beyond 1024).&lt;br /&gt;
* Avoid lighting baked into the diffusemap&lt;br /&gt;
* Keep your PSD/Gimp working version safe!}}&lt;br /&gt;
== Save your Texture in the correct Format == &lt;br /&gt;
Save the diffusemap, the normalmap and an optional specularmap to a TGA file. The &#039;&#039;&#039;[[Texture Guidelines]]&#039;&#039;&#039; will help you choosing the correct resolution. A TGA version of your diffusemap is supposed to be uploaded to our hi-res repository for future reference (see below).&lt;br /&gt;
&lt;br /&gt;
Once your TGA file is saved, you will have to create DDS files for the diffuse and specular (not the normalmap) as well. These are smaller in size and can be loaded faster by the engine. Follow the &#039;&#039;&#039;[[DDS creation]]&#039;&#039;&#039; guide to learn how to create the DDS files in the correct formats.&lt;br /&gt;
&lt;br /&gt;
Also, create an editor image out of your diffusemap. The editor image dimension should be 256x256 pixels and the file should be saved in the JPG format. Add the &#039;&#039;&#039;_ed&#039;&#039;&#039; postfix to the filename name (like &amp;lt;code&amp;gt;mytexture_ed.jpg&amp;lt;/code&amp;gt;).&lt;br /&gt;
{{Things-To-Remember|&lt;br /&gt;
* Most textures don&#039;t need speculars&lt;br /&gt;
* Create DDS for your diffusemap and specularmap.&lt;br /&gt;
* Keep TGA version of your diffusemap and specularmap.&lt;br /&gt;
* Create a TGA version of your normalmap (uncompressed, no RLE).&lt;br /&gt;
* Create a JPG editor image (max. 256px)}}&lt;br /&gt;
== Name your Texture ==&lt;br /&gt;
The following convention should be used for naming all new texture additions to TDM (many existing textures do not follow this convention, and over time effort will be made to update them).  The goal is consistency among material names based on ordered characteristics.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Some or all&#039;&#039;&#039; of the following may apply to any given material:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Object Type&#039;&#039;&#039; descriptor first (mostly for very specific-use textures) - it&#039;s a window, a door, a chest...&lt;br /&gt;
# &#039;&#039;&#039;Material&#039;&#039;&#039; descriptor next - made from marble, wood, mud...&lt;br /&gt;
# &#039;&#039;&#039;Size&#039;&#039;&#039; descriptor next - it is large, small...&lt;br /&gt;
# &#039;&#039;&#039;Quality&#039;&#039;&#039; descriptors next - texture-wise, it is rough, new, cracked...&lt;br /&gt;
# &#039;&#039;&#039;Color&#039;&#039;&#039; descriptors next - what color is it? red, green...&lt;br /&gt;
# &#039;&#039;&#039;Number Increment&#039;&#039;&#039; next - which of the list is it? 001, 002...&lt;br /&gt;
# &#039;&#039;&#039;Tiling&#039;&#039;&#039; and &#039;&#039;&#039;Image Type&#039;&#039;&#039; descriptors, if needed (file only, not material definition - see below)&lt;br /&gt;
&lt;br /&gt;
If establishing precedent (creating a new &#039;&#039;&#039;Size&#039;&#039;&#039; descriptor, e.g., &amp;quot;huge&amp;quot;), try to avoid ambiguity and unnecessary overlapping with other descriptors (e.g., &amp;quot;enormous&amp;quot;), and set a good example others will follow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Examples:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1.  &#039;&#039;slate_large_cracked_grey_001&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This name omits an &#039;&#039;&#039;Object Type&#039;&#039;&#039; descriptor, instead starting with the &#039;&#039;&#039;Material&#039;&#039;&#039; descriptor - it is a general, non-specialized texture.&lt;br /&gt;
&lt;br /&gt;
Why is this preferred? Some existing materials are named by quality descriptor first (e.g., &#039;cracked_slate...&#039;). This is an inconvenience for the user, because they were looking for a &#039;slate&#039;, not a &#039;cracked&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.  &#039;&#039;door_wood_battered_005&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This name omits a &#039;&#039;&#039;Size&#039;&#039;&#039; descriptor and a &#039;&#039;&#039;Color&#039;&#039;&#039; descriptor.&lt;br /&gt;
&lt;br /&gt;
Why is this preferred? In the case of a model name (which this convention also covers), or a specific object type texture like the above, some existing assets are named by quality descriptor first (e.g., &#039;battered_wood...&#039;). This is an inconvenience for the user, because they were looking for a &#039;door&#039;, not a &#039;battered&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Be sure to rename all your DDS file extensions to a &#039;&#039;&#039;lowercase&#039;&#039;&#039; &#039;&#039;&#039;.dds&#039;&#039;&#039; (the Compressonator always creates files with uppercase extension, TDM requires them to be lowercase).&lt;br /&gt;
&lt;br /&gt;
If your texture tiles only in one direction, include the phrase &#039;&#039;&#039;tiling_1d&#039;&#039;&#039; at the end of the name.  If your texture does not tile (repeat) at all, add the phrase &#039;&#039;&#039;nontiling&#039;&#039;&#039;. So, a normalmap could be names as &#039;&#039;&#039;concrete_dirt01_tiling1d_local.tga&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Diffusemaps should have no extension to their name.  Normalmaps should have a &#039;&#039;&#039;_local&#039;&#039;&#039; extension at the end of their name.  Specular maps should have a  &#039;&#039;&#039;_s&#039;&#039;&#039; extension, the editor images go with an &#039;&#039;&#039;_ed&#039;&#039;&#039; extension.&lt;br /&gt;
{{Things-To-Remember|&lt;br /&gt;
* Choose descriptive names for your texture, while following TDM convention&lt;br /&gt;
* Add the suffix &#039;&#039;&#039;tiling_1d&#039;&#039;&#039;/&#039;&#039;&#039;nontiling&#039;&#039;&#039; to the filename where appropriate&lt;br /&gt;
* Diffusemap: &#039;&#039;&#039;mytexture.dds&#039;&#039;&#039; (note the &#039;&#039;&#039;lowercase&#039;&#039;&#039;)&lt;br /&gt;
* Normalmap: &#039;&#039;&#039;mytexture_local.tga&#039;&#039;&#039;&lt;br /&gt;
* Editor image: &#039;&#039;&#039;mytexture_ed.jpg&#039;&#039;&#039; (max. 256 pixels in size)&lt;br /&gt;
* (Optional) Specularmap: &#039;&#039;&#039;mytexture_s.dds&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
== Move the Texture to the right Location ==&lt;br /&gt;
When you upload textures, be sure to upload the files to the right spot. The &#039;&#039;&#039;[[Texture Folder Structure]]&#039;&#039;&#039; can help you finding the right folder for your texture.&lt;br /&gt;
&lt;br /&gt;
The .dds diffuse and specular go in the &#039;&#039;&#039;dds/textures/&#039;&#039;&#039; folder structure.  The .tga normalmap goes in the &#039;&#039;&#039;textures/&#039;&#039;&#039; folder structure. Also, the texture may not render properly unless it&#039;s nested inside &amp;quot;../textures/darkmod/..&amp;quot; and for a custom texture (only for FM use) you should use &amp;quot;../textures/darkmod/your_texture_folder&amp;quot; in both the parent Darkmod folder (for mapping) and the same folder structure inside your pk4 (for release). &lt;br /&gt;
&lt;br /&gt;
Note: At one time, the Doom 3 engine and early TDM could not load DDS textures that were more than five folders deep. The deepest level allowed would be something along the lines of dds/textures/darkmod/door/metal/. This is no longer the case.&lt;br /&gt;
{{Things-To-Remember|&lt;br /&gt;
* Move the DDS textures into the &#039;&#039;&#039;dds/textures/...&#039;&#039;&#039; tree.&lt;br /&gt;
* Move the TGA and JPG files into the &#039;&#039;&#039;textures/...&#039;&#039;&#039; tree.}}&lt;br /&gt;
&lt;br /&gt;
== Create your Shader Definition (Material) ==&lt;br /&gt;
Your material entry should be added to the .mtr file that has the same name as the folder your texture is saved in.  For example, the material entry for a texture saved in &#039;&#039;&#039;textures/darkmod/wood/panels&#039;&#039;&#039; should be saved in the .mtr file, &#039;&#039;&#039;tdm_wood_panels.mtr&#039;&#039;&#039;. See also the [[Material File Naming Convention]].&lt;br /&gt;
&lt;br /&gt;
You should name your material entry the same name as your diffuse texture, including the folder path structure (eg, &amp;quot;textures/darkmod/wood/panels/rectangle_oak_face&amp;quot;).  (Do not add .tga or .dds to the end, and also skip the dds/ folder prefix.)&lt;br /&gt;
&lt;br /&gt;
The only exception is when multiple shaders are using the same diffusemap, or when your texture doesn&#039;t tile (or tiles in only one direction).  In the latter case, you would add &#039;&#039;&#039;/nontiling/&#039;&#039;&#039; or &amp;quot;/tiling_1d/&#039;&#039;&#039; to the end of the shader folder (a &#039;virtual&#039; folder, essentially).  &#039;&#039;(The textures used to be separated like that in the actual folder structure, but due to D3&#039;s inability to read .dds files five folders deep, they had to be moved.)&#039;&#039;&lt;br /&gt;
{{Things-To-Remember|&lt;br /&gt;
* Create your shader in the correct file (tdm_xxx_yyy.mtr) following the [[Material File Naming Convention]]&lt;br /&gt;
* The shader name for tiling textures is the same as the diffusemap&lt;br /&gt;
* Nontiling/tiling_1d textures go into a &amp;quot;virtual&amp;quot; subfolder nontiling/ or tiling_1d/&lt;br /&gt;
* You don&#039;t need to specify file extensions (.dds/.tga/.jpg) to the material defs, this is automatically guessed by the engine.&lt;br /&gt;
* You don&#039;t need the &#039;&#039;&#039;dds/&#039;&#039;&#039; folder prefix to reference the DDS textures.&lt;br /&gt;
* Be sure to include the frob highlight code (see [[Basic Material File#Add_the_Frob_Highlight_Stage|Basic Material File]])&lt;br /&gt;
&lt;br /&gt;
== Upload the Textures == &lt;br /&gt;
Once, you have checked your texture in-game (and are pleased with the results), you&#039;ll need to upload the files to our SVN repository. This requires that you have a valid username/password for SVN, which you can request from sparhawk.&lt;br /&gt;
&lt;br /&gt;
The .tga of the diffuse and specular is needed as well in case we ever want to make modifications to the texture or new textures based on the old.  Opening and resaving .dds files results in loss of detail, so all new versions of textures should be made from the .tga files. So, additional to the textures needed for the engine and editor (diffuse/normal/specular/editorimage) you&#039;re encouraged to upload the uncompressed textures to the hires repository.&lt;br /&gt;
&lt;br /&gt;
The hires repository is located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;https://&amp;lt;InsertDarkmodServerHere&amp;gt;/svn/darkmod_hires/trunk/tga_backup/&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. As only diffuse/speculars are compressed in DDS format, these are the only two that need to be uploaded in TGA format. The TGA files should be named just like the DDS versions and should be located in the analogous folder than they are in the main repository, but below the tga_backup/ folder. For instance tga_backup/textures/darkmod/stone/etc. &lt;br /&gt;
&lt;br /&gt;
The hires TGA can be RLE-compressed to save some space, but this is not too important. Uncompressed TGAs are only important for the textures used by the engine itself.&lt;br /&gt;
&lt;br /&gt;
As last part, it would be nice to have the actual working versions (Photoshop/Gimp source files) stored on the server too. This is of course a large upload, but having the source files is very valuable. For this purpose, there is another repository &#039;&#039;&#039;texture_src&#039;&#039;&#039; installed at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;https://&amp;lt;InsertDarkmodServerHere&amp;gt;/svn/texture_src/&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
{{Things-To-Remember|&lt;br /&gt;
* Upload the diffuse, normal, (specular,) and editor image to the regular darkmod SVN.&lt;br /&gt;
* Upload the (RLE-compressed) TGA diffusemap and specularmap to the darkmod_hires SVN repository (into the &#039;&#039;&#039;tga_backup&#039;&#039;&#039; subfolder).&lt;br /&gt;
* Upload the working source file (PSD/Gimp) to the &#039;&#039;&#039;texture_src&#039;&#039;&#039; repository.}}&lt;br /&gt;
{{tutorial-textures}}&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Textures&amp;diff=26784</id>
		<title>Textures</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Textures&amp;diff=26784"/>
		<updated>2020-12-11T07:23:51Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: /* Material Files */ - deleted the info about virtual ambient textures as they&amp;#039;re no longer needed.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{index-page|category=Textures|topic=textures}}&lt;br /&gt;
This page contains articles and links related to making/importing textures, editing .mtr files and others related to the mod.&lt;br /&gt;
&lt;br /&gt;
== Making Textures ==&lt;br /&gt;
* [[Texture Creation - Basic Tutorial]]&lt;br /&gt;
* [[DDS creation]]&lt;br /&gt;
* &#039;&#039;&#039;[[How to add Textures to The Dark Mod]]&#039;&#039;&#039; &#039;&#039;-- (Overall Information and Guides)&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;[[Texture Guidelines]]&#039;&#039;&#039;  &#039;&#039;-- (Info on our hi-res repository, and what sizes to use for textures)&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;[[Texture Folder Structure]]&#039;&#039;&#039;  &#039;&#039;-- (Where to save new textures)&#039;&#039;&lt;br /&gt;
* Basic Texture Information:  http://www.modwiki.net/wiki/Texturing&lt;br /&gt;
* [[Common Texture Mistakes]]&lt;br /&gt;
* [[Texture Sources]] &#039;&#039;-- (Good places to find source textures and photos)&#039;&#039;&lt;br /&gt;
* [[How to give Textures a nice Glow]]&lt;br /&gt;
=== Diffusemaps ===&lt;br /&gt;
* [[Advanced Tips for Creating Diffusemaps]]&lt;br /&gt;
* [[Remove Shadows in Source Images]]&lt;br /&gt;
=== Normalmaps ===&lt;br /&gt;
* [[Normalmaps, How to Make Good Ones]]&lt;br /&gt;
* [[No more Heightmaps]]  &#039;&#039;-- (Basic info for turning a heightmap into a normalmap)&#039;&#039;&lt;br /&gt;
* [[Wall Texture Tutorial]] &#039;&#039;-- (How to make good normalmaps with Maya)&#039;&#039;&lt;br /&gt;
* [[Creating Textures with Normals out of Models]]  &#039;&#039;-- (More info on using modeling software to make normalmaps)&#039;&#039;&lt;br /&gt;
* [[Inverse Normalmaps]]  &#039;&#039;-- (A way to check if your normalmaps are correct)&#039;&#039;&lt;br /&gt;
* [[Inverting Normalmaps]] &#039;&#039;-- (How to fix them if they aren&#039;t correct)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Material Files ==&lt;br /&gt;
&#039;&#039;(Material files tell D3 what to do with your texture images. Without one, your texture will not work)&#039;&#039;&lt;br /&gt;
* [[Basic Material File]]  &#039;&#039;-- (How to get a new texture in game)&#039;&#039;&lt;br /&gt;
* [[Surface Types]] &#039;&#039;-- (How to tell the engine whether your surface is stone, wood, grass, etc)&#039;&#039;&lt;br /&gt;
* [[Making Semi-transparent textures]]&lt;br /&gt;
* [[Detail Textures]]&lt;br /&gt;
* [[TDM Material Batch Conversion]] &#039;&#039;-- (Automatically convert materials to support the changes of TDM 1.03)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Textures for Models ==&lt;br /&gt;
* [[Creating Multiple Skins For A Model]] &#039;&#039;-- (How to swap different textures on the same model)&#039;&#039;&lt;br /&gt;
* [[DrVertexBlend (tutorial)]] &#039;&#039;-- (How to create smooth transitions between textures: Vertex Blending)&#039;&#039;&lt;br /&gt;
* [[Turning Shadows Off]]  &#039;&#039; -- (How to turn shadows off to varying degrees)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Other ==&lt;br /&gt;
* [[Fast Re-Texturing of your Map]]&lt;br /&gt;
* [[Grey Border Around Transparent GUI]]  &#039;&#039;-- (sometimes transparent .tgas have an unwanted grey border)&#039;&#039;&lt;br /&gt;
* [[How To Make Your Own Visportal-texture]]&lt;br /&gt;
&lt;br /&gt;
{{textures}}&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Material_Files&amp;diff=26783</id>
		<title>Material Files</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Material_Files&amp;diff=26783"/>
		<updated>2020-12-11T07:22:13Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: /* Full example */ - typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Original_Reference|Fingernail &amp;amp; greebo|127}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- keywords for search: surftype --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What the Heck is a Material File? ==&lt;br /&gt;
The material files (.mtr) contain lists of &#039;material definitions&#039; that tell the engine where to find the source files for the specified textures and what features it should have. All material files should be located in the &#039;&#039;&#039;darkmod/materials&#039;&#039;&#039; folder and have the extension &#039;&#039;&#039;.mtr&#039;&#039;&#039;.  &lt;br /&gt;
&lt;br /&gt;
In fact, it&#039;s the material (=shader) which gets applied to surfaces of brushes, patches and models, not the actual TGA/DDS texture image. A TGA file cannot be applied to surfaces, it&#039;s the shader name which gets used.&lt;br /&gt;
&lt;br /&gt;
 Polygons ==&amp;gt; Shader ==&amp;gt; Image(s) + Processing =&amp;gt; Appearance&lt;br /&gt;
&lt;br /&gt;
Material definitions apply to a single &#039;texture&#039;, though it may be made up of multiple texture files blended together.  A simple material definition looks like this:&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
    qer_editorimage  textures/darkmod/custom/redbrick_ed&lt;br /&gt;
    diffusemap       textures/darkmod/custom/redbrick     &lt;br /&gt;
    bumpmap          textures/darkmod/custom/redbrick_local  &lt;br /&gt;
    specularmap      textures/darkmod/custom/redbrick_s     &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you&#039;re using the &#039;&#039;material&#039;&#039; called &#039;&#039;&#039;textures/darkmod/stone/brick/redbrick_with_mortar&#039;&#039;&#039; in your map, Doom looks up the name in the material definition and loads the according image files (as specified by the [[Map Expressions]]). Note that you &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; need to specify the file extension, the engine is automatically adding it (depending on your quality setting) and finds the according texture file. You also don&#039;t need to include the &#039;&#039;&#039;dds/&#039;&#039;&#039; prefix in the path, this is also added automatically.&lt;br /&gt;
&lt;br /&gt;
A single material file contains lots of material definitions. This is useful as textures that logically belong to each other are summarized in one material file (e.g. &#039;&#039;&#039;materials/tdm_stone_brick.mtr&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
The .mtr files are read upon launching Doom 3 - changing your material file therefore requires either restarting Doom or typing &#039;&#039;&#039;reloadDecls&#039;&#039;&#039; in the console.&lt;br /&gt;
&lt;br /&gt;
== Create a new Texture Definition ==&lt;br /&gt;
Provided you already saved your texture source file (the .tga or .dds) in the appropriate folder, you can go on and create your texture definition.  You cannot use your textures without this step.&lt;br /&gt;
&lt;br /&gt;
Open up or create your personal material file with a text editor.  There are existing guidelines for where texture definitions should go, for the sake of organization, but the engine doesn&#039;t care what the filename is as long as it&#039;s in the materials folder and has a .mtr extension.   &lt;br /&gt;
&lt;br /&gt;
First, specify the name of your new material. If it is not a model texture, then the name should include the path to the texture files used.  Example:&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Do not use special characters for your shader name or The Dark Mod parser might complain (e.g. no &amp;quot;&amp;amp;&amp;quot; (ampersand) or &amp;quot;-&amp;quot; (dash) characters, etc.)&lt;br /&gt;
&lt;br /&gt;
Then, open up a squiggly bracket ({), and start to fill in the texture paths as below, changing the paths and names for your texture.&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
     qer_editorimage  textures/darkmod/stone/brick/redbrick_with_mortar_ed      // editor image&lt;br /&gt;
     diffusemap       textures/darkmod/stone/brick/redbrick_with_mortar         // diffuse map&lt;br /&gt;
     bumpmap           textures/darkmod/stone/brick/redbrick_with_mortar_local  // normal map&lt;br /&gt;
     specularmap      textures/darkmod/stone/brick/redbrick_with_mortar_s       // specular map&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Close the definition with a close squiggly bracket (}).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If there is no specular map then substitute &#039;&#039;&#039;_black&#039;&#039;&#039;, and if there is no bumpmap then use &#039;&#039;&#039;_flat&#039;&#039;&#039; instead.&lt;br /&gt;
&lt;br /&gt;
Save the file. Now you can load your new texture in [[DarkRadiant]] provided you did it all correctly.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can also have a look a the existing material files and learn from them.&lt;br /&gt;
&lt;br /&gt;
== Add the Frob Highlight Stage ==&lt;br /&gt;
&lt;br /&gt;
All materials need to have a conditional shader stage added to let the material highlight when the objects are frobbed. The technical details are of minor interest here, just copy and paste such a stage from other materials and adjust the diffusemap and bumpmap references.&lt;br /&gt;
&lt;br /&gt;
== Full example ==&lt;br /&gt;
&lt;br /&gt;
Here is the full example with the final material definition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
    // Use on of the predefined surface types like:&lt;br /&gt;
    // none, metal, stone, flesh, glass, wood&lt;br /&gt;
    stone&lt;br /&gt;
&lt;br /&gt;
    // Or use &amp;quot;surftype15&amp;quot; and add the surface type as the first (or only) word of the description,&lt;br /&gt;
    // the following are possible:&lt;br /&gt;
    // tile, carpet, dirt, gravle, grass, rock, twigs, foliage, sand, mud, brokeglass, snow, ice, squeakboard,&lt;br /&gt;
    // puddle, moss, cloth, ceramic, slate, straw, armor_leath, armor_chain, armor_plate, climbable, paper, hardwood&lt;br /&gt;
&lt;br /&gt;
    //surftype15&lt;br /&gt;
    //description &amp;quot;carpet This is a carpet texture.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    qer_editorimage  textures/darkmod/stone/brick/redbrick_with_mortar_ed&lt;br /&gt;
    bumpmap          textures/darkmod/stone/brick/redbrick_with_mortar_local&lt;br /&gt;
    diffusemap       textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
    specularmap      textures/darkmod/stone/brick/redbrick_with_mortar_s&lt;br /&gt;
 &lt;br /&gt;
    // This is the code required for frob highlighting this texture&lt;br /&gt;
    {&lt;br /&gt;
        if ( parm11 &amp;gt; 0 )&lt;br /&gt;
        blend       gl_dst_color, gl_one&lt;br /&gt;
        map         _white.tga&lt;br /&gt;
        rgb         0.40 * parm11&lt;br /&gt;
    }&lt;br /&gt;
    {&lt;br /&gt;
        if ( parm11 &amp;gt; 0 )&lt;br /&gt;
        blend       add&lt;br /&gt;
        map         textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
        rgb         0.15 * parm11&lt;br /&gt;
    }   &lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As of TDM 2.08, none of the ambient stages are needed, so both this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        // TDM Ambient Method Related&lt;br /&gt;
        {&lt;br /&gt;
                if (global5 == 1)&lt;br /&gt;
                blend add&lt;br /&gt;
                map                             &amp;lt;mappath/name&amp;gt;&lt;br /&gt;
                scale                   1, 1&lt;br /&gt;
                red                             global2&lt;br /&gt;
                green                   global3&lt;br /&gt;
                blue                    global4&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
                if (global5 == 2)&lt;br /&gt;
                blend add&lt;br /&gt;
                program ambientEnvironment.vfp&lt;br /&gt;
                vertexParm              0               1, 1, 1, 1              // UV Scales for Diffuse and Bump&lt;br /&gt;
                vertexParm              1               1, 1, 1, 1              // (X,Y) UV Scale for specular&lt;br /&gt;
                vertexParm              2               global2, global3, global4, 1&lt;br /&gt;
&lt;br /&gt;
                fragmentMap             0               cubeMap env/gen1&lt;br /&gt;
                fragmentMap             1               textures/darkmod/stone/brick/redbrick_with_mortar_local                  // Bump&lt;br /&gt;
                fragmentMap             2               textures/darkmod/stone/brick/redbrick_with_mortar                        // Diffuse&lt;br /&gt;
                fragmentMap             3               _black                  // Specular&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is redundant. Ambient rendering has its own dedicated function in the renderer now, and it doesn&#039;t use textures for it. The option is no longer in the game menu, but you can check it in the game console by typing &#039;&#039;&#039;tdm_ambient_method&#039;&#039;&#039;. It should be set to &#039;&#039;&#039;0&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Special Keywords ==&lt;br /&gt;
&lt;br /&gt;
There are also some special keywords you can use:&lt;br /&gt;
&lt;br /&gt;
* noshadows - surface does not cast a shadow&lt;br /&gt;
* noselfshadows - casts shadows, but not on itself&lt;br /&gt;
* translucent - for things like glass&lt;br /&gt;
* [[twosided]] - the surface will be duplicated and flipped, this causes it to be rendered twice. Useful for half-transparent things that should be visible from both sides. Normally surfaces are only visible from the front side (see note below)&lt;br /&gt;
* noFog - do not render fog on this surface&lt;br /&gt;
* Discrete - Dmap will not merge brushes with this material applied&lt;br /&gt;
* NoFragment - Dmap will not split brushes with the material applied&lt;br /&gt;
* nopicmip - The image_downsize settings will not affect this texture. Use sparingly, as low-end users need to use image_downsize to load larger maps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
&lt;br /&gt;
http://www.iddevnet.com/doom3/materials.php&lt;br /&gt;
&lt;br /&gt;
twoSided	Draw the front and back. &#039;&#039;&#039;Implies no-shadows&#039;&#039;&#039;, because the shadow volume would be coplanar with the surface, giving depth fighting&lt;br /&gt;
&lt;br /&gt;
Use a nodraw surface with forceShadows to address this.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Texture Guidelines]]&lt;br /&gt;
* [[How to add Textures to The Dark Mod]]&lt;br /&gt;
* [[Texture Creation - Basic Tutorial]]&lt;br /&gt;
&lt;br /&gt;
{{tutorial-textures|sort=Material}}&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Material_Files&amp;diff=26782</id>
		<title>Material Files</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Material_Files&amp;diff=26782"/>
		<updated>2020-12-11T07:20:54Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: /* Full example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Original_Reference|Fingernail &amp;amp; greebo|127}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- keywords for search: surftype --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What the Heck is a Material File? ==&lt;br /&gt;
The material files (.mtr) contain lists of &#039;material definitions&#039; that tell the engine where to find the source files for the specified textures and what features it should have. All material files should be located in the &#039;&#039;&#039;darkmod/materials&#039;&#039;&#039; folder and have the extension &#039;&#039;&#039;.mtr&#039;&#039;&#039;.  &lt;br /&gt;
&lt;br /&gt;
In fact, it&#039;s the material (=shader) which gets applied to surfaces of brushes, patches and models, not the actual TGA/DDS texture image. A TGA file cannot be applied to surfaces, it&#039;s the shader name which gets used.&lt;br /&gt;
&lt;br /&gt;
 Polygons ==&amp;gt; Shader ==&amp;gt; Image(s) + Processing =&amp;gt; Appearance&lt;br /&gt;
&lt;br /&gt;
Material definitions apply to a single &#039;texture&#039;, though it may be made up of multiple texture files blended together.  A simple material definition looks like this:&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
    qer_editorimage  textures/darkmod/custom/redbrick_ed&lt;br /&gt;
    diffusemap       textures/darkmod/custom/redbrick     &lt;br /&gt;
    bumpmap          textures/darkmod/custom/redbrick_local  &lt;br /&gt;
    specularmap      textures/darkmod/custom/redbrick_s     &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you&#039;re using the &#039;&#039;material&#039;&#039; called &#039;&#039;&#039;textures/darkmod/stone/brick/redbrick_with_mortar&#039;&#039;&#039; in your map, Doom looks up the name in the material definition and loads the according image files (as specified by the [[Map Expressions]]). Note that you &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; need to specify the file extension, the engine is automatically adding it (depending on your quality setting) and finds the according texture file. You also don&#039;t need to include the &#039;&#039;&#039;dds/&#039;&#039;&#039; prefix in the path, this is also added automatically.&lt;br /&gt;
&lt;br /&gt;
A single material file contains lots of material definitions. This is useful as textures that logically belong to each other are summarized in one material file (e.g. &#039;&#039;&#039;materials/tdm_stone_brick.mtr&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
The .mtr files are read upon launching Doom 3 - changing your material file therefore requires either restarting Doom or typing &#039;&#039;&#039;reloadDecls&#039;&#039;&#039; in the console.&lt;br /&gt;
&lt;br /&gt;
== Create a new Texture Definition ==&lt;br /&gt;
Provided you already saved your texture source file (the .tga or .dds) in the appropriate folder, you can go on and create your texture definition.  You cannot use your textures without this step.&lt;br /&gt;
&lt;br /&gt;
Open up or create your personal material file with a text editor.  There are existing guidelines for where texture definitions should go, for the sake of organization, but the engine doesn&#039;t care what the filename is as long as it&#039;s in the materials folder and has a .mtr extension.   &lt;br /&gt;
&lt;br /&gt;
First, specify the name of your new material. If it is not a model texture, then the name should include the path to the texture files used.  Example:&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Do not use special characters for your shader name or The Dark Mod parser might complain (e.g. no &amp;quot;&amp;amp;&amp;quot; (ampersand) or &amp;quot;-&amp;quot; (dash) characters, etc.)&lt;br /&gt;
&lt;br /&gt;
Then, open up a squiggly bracket ({), and start to fill in the texture paths as below, changing the paths and names for your texture.&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
     qer_editorimage  textures/darkmod/stone/brick/redbrick_with_mortar_ed      // editor image&lt;br /&gt;
     diffusemap       textures/darkmod/stone/brick/redbrick_with_mortar         // diffuse map&lt;br /&gt;
     bumpmap           textures/darkmod/stone/brick/redbrick_with_mortar_local  // normal map&lt;br /&gt;
     specularmap      textures/darkmod/stone/brick/redbrick_with_mortar_s       // specular map&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Close the definition with a close squiggly bracket (}).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If there is no specular map then substitute &#039;&#039;&#039;_black&#039;&#039;&#039;, and if there is no bumpmap then use &#039;&#039;&#039;_flat&#039;&#039;&#039; instead.&lt;br /&gt;
&lt;br /&gt;
Save the file. Now you can load your new texture in [[DarkRadiant]] provided you did it all correctly.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can also have a look a the existing material files and learn from them.&lt;br /&gt;
&lt;br /&gt;
== Add the Frob Highlight Stage ==&lt;br /&gt;
&lt;br /&gt;
All materials need to have a conditional shader stage added to let the material highlight when the objects are frobbed. The technical details are of minor interest here, just copy and paste such a stage from other materials and adjust the diffusemap and bumpmap references.&lt;br /&gt;
&lt;br /&gt;
== Full example ==&lt;br /&gt;
&lt;br /&gt;
Here is the full example with the final material definition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
    // Use on of the predefined surface types like:&lt;br /&gt;
    // none, metal, stone, flesh, glass, wood&lt;br /&gt;
    stone&lt;br /&gt;
&lt;br /&gt;
    // Or use &amp;quot;surftype15&amp;quot; and add the surface type as the first (or only) word of the description,&lt;br /&gt;
    // the following are possible:&lt;br /&gt;
    // tile, carpet, dirt, gravle, grass, rock, twigs, foliage, sand, mud, brokeglass, snow, ice, squeakboard,&lt;br /&gt;
    // puddle, moss, cloth, ceramic, slate, straw, armor_leath, armor_chain, armor_plate, climbable, paper, hardwood&lt;br /&gt;
&lt;br /&gt;
    //surftype15&lt;br /&gt;
    //description &amp;quot;carpet This is a carpet texture.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    qer_editorimage  textures/darkmod/stone/brick/redbrick_with_mortar_ed&lt;br /&gt;
    bumpmap          textures/darkmod/stone/brick/redbrick_with_mortar_local&lt;br /&gt;
    diffusemap       textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
    specularmap      textures/darkmod/stone/brick/redbrick_with_mortar_s&lt;br /&gt;
 &lt;br /&gt;
    // This is the code required for frob highlighting this texture&lt;br /&gt;
    {&lt;br /&gt;
        if ( parm11 &amp;gt; 0 )&lt;br /&gt;
        blend       gl_dst_color, gl_one&lt;br /&gt;
        map         _white.tga&lt;br /&gt;
        rgb         0.40 * parm11&lt;br /&gt;
    }&lt;br /&gt;
    {&lt;br /&gt;
        if ( parm11 &amp;gt; 0 )&lt;br /&gt;
        blend       add&lt;br /&gt;
        map         textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
        rgb         0.15 * parm11&lt;br /&gt;
    }   &lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As of TDM 2.08, none of the ambient stages are needed, so either this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        // TDM Ambient Method Related&lt;br /&gt;
        {&lt;br /&gt;
                if (global5 == 1)&lt;br /&gt;
                blend add&lt;br /&gt;
                map                             &amp;lt;mappath/name&amp;gt;&lt;br /&gt;
                scale                   1, 1&lt;br /&gt;
                red                             global2&lt;br /&gt;
                green                   global3&lt;br /&gt;
                blue                    global4&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
                if (global5 == 2)&lt;br /&gt;
                blend add&lt;br /&gt;
                program ambientEnvironment.vfp&lt;br /&gt;
                vertexParm              0               1, 1, 1, 1              // UV Scales for Diffuse and Bump&lt;br /&gt;
                vertexParm              1               1, 1, 1, 1              // (X,Y) UV Scale for specular&lt;br /&gt;
                vertexParm              2               global2, global3, global4, 1&lt;br /&gt;
&lt;br /&gt;
                fragmentMap             0               cubeMap env/gen1&lt;br /&gt;
                fragmentMap             1               textures/darkmod/stone/brick/redbrick_with_mortar_local                  // Bump&lt;br /&gt;
                fragmentMap             2               textures/darkmod/stone/brick/redbrick_with_mortar                        // Diffuse&lt;br /&gt;
                fragmentMap             3               _black                  // Specular&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is redundant. Ambient rendering has it&#039;s own dedicated function in the renderer now, and it doesn&#039;t use textures for it. The option is no longer in the game menu, but you can check it in the game console by typing &#039;&#039;&#039;tdm_ambient_method&#039;&#039;&#039;. It should be set to &#039;&#039;&#039;0&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Special Keywords ==&lt;br /&gt;
&lt;br /&gt;
There are also some special keywords you can use:&lt;br /&gt;
&lt;br /&gt;
* noshadows - surface does not cast a shadow&lt;br /&gt;
* noselfshadows - casts shadows, but not on itself&lt;br /&gt;
* translucent - for things like glass&lt;br /&gt;
* [[twosided]] - the surface will be duplicated and flipped, this causes it to be rendered twice. Useful for half-transparent things that should be visible from both sides. Normally surfaces are only visible from the front side (see note below)&lt;br /&gt;
* noFog - do not render fog on this surface&lt;br /&gt;
* Discrete - Dmap will not merge brushes with this material applied&lt;br /&gt;
* NoFragment - Dmap will not split brushes with the material applied&lt;br /&gt;
* nopicmip - The image_downsize settings will not affect this texture. Use sparingly, as low-end users need to use image_downsize to load larger maps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
&lt;br /&gt;
http://www.iddevnet.com/doom3/materials.php&lt;br /&gt;
&lt;br /&gt;
twoSided	Draw the front and back. &#039;&#039;&#039;Implies no-shadows&#039;&#039;&#039;, because the shadow volume would be coplanar with the surface, giving depth fighting&lt;br /&gt;
&lt;br /&gt;
Use a nodraw surface with forceShadows to address this.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Texture Guidelines]]&lt;br /&gt;
* [[How to add Textures to The Dark Mod]]&lt;br /&gt;
* [[Texture Creation - Basic Tutorial]]&lt;br /&gt;
&lt;br /&gt;
{{tutorial-textures|sort=Material}}&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Material_Files&amp;diff=26781</id>
		<title>Material Files</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Material_Files&amp;diff=26781"/>
		<updated>2020-12-11T07:17:36Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: Removed the ambient stage section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Original_Reference|Fingernail &amp;amp; greebo|127}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- keywords for search: surftype --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What the Heck is a Material File? ==&lt;br /&gt;
The material files (.mtr) contain lists of &#039;material definitions&#039; that tell the engine where to find the source files for the specified textures and what features it should have. All material files should be located in the &#039;&#039;&#039;darkmod/materials&#039;&#039;&#039; folder and have the extension &#039;&#039;&#039;.mtr&#039;&#039;&#039;.  &lt;br /&gt;
&lt;br /&gt;
In fact, it&#039;s the material (=shader) which gets applied to surfaces of brushes, patches and models, not the actual TGA/DDS texture image. A TGA file cannot be applied to surfaces, it&#039;s the shader name which gets used.&lt;br /&gt;
&lt;br /&gt;
 Polygons ==&amp;gt; Shader ==&amp;gt; Image(s) + Processing =&amp;gt; Appearance&lt;br /&gt;
&lt;br /&gt;
Material definitions apply to a single &#039;texture&#039;, though it may be made up of multiple texture files blended together.  A simple material definition looks like this:&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
    qer_editorimage  textures/darkmod/custom/redbrick_ed&lt;br /&gt;
    diffusemap       textures/darkmod/custom/redbrick     &lt;br /&gt;
    bumpmap          textures/darkmod/custom/redbrick_local  &lt;br /&gt;
    specularmap      textures/darkmod/custom/redbrick_s     &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you&#039;re using the &#039;&#039;material&#039;&#039; called &#039;&#039;&#039;textures/darkmod/stone/brick/redbrick_with_mortar&#039;&#039;&#039; in your map, Doom looks up the name in the material definition and loads the according image files (as specified by the [[Map Expressions]]). Note that you &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; need to specify the file extension, the engine is automatically adding it (depending on your quality setting) and finds the according texture file. You also don&#039;t need to include the &#039;&#039;&#039;dds/&#039;&#039;&#039; prefix in the path, this is also added automatically.&lt;br /&gt;
&lt;br /&gt;
A single material file contains lots of material definitions. This is useful as textures that logically belong to each other are summarized in one material file (e.g. &#039;&#039;&#039;materials/tdm_stone_brick.mtr&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
The .mtr files are read upon launching Doom 3 - changing your material file therefore requires either restarting Doom or typing &#039;&#039;&#039;reloadDecls&#039;&#039;&#039; in the console.&lt;br /&gt;
&lt;br /&gt;
== Create a new Texture Definition ==&lt;br /&gt;
Provided you already saved your texture source file (the .tga or .dds) in the appropriate folder, you can go on and create your texture definition.  You cannot use your textures without this step.&lt;br /&gt;
&lt;br /&gt;
Open up or create your personal material file with a text editor.  There are existing guidelines for where texture definitions should go, for the sake of organization, but the engine doesn&#039;t care what the filename is as long as it&#039;s in the materials folder and has a .mtr extension.   &lt;br /&gt;
&lt;br /&gt;
First, specify the name of your new material. If it is not a model texture, then the name should include the path to the texture files used.  Example:&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Do not use special characters for your shader name or The Dark Mod parser might complain (e.g. no &amp;quot;&amp;amp;&amp;quot; (ampersand) or &amp;quot;-&amp;quot; (dash) characters, etc.)&lt;br /&gt;
&lt;br /&gt;
Then, open up a squiggly bracket ({), and start to fill in the texture paths as below, changing the paths and names for your texture.&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
     qer_editorimage  textures/darkmod/stone/brick/redbrick_with_mortar_ed      // editor image&lt;br /&gt;
     diffusemap       textures/darkmod/stone/brick/redbrick_with_mortar         // diffuse map&lt;br /&gt;
     bumpmap           textures/darkmod/stone/brick/redbrick_with_mortar_local  // normal map&lt;br /&gt;
     specularmap      textures/darkmod/stone/brick/redbrick_with_mortar_s       // specular map&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Close the definition with a close squiggly bracket (}).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If there is no specular map then substitute &#039;&#039;&#039;_black&#039;&#039;&#039;, and if there is no bumpmap then use &#039;&#039;&#039;_flat&#039;&#039;&#039; instead.&lt;br /&gt;
&lt;br /&gt;
Save the file. Now you can load your new texture in [[DarkRadiant]] provided you did it all correctly.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can also have a look a the existing material files and learn from them.&lt;br /&gt;
&lt;br /&gt;
== Add the Frob Highlight Stage ==&lt;br /&gt;
&lt;br /&gt;
All materials need to have a conditional shader stage added to let the material highlight when the objects are frobbed. The technical details are of minor interest here, just copy and paste such a stage from other materials and adjust the diffusemap and bumpmap references.&lt;br /&gt;
&lt;br /&gt;
== Full example ==&lt;br /&gt;
&lt;br /&gt;
Here is the full example with the final material definition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
    // Use on of the predefined surface types like:&lt;br /&gt;
    // none, metal, stone, flesh, glass, wood&lt;br /&gt;
    stone&lt;br /&gt;
&lt;br /&gt;
    // Or use &amp;quot;surftype15&amp;quot; and add the surface type as the first (or only) word of the description,&lt;br /&gt;
    // the following are possible:&lt;br /&gt;
    // tile, carpet, dirt, gravle, grass, rock, twigs, foliage, sand, mud, brokeglass, snow, ice, squeakboard,&lt;br /&gt;
    // puddle, moss, cloth, ceramic, slate, straw, armor_leath, armor_chain, armor_plate, climbable, paper, hardwood&lt;br /&gt;
&lt;br /&gt;
    //surftype15&lt;br /&gt;
    //description &amp;quot;carpet This is a carpet texture.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    qer_editorimage  textures/darkmod/stone/brick/redbrick_with_mortar_ed&lt;br /&gt;
    bumpmap          textures/darkmod/stone/brick/redbrick_with_mortar_local&lt;br /&gt;
    diffusemap       textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
    specularmap      textures/darkmod/stone/brick/redbrick_with_mortar_s&lt;br /&gt;
 &lt;br /&gt;
    // This is the code required for frob highlighting this texture&lt;br /&gt;
    {&lt;br /&gt;
        if ( parm11 &amp;gt; 0 )&lt;br /&gt;
        blend       gl_dst_color, gl_one&lt;br /&gt;
        map         _white.tga&lt;br /&gt;
        rgb         0.40 * parm11&lt;br /&gt;
    }&lt;br /&gt;
    {&lt;br /&gt;
        if ( parm11 &amp;gt; 0 )&lt;br /&gt;
        blend       add&lt;br /&gt;
        map         textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
        rgb         0.15 * parm11&lt;br /&gt;
    }   &lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AS OF TDM 2.08, both this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        // TDM Ambient Method Related&lt;br /&gt;
        {&lt;br /&gt;
                if (global5 == 1)&lt;br /&gt;
                blend add&lt;br /&gt;
                map                             &amp;lt;mappath/name&amp;gt;&lt;br /&gt;
                scale                   1, 1&lt;br /&gt;
                red                             global2&lt;br /&gt;
                green                   global3&lt;br /&gt;
                blue                    global4&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
                if (global5 == 2)&lt;br /&gt;
                blend add&lt;br /&gt;
                program ambientEnvironment.vfp&lt;br /&gt;
                vertexParm              0               1, 1, 1, 1              // UV Scales for Diffuse and Bump&lt;br /&gt;
                vertexParm              1               1, 1, 1, 1              // (X,Y) UV Scale for specular&lt;br /&gt;
                vertexParm              2               global2, global3, global4, 1&lt;br /&gt;
&lt;br /&gt;
                fragmentMap             0               cubeMap env/gen1&lt;br /&gt;
                fragmentMap             1               textures/darkmod/stone/brick/redbrick_with_mortar_local                  // Bump&lt;br /&gt;
                fragmentMap             2               textures/darkmod/stone/brick/redbrick_with_mortar                        // Diffuse&lt;br /&gt;
                fragmentMap             3               _black                  // Specular&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is &#039;&#039;&#039;no longer needed&#039;&#039;&#039; as ambient rendering has it&#039;s own dedicated function in the renderer now, and it doesn&#039;t use textures for it. The option is no longer in the game menu, but you can check it in the game console by typing &#039;&#039;&#039;tdm_ambient_method&#039;&#039;&#039;. It should be set to &#039;&#039;&#039;0&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Special Keywords ==&lt;br /&gt;
&lt;br /&gt;
There are also some special keywords you can use:&lt;br /&gt;
&lt;br /&gt;
* noshadows - surface does not cast a shadow&lt;br /&gt;
* noselfshadows - casts shadows, but not on itself&lt;br /&gt;
* translucent - for things like glass&lt;br /&gt;
* [[twosided]] - the surface will be duplicated and flipped, this causes it to be rendered twice. Useful for half-transparent things that should be visible from both sides. Normally surfaces are only visible from the front side (see note below)&lt;br /&gt;
* noFog - do not render fog on this surface&lt;br /&gt;
* Discrete - Dmap will not merge brushes with this material applied&lt;br /&gt;
* NoFragment - Dmap will not split brushes with the material applied&lt;br /&gt;
* nopicmip - The image_downsize settings will not affect this texture. Use sparingly, as low-end users need to use image_downsize to load larger maps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
&lt;br /&gt;
http://www.iddevnet.com/doom3/materials.php&lt;br /&gt;
&lt;br /&gt;
twoSided	Draw the front and back. &#039;&#039;&#039;Implies no-shadows&#039;&#039;&#039;, because the shadow volume would be coplanar with the surface, giving depth fighting&lt;br /&gt;
&lt;br /&gt;
Use a nodraw surface with forceShadows to address this.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Texture Guidelines]]&lt;br /&gt;
* [[How to add Textures to The Dark Mod]]&lt;br /&gt;
* [[Texture Creation - Basic Tutorial]]&lt;br /&gt;
&lt;br /&gt;
{{tutorial-textures|sort=Material}}&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Material_Files&amp;diff=26780</id>
		<title>Material Files</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Material_Files&amp;diff=26780"/>
		<updated>2020-12-11T07:14:59Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: /* Full example */ – removed the ambient stage and moved it to legacy section.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Original_Reference|Fingernail &amp;amp; greebo|127}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- keywords for search: surftype --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What the Heck is a Material File? ==&lt;br /&gt;
The material files (.mtr) contain lists of &#039;material definitions&#039; that tell the engine where to find the source files for the specified textures and what features it should have. All material files should be located in the &#039;&#039;&#039;darkmod/materials&#039;&#039;&#039; folder and have the extension &#039;&#039;&#039;.mtr&#039;&#039;&#039;.  &lt;br /&gt;
&lt;br /&gt;
In fact, it&#039;s the material (=shader) which gets applied to surfaces of brushes, patches and models, not the actual TGA/DDS texture image. A TGA file cannot be applied to surfaces, it&#039;s the shader name which gets used.&lt;br /&gt;
&lt;br /&gt;
 Polygons ==&amp;gt; Shader ==&amp;gt; Image(s) + Processing =&amp;gt; Appearance&lt;br /&gt;
&lt;br /&gt;
Material definitions apply to a single &#039;texture&#039;, though it may be made up of multiple texture files blended together.  A simple material definition looks like this:&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
    qer_editorimage  textures/darkmod/custom/redbrick_ed&lt;br /&gt;
    diffusemap       textures/darkmod/custom/redbrick     &lt;br /&gt;
    bumpmap          textures/darkmod/custom/redbrick_local  &lt;br /&gt;
    specularmap      textures/darkmod/custom/redbrick_s     &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you&#039;re using the &#039;&#039;material&#039;&#039; called &#039;&#039;&#039;textures/darkmod/stone/brick/redbrick_with_mortar&#039;&#039;&#039; in your map, Doom looks up the name in the material definition and loads the according image files (as specified by the [[Map Expressions]]). Note that you &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; need to specify the file extension, the engine is automatically adding it (depending on your quality setting) and finds the according texture file. You also don&#039;t need to include the &#039;&#039;&#039;dds/&#039;&#039;&#039; prefix in the path, this is also added automatically.&lt;br /&gt;
&lt;br /&gt;
A single material file contains lots of material definitions. This is useful as textures that logically belong to each other are summarized in one material file (e.g. &#039;&#039;&#039;materials/tdm_stone_brick.mtr&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
The .mtr files are read upon launching Doom 3 - changing your material file therefore requires either restarting Doom or typing &#039;&#039;&#039;reloadDecls&#039;&#039;&#039; in the console.&lt;br /&gt;
&lt;br /&gt;
== Create a new Texture Definition ==&lt;br /&gt;
Provided you already saved your texture source file (the .tga or .dds) in the appropriate folder, you can go on and create your texture definition.  You cannot use your textures without this step.&lt;br /&gt;
&lt;br /&gt;
Open up or create your personal material file with a text editor.  There are existing guidelines for where texture definitions should go, for the sake of organization, but the engine doesn&#039;t care what the filename is as long as it&#039;s in the materials folder and has a .mtr extension.   &lt;br /&gt;
&lt;br /&gt;
First, specify the name of your new material. If it is not a model texture, then the name should include the path to the texture files used.  Example:&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Do not use special characters for your shader name or The Dark Mod parser might complain (e.g. no &amp;quot;&amp;amp;&amp;quot; (ampersand) or &amp;quot;-&amp;quot; (dash) characters, etc.)&lt;br /&gt;
&lt;br /&gt;
Then, open up a squiggly bracket ({), and start to fill in the texture paths as below, changing the paths and names for your texture.&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
     qer_editorimage  textures/darkmod/stone/brick/redbrick_with_mortar_ed      // editor image&lt;br /&gt;
     diffusemap       textures/darkmod/stone/brick/redbrick_with_mortar         // diffuse map&lt;br /&gt;
     bumpmap           textures/darkmod/stone/brick/redbrick_with_mortar_local  // normal map&lt;br /&gt;
     specularmap      textures/darkmod/stone/brick/redbrick_with_mortar_s       // specular map&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Close the definition with a close squiggly bracket (}).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If there is no specular map then substitute &#039;&#039;&#039;_black&#039;&#039;&#039;, and if there is no bumpmap then use &#039;&#039;&#039;_flat&#039;&#039;&#039; instead.&lt;br /&gt;
&lt;br /&gt;
Save the file. Now you can load your new texture in [[DarkRadiant]] provided you did it all correctly.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can also have a look a the existing material files and learn from them.&lt;br /&gt;
&lt;br /&gt;
== Ambient Light Stage ==&lt;br /&gt;
&lt;br /&gt;
This block is no longer needed. By default, TDM uses ambient lights, not textures. The related option has been removed from the game menu in 2.08, but you can check it by typing &#039;&#039;&#039;tdm_ambient_method&#039;&#039;&#039; in the game console. It should be set to &#039;&#039;&#039;0&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Add the Frob Highlight Stage ==&lt;br /&gt;
&lt;br /&gt;
All materials need to have a conditional shader stage added to let the material highlight when the objects are frobbed. The technical details are of minor interest here, just copy and paste such a stage from other materials and adjust the diffusemap and bumpmap references.&lt;br /&gt;
&lt;br /&gt;
== Full example ==&lt;br /&gt;
&lt;br /&gt;
Here is the full example with the final material definition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
    // Use on of the predefined surface types like:&lt;br /&gt;
    // none, metal, stone, flesh, glass, wood&lt;br /&gt;
    stone&lt;br /&gt;
&lt;br /&gt;
    // Or use &amp;quot;surftype15&amp;quot; and add the surface type as the first (or only) word of the description,&lt;br /&gt;
    // the following are possible:&lt;br /&gt;
    // tile, carpet, dirt, gravle, grass, rock, twigs, foliage, sand, mud, brokeglass, snow, ice, squeakboard,&lt;br /&gt;
    // puddle, moss, cloth, ceramic, slate, straw, armor_leath, armor_chain, armor_plate, climbable, paper, hardwood&lt;br /&gt;
&lt;br /&gt;
    //surftype15&lt;br /&gt;
    //description &amp;quot;carpet This is a carpet texture.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    qer_editorimage  textures/darkmod/stone/brick/redbrick_with_mortar_ed&lt;br /&gt;
    bumpmap          textures/darkmod/stone/brick/redbrick_with_mortar_local&lt;br /&gt;
    diffusemap       textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
    specularmap      textures/darkmod/stone/brick/redbrick_with_mortar_s&lt;br /&gt;
 &lt;br /&gt;
    // This is the code required for frob highlighting this texture&lt;br /&gt;
    {&lt;br /&gt;
        if ( parm11 &amp;gt; 0 )&lt;br /&gt;
        blend       gl_dst_color, gl_one&lt;br /&gt;
        map         _white.tga&lt;br /&gt;
        rgb         0.40 * parm11&lt;br /&gt;
    }&lt;br /&gt;
    {&lt;br /&gt;
        if ( parm11 &amp;gt; 0 )&lt;br /&gt;
        blend       add&lt;br /&gt;
        map         textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
        rgb         0.15 * parm11&lt;br /&gt;
    }   &lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AS OF TDM 2.08, both this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        // TDM Ambient Method Related&lt;br /&gt;
        {&lt;br /&gt;
                if (global5 == 1)&lt;br /&gt;
                blend add&lt;br /&gt;
                map                             &amp;lt;mappath/name&amp;gt;&lt;br /&gt;
                scale                   1, 1&lt;br /&gt;
                red                             global2&lt;br /&gt;
                green                   global3&lt;br /&gt;
                blue                    global4&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
                if (global5 == 2)&lt;br /&gt;
                blend add&lt;br /&gt;
                program ambientEnvironment.vfp&lt;br /&gt;
                vertexParm              0               1, 1, 1, 1              // UV Scales for Diffuse and Bump&lt;br /&gt;
                vertexParm              1               1, 1, 1, 1              // (X,Y) UV Scale for specular&lt;br /&gt;
                vertexParm              2               global2, global3, global4, 1&lt;br /&gt;
&lt;br /&gt;
                fragmentMap             0               cubeMap env/gen1&lt;br /&gt;
                fragmentMap             1               textures/darkmod/stone/brick/redbrick_with_mortar_local                  // Bump&lt;br /&gt;
                fragmentMap             2               textures/darkmod/stone/brick/redbrick_with_mortar                        // Diffuse&lt;br /&gt;
                fragmentMap             3               _black                  // Specular&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is &#039;&#039;&#039;no longer needed&#039;&#039;&#039; as ambient rendering has it&#039;s own dedicated function in the renderer now, and it doesn&#039;t use textures for it. The option is no longer in the game menu, but you can check it in the game console by typing &#039;&#039;&#039;tdm_ambient_method&#039;&#039;&#039;. It should be set to &#039;&#039;&#039;0&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Special Keywords ==&lt;br /&gt;
&lt;br /&gt;
There are also some special keywords you can use:&lt;br /&gt;
&lt;br /&gt;
* noshadows - surface does not cast a shadow&lt;br /&gt;
* noselfshadows - casts shadows, but not on itself&lt;br /&gt;
* translucent - for things like glass&lt;br /&gt;
* [[twosided]] - the surface will be duplicated and flipped, this causes it to be rendered twice. Useful for half-transparent things that should be visible from both sides. Normally surfaces are only visible from the front side (see note below)&lt;br /&gt;
* noFog - do not render fog on this surface&lt;br /&gt;
* Discrete - Dmap will not merge brushes with this material applied&lt;br /&gt;
* NoFragment - Dmap will not split brushes with the material applied&lt;br /&gt;
* nopicmip - The image_downsize settings will not affect this texture. Use sparingly, as low-end users need to use image_downsize to load larger maps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
&lt;br /&gt;
http://www.iddevnet.com/doom3/materials.php&lt;br /&gt;
&lt;br /&gt;
twoSided	Draw the front and back. &#039;&#039;&#039;Implies no-shadows&#039;&#039;&#039;, because the shadow volume would be coplanar with the surface, giving depth fighting&lt;br /&gt;
&lt;br /&gt;
Use a nodraw surface with forceShadows to address this.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Texture Guidelines]]&lt;br /&gt;
* [[How to add Textures to The Dark Mod]]&lt;br /&gt;
* [[Texture Creation - Basic Tutorial]]&lt;br /&gt;
&lt;br /&gt;
{{tutorial-textures|sort=Material}}&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Material_Files&amp;diff=26779</id>
		<title>Material Files</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Material_Files&amp;diff=26779"/>
		<updated>2020-12-11T07:08:15Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: /* Add the Ambient Light Stage */ – changed to indicate this is no longer needed.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Original_Reference|Fingernail &amp;amp; greebo|127}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- keywords for search: surftype --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What the Heck is a Material File? ==&lt;br /&gt;
The material files (.mtr) contain lists of &#039;material definitions&#039; that tell the engine where to find the source files for the specified textures and what features it should have. All material files should be located in the &#039;&#039;&#039;darkmod/materials&#039;&#039;&#039; folder and have the extension &#039;&#039;&#039;.mtr&#039;&#039;&#039;.  &lt;br /&gt;
&lt;br /&gt;
In fact, it&#039;s the material (=shader) which gets applied to surfaces of brushes, patches and models, not the actual TGA/DDS texture image. A TGA file cannot be applied to surfaces, it&#039;s the shader name which gets used.&lt;br /&gt;
&lt;br /&gt;
 Polygons ==&amp;gt; Shader ==&amp;gt; Image(s) + Processing =&amp;gt; Appearance&lt;br /&gt;
&lt;br /&gt;
Material definitions apply to a single &#039;texture&#039;, though it may be made up of multiple texture files blended together.  A simple material definition looks like this:&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
    qer_editorimage  textures/darkmod/custom/redbrick_ed&lt;br /&gt;
    diffusemap       textures/darkmod/custom/redbrick     &lt;br /&gt;
    bumpmap          textures/darkmod/custom/redbrick_local  &lt;br /&gt;
    specularmap      textures/darkmod/custom/redbrick_s     &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you&#039;re using the &#039;&#039;material&#039;&#039; called &#039;&#039;&#039;textures/darkmod/stone/brick/redbrick_with_mortar&#039;&#039;&#039; in your map, Doom looks up the name in the material definition and loads the according image files (as specified by the [[Map Expressions]]). Note that you &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; need to specify the file extension, the engine is automatically adding it (depending on your quality setting) and finds the according texture file. You also don&#039;t need to include the &#039;&#039;&#039;dds/&#039;&#039;&#039; prefix in the path, this is also added automatically.&lt;br /&gt;
&lt;br /&gt;
A single material file contains lots of material definitions. This is useful as textures that logically belong to each other are summarized in one material file (e.g. &#039;&#039;&#039;materials/tdm_stone_brick.mtr&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
The .mtr files are read upon launching Doom 3 - changing your material file therefore requires either restarting Doom or typing &#039;&#039;&#039;reloadDecls&#039;&#039;&#039; in the console.&lt;br /&gt;
&lt;br /&gt;
== Create a new Texture Definition ==&lt;br /&gt;
Provided you already saved your texture source file (the .tga or .dds) in the appropriate folder, you can go on and create your texture definition.  You cannot use your textures without this step.&lt;br /&gt;
&lt;br /&gt;
Open up or create your personal material file with a text editor.  There are existing guidelines for where texture definitions should go, for the sake of organization, but the engine doesn&#039;t care what the filename is as long as it&#039;s in the materials folder and has a .mtr extension.   &lt;br /&gt;
&lt;br /&gt;
First, specify the name of your new material. If it is not a model texture, then the name should include the path to the texture files used.  Example:&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Do not use special characters for your shader name or The Dark Mod parser might complain (e.g. no &amp;quot;&amp;amp;&amp;quot; (ampersand) or &amp;quot;-&amp;quot; (dash) characters, etc.)&lt;br /&gt;
&lt;br /&gt;
Then, open up a squiggly bracket ({), and start to fill in the texture paths as below, changing the paths and names for your texture.&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
     qer_editorimage  textures/darkmod/stone/brick/redbrick_with_mortar_ed      // editor image&lt;br /&gt;
     diffusemap       textures/darkmod/stone/brick/redbrick_with_mortar         // diffuse map&lt;br /&gt;
     bumpmap           textures/darkmod/stone/brick/redbrick_with_mortar_local  // normal map&lt;br /&gt;
     specularmap      textures/darkmod/stone/brick/redbrick_with_mortar_s       // specular map&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Close the definition with a close squiggly bracket (}).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If there is no specular map then substitute &#039;&#039;&#039;_black&#039;&#039;&#039;, and if there is no bumpmap then use &#039;&#039;&#039;_flat&#039;&#039;&#039; instead.&lt;br /&gt;
&lt;br /&gt;
Save the file. Now you can load your new texture in [[DarkRadiant]] provided you did it all correctly.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can also have a look a the existing material files and learn from them.&lt;br /&gt;
&lt;br /&gt;
== Ambient Light Stage ==&lt;br /&gt;
&lt;br /&gt;
This block is no longer needed. By default, TDM uses ambient lights, not textures. The related option has been removed from the game menu in 2.08, but you can check it by typing &#039;&#039;&#039;tdm_ambient_method&#039;&#039;&#039; in the game console. It should be set to &#039;&#039;&#039;0&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Add the Frob Highlight Stage ==&lt;br /&gt;
&lt;br /&gt;
All materials need to have a conditional shader stage added to let the material highlight when the objects are frobbed. The technical details are of minor interest here, just copy and paste such a stage from other materials and adjust the diffusemap and bumpmap references.&lt;br /&gt;
&lt;br /&gt;
== Full example ==&lt;br /&gt;
&lt;br /&gt;
Here is the full example with the final material definition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
    // Use on of the predefined surface types like:&lt;br /&gt;
    // none, metal, stone, flesh, glass, wood&lt;br /&gt;
    stone&lt;br /&gt;
&lt;br /&gt;
    // Or use &amp;quot;surftype15&amp;quot; and add the surface type as the first (or only) word of the description,&lt;br /&gt;
    // the following are possible:&lt;br /&gt;
    // tile, carpet, dirt, gravle, grass, rock, twigs, foliage, sand, mud, brokeglass, snow, ice, squeakboard,&lt;br /&gt;
    // puddle, moss, cloth, ceramic, slate, straw, armor_leath, armor_chain, armor_plate, climbable, paper, hardwood&lt;br /&gt;
&lt;br /&gt;
    //surftype15&lt;br /&gt;
    //description &amp;quot;carpet This is a carpet texture.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    qer_editorimage  textures/darkmod/stone/brick/redbrick_with_mortar_ed&lt;br /&gt;
    bumpmap          textures/darkmod/stone/brick/redbrick_with_mortar_local&lt;br /&gt;
    diffusemap       textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
    specularmap      textures/darkmod/stone/brick/redbrick_with_mortar_s&lt;br /&gt;
 &lt;br /&gt;
    // This is the code required for frob highlighting this texture&lt;br /&gt;
    {&lt;br /&gt;
        if ( parm11 &amp;gt; 0 )&lt;br /&gt;
        blend       gl_dst_color, gl_one&lt;br /&gt;
        map         _white.tga&lt;br /&gt;
        rgb         0.40 * parm11&lt;br /&gt;
    }&lt;br /&gt;
    {&lt;br /&gt;
        if ( parm11 &amp;gt; 0 )&lt;br /&gt;
        blend       add&lt;br /&gt;
        map         textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
        rgb         0.15 * parm11&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
        // TDM Ambient Method Related&lt;br /&gt;
        {&lt;br /&gt;
                if (global5 == 1)&lt;br /&gt;
                blend add&lt;br /&gt;
                map                             textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
                scale                   1, 1&lt;br /&gt;
                red                             global2&lt;br /&gt;
                green                   global3&lt;br /&gt;
                blue                    global4&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AS OF TDM 2.0 the old Enhanced Ambient stage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
                if (global5 == 2)&lt;br /&gt;
                blend add&lt;br /&gt;
                program ambientEnvironment.vfp&lt;br /&gt;
                vertexParm              0               1, 1, 1, 1              // UV Scales for Diffuse and Bump&lt;br /&gt;
                vertexParm              1               1, 1, 1, 1              // (X,Y) UV Scale for specular&lt;br /&gt;
                vertexParm              2               global2, global3, global4, 1&lt;br /&gt;
&lt;br /&gt;
                fragmentMap             0               cubeMap env/gen1&lt;br /&gt;
                fragmentMap             1               textures/darkmod/stone/brick/redbrick_with_mortar_local                  // Bump&lt;br /&gt;
                fragmentMap             2               textures/darkmod/stone/brick/redbrick_with_mortar                        // Diffuse&lt;br /&gt;
                fragmentMap             3               _black                  // Specular&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is &#039;&#039;&#039;no longer needed&#039;&#039;&#039; as ambient rendering has it&#039;s own dedicated function in the renderer now.&lt;br /&gt;
&lt;br /&gt;
== Special Keywords ==&lt;br /&gt;
&lt;br /&gt;
There are also some special keywords you can use:&lt;br /&gt;
&lt;br /&gt;
* noshadows - surface does not cast a shadow&lt;br /&gt;
* noselfshadows - casts shadows, but not on itself&lt;br /&gt;
* translucent - for things like glass&lt;br /&gt;
* [[twosided]] - the surface will be duplicated and flipped, this causes it to be rendered twice. Useful for half-transparent things that should be visible from both sides. Normally surfaces are only visible from the front side (see note below)&lt;br /&gt;
* noFog - do not render fog on this surface&lt;br /&gt;
* Discrete - Dmap will not merge brushes with this material applied&lt;br /&gt;
* NoFragment - Dmap will not split brushes with the material applied&lt;br /&gt;
* nopicmip - The image_downsize settings will not affect this texture. Use sparingly, as low-end users need to use image_downsize to load larger maps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
&lt;br /&gt;
http://www.iddevnet.com/doom3/materials.php&lt;br /&gt;
&lt;br /&gt;
twoSided	Draw the front and back. &#039;&#039;&#039;Implies no-shadows&#039;&#039;&#039;, because the shadow volume would be coplanar with the surface, giving depth fighting&lt;br /&gt;
&lt;br /&gt;
Use a nodraw surface with forceShadows to address this.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Texture Guidelines]]&lt;br /&gt;
* [[How to add Textures to The Dark Mod]]&lt;br /&gt;
* [[Texture Creation - Basic Tutorial]]&lt;br /&gt;
&lt;br /&gt;
{{tutorial-textures|sort=Material}}&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Material_Files&amp;diff=26778</id>
		<title>Material Files</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Material_Files&amp;diff=26778"/>
		<updated>2020-12-11T06:44:20Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: /* Add the Ambient Light Stage */ – deleted note on _black and _flat textures which seemed to be here by accident.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Original_Reference|Fingernail &amp;amp; greebo|127}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- keywords for search: surftype --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What the Heck is a Material File? ==&lt;br /&gt;
The material files (.mtr) contain lists of &#039;material definitions&#039; that tell the engine where to find the source files for the specified textures and what features it should have. All material files should be located in the &#039;&#039;&#039;darkmod/materials&#039;&#039;&#039; folder and have the extension &#039;&#039;&#039;.mtr&#039;&#039;&#039;.  &lt;br /&gt;
&lt;br /&gt;
In fact, it&#039;s the material (=shader) which gets applied to surfaces of brushes, patches and models, not the actual TGA/DDS texture image. A TGA file cannot be applied to surfaces, it&#039;s the shader name which gets used.&lt;br /&gt;
&lt;br /&gt;
 Polygons ==&amp;gt; Shader ==&amp;gt; Image(s) + Processing =&amp;gt; Appearance&lt;br /&gt;
&lt;br /&gt;
Material definitions apply to a single &#039;texture&#039;, though it may be made up of multiple texture files blended together.  A simple material definition looks like this:&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
    qer_editorimage  textures/darkmod/custom/redbrick_ed&lt;br /&gt;
    diffusemap       textures/darkmod/custom/redbrick     &lt;br /&gt;
    bumpmap          textures/darkmod/custom/redbrick_local  &lt;br /&gt;
    specularmap      textures/darkmod/custom/redbrick_s     &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you&#039;re using the &#039;&#039;material&#039;&#039; called &#039;&#039;&#039;textures/darkmod/stone/brick/redbrick_with_mortar&#039;&#039;&#039; in your map, Doom looks up the name in the material definition and loads the according image files (as specified by the [[Map Expressions]]). Note that you &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; need to specify the file extension, the engine is automatically adding it (depending on your quality setting) and finds the according texture file. You also don&#039;t need to include the &#039;&#039;&#039;dds/&#039;&#039;&#039; prefix in the path, this is also added automatically.&lt;br /&gt;
&lt;br /&gt;
A single material file contains lots of material definitions. This is useful as textures that logically belong to each other are summarized in one material file (e.g. &#039;&#039;&#039;materials/tdm_stone_brick.mtr&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
The .mtr files are read upon launching Doom 3 - changing your material file therefore requires either restarting Doom or typing &#039;&#039;&#039;reloadDecls&#039;&#039;&#039; in the console.&lt;br /&gt;
&lt;br /&gt;
== Create a new Texture Definition ==&lt;br /&gt;
Provided you already saved your texture source file (the .tga or .dds) in the appropriate folder, you can go on and create your texture definition.  You cannot use your textures without this step.&lt;br /&gt;
&lt;br /&gt;
Open up or create your personal material file with a text editor.  There are existing guidelines for where texture definitions should go, for the sake of organization, but the engine doesn&#039;t care what the filename is as long as it&#039;s in the materials folder and has a .mtr extension.   &lt;br /&gt;
&lt;br /&gt;
First, specify the name of your new material. If it is not a model texture, then the name should include the path to the texture files used.  Example:&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Do not use special characters for your shader name or The Dark Mod parser might complain (e.g. no &amp;quot;&amp;amp;&amp;quot; (ampersand) or &amp;quot;-&amp;quot; (dash) characters, etc.)&lt;br /&gt;
&lt;br /&gt;
Then, open up a squiggly bracket ({), and start to fill in the texture paths as below, changing the paths and names for your texture.&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
     qer_editorimage  textures/darkmod/stone/brick/redbrick_with_mortar_ed      // editor image&lt;br /&gt;
     diffusemap       textures/darkmod/stone/brick/redbrick_with_mortar         // diffuse map&lt;br /&gt;
     bumpmap           textures/darkmod/stone/brick/redbrick_with_mortar_local  // normal map&lt;br /&gt;
     specularmap      textures/darkmod/stone/brick/redbrick_with_mortar_s       // specular map&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Close the definition with a close squiggly bracket (}).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If there is no specular map then substitute &#039;&#039;&#039;_black&#039;&#039;&#039;, and if there is no bumpmap then use &#039;&#039;&#039;_flat&#039;&#039;&#039; instead.&lt;br /&gt;
&lt;br /&gt;
Save the file. Now you can load your new texture in [[DarkRadiant]] provided you did it all correctly.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can also have a look a the existing material files and learn from them.&lt;br /&gt;
&lt;br /&gt;
== Add the Ambient Light Stage ==&lt;br /&gt;
&lt;br /&gt;
This should go on all Dark Mod textures - see [[Virtual Ambient Light Textures]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        // TDM Ambient Method Related&lt;br /&gt;
        {&lt;br /&gt;
                if (global5 == 1)&lt;br /&gt;
                blend add&lt;br /&gt;
                map                             &amp;lt;mappath/name&amp;gt;&lt;br /&gt;
                scale                   1, 1&lt;br /&gt;
                red                             global2&lt;br /&gt;
                green                   global3&lt;br /&gt;
                blue                    global4&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add the Frob Highlight Stage ==&lt;br /&gt;
&lt;br /&gt;
All materials need to have a conditional shader stage added to let the material highlight when the objects are frobbed. The technical details are of minor interest here, just copy and paste such a stage from other materials and adjust the diffusemap and bumpmap references.&lt;br /&gt;
&lt;br /&gt;
== Full example ==&lt;br /&gt;
&lt;br /&gt;
Here is the full example with the final material definition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
    // Use on of the predefined surface types like:&lt;br /&gt;
    // none, metal, stone, flesh, glass, wood&lt;br /&gt;
    stone&lt;br /&gt;
&lt;br /&gt;
    // Or use &amp;quot;surftype15&amp;quot; and add the surface type as the first (or only) word of the description,&lt;br /&gt;
    // the following are possible:&lt;br /&gt;
    // tile, carpet, dirt, gravle, grass, rock, twigs, foliage, sand, mud, brokeglass, snow, ice, squeakboard,&lt;br /&gt;
    // puddle, moss, cloth, ceramic, slate, straw, armor_leath, armor_chain, armor_plate, climbable, paper, hardwood&lt;br /&gt;
&lt;br /&gt;
    //surftype15&lt;br /&gt;
    //description &amp;quot;carpet This is a carpet texture.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    qer_editorimage  textures/darkmod/stone/brick/redbrick_with_mortar_ed&lt;br /&gt;
    bumpmap          textures/darkmod/stone/brick/redbrick_with_mortar_local&lt;br /&gt;
    diffusemap       textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
    specularmap      textures/darkmod/stone/brick/redbrick_with_mortar_s&lt;br /&gt;
 &lt;br /&gt;
    // This is the code required for frob highlighting this texture&lt;br /&gt;
    {&lt;br /&gt;
        if ( parm11 &amp;gt; 0 )&lt;br /&gt;
        blend       gl_dst_color, gl_one&lt;br /&gt;
        map         _white.tga&lt;br /&gt;
        rgb         0.40 * parm11&lt;br /&gt;
    }&lt;br /&gt;
    {&lt;br /&gt;
        if ( parm11 &amp;gt; 0 )&lt;br /&gt;
        blend       add&lt;br /&gt;
        map         textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
        rgb         0.15 * parm11&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
        // TDM Ambient Method Related&lt;br /&gt;
        {&lt;br /&gt;
                if (global5 == 1)&lt;br /&gt;
                blend add&lt;br /&gt;
                map                             textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
                scale                   1, 1&lt;br /&gt;
                red                             global2&lt;br /&gt;
                green                   global3&lt;br /&gt;
                blue                    global4&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AS OF TDM 2.0 the old Enhanced Ambient stage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
                if (global5 == 2)&lt;br /&gt;
                blend add&lt;br /&gt;
                program ambientEnvironment.vfp&lt;br /&gt;
                vertexParm              0               1, 1, 1, 1              // UV Scales for Diffuse and Bump&lt;br /&gt;
                vertexParm              1               1, 1, 1, 1              // (X,Y) UV Scale for specular&lt;br /&gt;
                vertexParm              2               global2, global3, global4, 1&lt;br /&gt;
&lt;br /&gt;
                fragmentMap             0               cubeMap env/gen1&lt;br /&gt;
                fragmentMap             1               textures/darkmod/stone/brick/redbrick_with_mortar_local                  // Bump&lt;br /&gt;
                fragmentMap             2               textures/darkmod/stone/brick/redbrick_with_mortar                        // Diffuse&lt;br /&gt;
                fragmentMap             3               _black                  // Specular&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is &#039;&#039;&#039;no longer needed&#039;&#039;&#039; as ambient rendering has it&#039;s own dedicated function in the renderer now.&lt;br /&gt;
&lt;br /&gt;
== Special Keywords ==&lt;br /&gt;
&lt;br /&gt;
There are also some special keywords you can use:&lt;br /&gt;
&lt;br /&gt;
* noshadows - surface does not cast a shadow&lt;br /&gt;
* noselfshadows - casts shadows, but not on itself&lt;br /&gt;
* translucent - for things like glass&lt;br /&gt;
* [[twosided]] - the surface will be duplicated and flipped, this causes it to be rendered twice. Useful for half-transparent things that should be visible from both sides. Normally surfaces are only visible from the front side (see note below)&lt;br /&gt;
* noFog - do not render fog on this surface&lt;br /&gt;
* Discrete - Dmap will not merge brushes with this material applied&lt;br /&gt;
* NoFragment - Dmap will not split brushes with the material applied&lt;br /&gt;
* nopicmip - The image_downsize settings will not affect this texture. Use sparingly, as low-end users need to use image_downsize to load larger maps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
&lt;br /&gt;
http://www.iddevnet.com/doom3/materials.php&lt;br /&gt;
&lt;br /&gt;
twoSided	Draw the front and back. &#039;&#039;&#039;Implies no-shadows&#039;&#039;&#039;, because the shadow volume would be coplanar with the surface, giving depth fighting&lt;br /&gt;
&lt;br /&gt;
Use a nodraw surface with forceShadows to address this.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Texture Guidelines]]&lt;br /&gt;
* [[How to add Textures to The Dark Mod]]&lt;br /&gt;
* [[Texture Creation - Basic Tutorial]]&lt;br /&gt;
&lt;br /&gt;
{{tutorial-textures|sort=Material}}&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Material_Files&amp;diff=26777</id>
		<title>Material Files</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Material_Files&amp;diff=26777"/>
		<updated>2020-12-11T06:42:12Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: /* Create a new Texture Definition */ – note on _black and _flat textures was misplaced.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Original_Reference|Fingernail &amp;amp; greebo|127}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- keywords for search: surftype --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What the Heck is a Material File? ==&lt;br /&gt;
The material files (.mtr) contain lists of &#039;material definitions&#039; that tell the engine where to find the source files for the specified textures and what features it should have. All material files should be located in the &#039;&#039;&#039;darkmod/materials&#039;&#039;&#039; folder and have the extension &#039;&#039;&#039;.mtr&#039;&#039;&#039;.  &lt;br /&gt;
&lt;br /&gt;
In fact, it&#039;s the material (=shader) which gets applied to surfaces of brushes, patches and models, not the actual TGA/DDS texture image. A TGA file cannot be applied to surfaces, it&#039;s the shader name which gets used.&lt;br /&gt;
&lt;br /&gt;
 Polygons ==&amp;gt; Shader ==&amp;gt; Image(s) + Processing =&amp;gt; Appearance&lt;br /&gt;
&lt;br /&gt;
Material definitions apply to a single &#039;texture&#039;, though it may be made up of multiple texture files blended together.  A simple material definition looks like this:&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
    qer_editorimage  textures/darkmod/custom/redbrick_ed&lt;br /&gt;
    diffusemap       textures/darkmod/custom/redbrick     &lt;br /&gt;
    bumpmap          textures/darkmod/custom/redbrick_local  &lt;br /&gt;
    specularmap      textures/darkmod/custom/redbrick_s     &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you&#039;re using the &#039;&#039;material&#039;&#039; called &#039;&#039;&#039;textures/darkmod/stone/brick/redbrick_with_mortar&#039;&#039;&#039; in your map, Doom looks up the name in the material definition and loads the according image files (as specified by the [[Map Expressions]]). Note that you &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; need to specify the file extension, the engine is automatically adding it (depending on your quality setting) and finds the according texture file. You also don&#039;t need to include the &#039;&#039;&#039;dds/&#039;&#039;&#039; prefix in the path, this is also added automatically.&lt;br /&gt;
&lt;br /&gt;
A single material file contains lots of material definitions. This is useful as textures that logically belong to each other are summarized in one material file (e.g. &#039;&#039;&#039;materials/tdm_stone_brick.mtr&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
The .mtr files are read upon launching Doom 3 - changing your material file therefore requires either restarting Doom or typing &#039;&#039;&#039;reloadDecls&#039;&#039;&#039; in the console.&lt;br /&gt;
&lt;br /&gt;
== Create a new Texture Definition ==&lt;br /&gt;
Provided you already saved your texture source file (the .tga or .dds) in the appropriate folder, you can go on and create your texture definition.  You cannot use your textures without this step.&lt;br /&gt;
&lt;br /&gt;
Open up or create your personal material file with a text editor.  There are existing guidelines for where texture definitions should go, for the sake of organization, but the engine doesn&#039;t care what the filename is as long as it&#039;s in the materials folder and has a .mtr extension.   &lt;br /&gt;
&lt;br /&gt;
First, specify the name of your new material. If it is not a model texture, then the name should include the path to the texture files used.  Example:&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Do not use special characters for your shader name or The Dark Mod parser might complain (e.g. no &amp;quot;&amp;amp;&amp;quot; (ampersand) or &amp;quot;-&amp;quot; (dash) characters, etc.)&lt;br /&gt;
&lt;br /&gt;
Then, open up a squiggly bracket ({), and start to fill in the texture paths as below, changing the paths and names for your texture.&lt;br /&gt;
&lt;br /&gt;
 textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
     qer_editorimage  textures/darkmod/stone/brick/redbrick_with_mortar_ed      // editor image&lt;br /&gt;
     diffusemap       textures/darkmod/stone/brick/redbrick_with_mortar         // diffuse map&lt;br /&gt;
     bumpmap           textures/darkmod/stone/brick/redbrick_with_mortar_local  // normal map&lt;br /&gt;
     specularmap      textures/darkmod/stone/brick/redbrick_with_mortar_s       // specular map&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Close the definition with a close squiggly bracket (}).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If there is no specular map then substitute &#039;&#039;&#039;_black&#039;&#039;&#039;, and if there is no bumpmap then use &#039;&#039;&#039;_flat&#039;&#039;&#039; instead.&lt;br /&gt;
&lt;br /&gt;
Save the file. Now you can load your new texture in [[DarkRadiant]] provided you did it all correctly.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can also have a look a the existing material files and learn from them.&lt;br /&gt;
&lt;br /&gt;
== Add the Ambient Light Stage ==&lt;br /&gt;
&lt;br /&gt;
This should go on all Dark Mod textures - see [[Virtual Ambient Light Textures]].&lt;br /&gt;
&lt;br /&gt;
{{infobox|Note: If there is no specular map then substitute &#039;&#039;&#039;_black&#039;&#039;&#039;, and if there is no bumpmap then use &#039;&#039;&#039;_flat&#039;&#039;&#039; instead.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        // TDM Ambient Method Related&lt;br /&gt;
        {&lt;br /&gt;
                if (global5 == 1)&lt;br /&gt;
                blend add&lt;br /&gt;
                map                             &amp;lt;mappath/name&amp;gt;&lt;br /&gt;
                scale                   1, 1&lt;br /&gt;
                red                             global2&lt;br /&gt;
                green                   global3&lt;br /&gt;
                blue                    global4&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add the Frob Highlight Stage ==&lt;br /&gt;
&lt;br /&gt;
All materials need to have a conditional shader stage added to let the material highlight when the objects are frobbed. The technical details are of minor interest here, just copy and paste such a stage from other materials and adjust the diffusemap and bumpmap references.&lt;br /&gt;
&lt;br /&gt;
== Full example ==&lt;br /&gt;
&lt;br /&gt;
Here is the full example with the final material definition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
 {&lt;br /&gt;
    // Use on of the predefined surface types like:&lt;br /&gt;
    // none, metal, stone, flesh, glass, wood&lt;br /&gt;
    stone&lt;br /&gt;
&lt;br /&gt;
    // Or use &amp;quot;surftype15&amp;quot; and add the surface type as the first (or only) word of the description,&lt;br /&gt;
    // the following are possible:&lt;br /&gt;
    // tile, carpet, dirt, gravle, grass, rock, twigs, foliage, sand, mud, brokeglass, snow, ice, squeakboard,&lt;br /&gt;
    // puddle, moss, cloth, ceramic, slate, straw, armor_leath, armor_chain, armor_plate, climbable, paper, hardwood&lt;br /&gt;
&lt;br /&gt;
    //surftype15&lt;br /&gt;
    //description &amp;quot;carpet This is a carpet texture.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    qer_editorimage  textures/darkmod/stone/brick/redbrick_with_mortar_ed&lt;br /&gt;
    bumpmap          textures/darkmod/stone/brick/redbrick_with_mortar_local&lt;br /&gt;
    diffusemap       textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
    specularmap      textures/darkmod/stone/brick/redbrick_with_mortar_s&lt;br /&gt;
 &lt;br /&gt;
    // This is the code required for frob highlighting this texture&lt;br /&gt;
    {&lt;br /&gt;
        if ( parm11 &amp;gt; 0 )&lt;br /&gt;
        blend       gl_dst_color, gl_one&lt;br /&gt;
        map         _white.tga&lt;br /&gt;
        rgb         0.40 * parm11&lt;br /&gt;
    }&lt;br /&gt;
    {&lt;br /&gt;
        if ( parm11 &amp;gt; 0 )&lt;br /&gt;
        blend       add&lt;br /&gt;
        map         textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
        rgb         0.15 * parm11&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
        // TDM Ambient Method Related&lt;br /&gt;
        {&lt;br /&gt;
                if (global5 == 1)&lt;br /&gt;
                blend add&lt;br /&gt;
                map                             textures/darkmod/stone/brick/redbrick_with_mortar&lt;br /&gt;
                scale                   1, 1&lt;br /&gt;
                red                             global2&lt;br /&gt;
                green                   global3&lt;br /&gt;
                blue                    global4&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AS OF TDM 2.0 the old Enhanced Ambient stage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
                if (global5 == 2)&lt;br /&gt;
                blend add&lt;br /&gt;
                program ambientEnvironment.vfp&lt;br /&gt;
                vertexParm              0               1, 1, 1, 1              // UV Scales for Diffuse and Bump&lt;br /&gt;
                vertexParm              1               1, 1, 1, 1              // (X,Y) UV Scale for specular&lt;br /&gt;
                vertexParm              2               global2, global3, global4, 1&lt;br /&gt;
&lt;br /&gt;
                fragmentMap             0               cubeMap env/gen1&lt;br /&gt;
                fragmentMap             1               textures/darkmod/stone/brick/redbrick_with_mortar_local                  // Bump&lt;br /&gt;
                fragmentMap             2               textures/darkmod/stone/brick/redbrick_with_mortar                        // Diffuse&lt;br /&gt;
                fragmentMap             3               _black                  // Specular&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is &#039;&#039;&#039;no longer needed&#039;&#039;&#039; as ambient rendering has it&#039;s own dedicated function in the renderer now.&lt;br /&gt;
&lt;br /&gt;
== Special Keywords ==&lt;br /&gt;
&lt;br /&gt;
There are also some special keywords you can use:&lt;br /&gt;
&lt;br /&gt;
* noshadows - surface does not cast a shadow&lt;br /&gt;
* noselfshadows - casts shadows, but not on itself&lt;br /&gt;
* translucent - for things like glass&lt;br /&gt;
* [[twosided]] - the surface will be duplicated and flipped, this causes it to be rendered twice. Useful for half-transparent things that should be visible from both sides. Normally surfaces are only visible from the front side (see note below)&lt;br /&gt;
* noFog - do not render fog on this surface&lt;br /&gt;
* Discrete - Dmap will not merge brushes with this material applied&lt;br /&gt;
* NoFragment - Dmap will not split brushes with the material applied&lt;br /&gt;
* nopicmip - The image_downsize settings will not affect this texture. Use sparingly, as low-end users need to use image_downsize to load larger maps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: &lt;br /&gt;
&lt;br /&gt;
http://www.iddevnet.com/doom3/materials.php&lt;br /&gt;
&lt;br /&gt;
twoSided	Draw the front and back. &#039;&#039;&#039;Implies no-shadows&#039;&#039;&#039;, because the shadow volume would be coplanar with the surface, giving depth fighting&lt;br /&gt;
&lt;br /&gt;
Use a nodraw surface with forceShadows to address this.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Texture Guidelines]]&lt;br /&gt;
* [[How to add Textures to The Dark Mod]]&lt;br /&gt;
* [[Texture Creation - Basic Tutorial]]&lt;br /&gt;
&lt;br /&gt;
{{tutorial-textures|sort=Material}}&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=DDS_creation&amp;diff=26627</id>
		<title>DDS creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=DDS_creation&amp;diff=26627"/>
		<updated>2020-08-19T19:55:42Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: /* Textures in TDM */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;AUGUST 2020 - REWRITE IN PROGRESS&#039;&#039;&lt;br /&gt;
&#039;&#039;All prior content here has been moved to new page [[DDS Creation with ATI Compressonator]].&lt;br /&gt;
&lt;br /&gt;
==Introduction to DDS==&lt;br /&gt;
&lt;br /&gt;
DDS (Direct Draw Surface) is an image format often used in games due to its significant advantages over other file types:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;No need for conversion during load&#039;&#039;&#039;: This is a target format in which textures are stored in your GPU memory. Other image types, like TGA, have to be converted during loading, and that makes the whole process longer.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Better image quality with mipmapping&#039;&#039;&#039;: Game engines use LOD systems to generate textures further away from the player, but (without mipmaps available) that results in blurred image and moire patterns. Mipmaps are scaled-down versions of your texture, stored within the same file as the full-scale texture. Mipmaps will improve image quality, the transition between LOD stages, and overall performance. More on mipmapping: https://en.wikipedia.org/wiki/Mipmap&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Very efficient compression&#039;&#039;&#039;: Depending on the DDS compression format, a typical results is around 25% of the original uncompressed file. For example, a 2048x2048 px RGB texture saved as uncompressed TGA will be around 12 MB. Save it as DDS, and you&#039;ll go below 3 MB. Other formats like PNG or Zip compression will give you around 9 MB.&lt;br /&gt;
&lt;br /&gt;
==Textures in TDM==&lt;br /&gt;
&lt;br /&gt;
TDM can handle textures in either TGA or DDS formats. For guidance in preparing compliant texture files, applicable to both formats, see:&lt;br /&gt;
* [[How_to_add_Textures_to_The_Dark_Mod]]&lt;br /&gt;
* [[Texture_Guidelines]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Folder structure in your FM&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
While all TGA files go to:&lt;br /&gt;
&lt;br /&gt;
     yourFmRootFolder/textures/&#039;&#039;[optional subfolder(s)]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
DDS files should go to:&lt;br /&gt;
&lt;br /&gt;
     yourFmRootFolder/&#039;&#039;&#039;dds&#039;&#039;&#039;/textures/&#039;&#039;[optional subfolder(s)]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In other words, you need to copy-paste your folder structure into the dds directory.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Priority&#039;&#039;&#039;: TDM gives DDS files higher priority than TGAs. If you have both for a given material, the engine will only load the DDS.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Leave Normal Maps as TGA&#039;&#039;&#039;: You can safely convert diffuse and specular textures to DDS. But normal (bump) maps are not images in the traditional sense; they&#039;re more like vector maps. Any lossy compression will always introduce some artifacts and otherwise damage that data. To be on the safe side, keep normal maps as TGAs.&lt;br /&gt;
&lt;br /&gt;
==DDS Creation, In General ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Compression Formats&#039;&#039;&#039;: DDS files can be compressed in different ways, depending on source image requirements. As a general rule, use -&lt;br /&gt;
* DXT1 compression with RGB images&lt;br /&gt;
* DXT5 for textures with alpha channel transparency&lt;br /&gt;
More info on compression formats: http://wiki.polycount.com/wiki/DXT&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mipmaping&#039;&#039;&#039;: Mipmap generation is mandatory in TDM. Otherwise DDS textures won&#039;t show in game and you&#039;ll get console errors.&lt;br /&gt;
&lt;br /&gt;
TIP: You can improve texture quality - at no additional performance cost - by using the best mipmaps scaling filter available in the DDS file export settings. Usually they&#039;re ordered from faster/low-quality to slower/high-quality.&lt;br /&gt;
&lt;br /&gt;
==DDS Creation with Specific Tools==&lt;br /&gt;
* [[DDS Creation with GIMP]]&lt;br /&gt;
* [[DDS Creation with ATI Compressonator]]&lt;br /&gt;
&lt;br /&gt;
==General Workflow Tips==&lt;br /&gt;
&lt;br /&gt;
* Convert to DDS only after you have finalized textures that make up your material. There are at least two reasons for that:&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;DDS format isn&#039;t suited for fast iteration&#039;&#039;&#039;: You have to restart the game and reload the map to see the any changes. With TGA files, you just need to use a refresh command to see your changes in an instant.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;DDS compression is lossy&#039;&#039;&#039;: While the compression ratio is pretty great, it slightly reduces image quality. You shouldn&#039;t work on DDS textures directly, as you&#039;ll decrease image quality with each save. Keep your source files and work on them instead, then export TGAs to DDS when you&#039;re happy with the final result.&lt;br /&gt;
&lt;br /&gt;
* Planning to revise and test your material&#039;s textures? Besides re-exporting the updated textures as TGA, be sure to delete its old DDS textures, that would have priority.&lt;br /&gt;
&lt;br /&gt;
==Testing Your DDS Texture==&lt;br /&gt;
Mipmapping is affected by in-game Anisotropic Filtering. Set it to x16 to ensure maximum image quality while testing your materials.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [http://wiki.polycount.com/wiki/DXT DDS compression formats]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Mipmap Mipmaps]&lt;br /&gt;
  &lt;br /&gt;
[[Category:Tutorial]]&lt;br /&gt;
[[Category:Textures]]&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Cube_maps&amp;diff=26340</id>
		<title>Cube maps</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Cube_maps&amp;diff=26340"/>
		<updated>2020-04-18T23:26:03Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Note from peter_spy:&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;This tutorial is largely outdated and needs substantial revision. E.g. you can add cubemap reflections to many more materials, from marble floors to metals. The shader code used here is also wrong as it doesn&#039;t use alpha stage for the cubemap. You will want to control the cubemap strength, typically via texture and alpha multiplier.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;written by angua&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- keywords: cubemap reflective specular --&amp;gt;&lt;br /&gt;
How to create a cube map (also called environmental map) of your environment using the envshot command in TDM.&lt;br /&gt;
&lt;br /&gt;
Cube maps can be used to fake reflections e.g on water and highly reflective tiles, etc. The advantage is that rendering is faster. &lt;br /&gt;
&lt;br /&gt;
You can also find more inflormation on Cube maps in the modwiki: [https://modwiki.dhewm3.org/Cube_maps Cube Maps]&lt;br /&gt;
&lt;br /&gt;
==Create your room==&lt;br /&gt;
Create the room you want to have your pseudo-reflective water in. Add all the large parts, but you can leave small details (and of course the AI) out. Your room might for example look like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Cube map empty.jpg|320px|Example room]]&lt;br /&gt;
&lt;br /&gt;
==Create your images==&lt;br /&gt;
* Set the screen resolution of TDM to 640 x 480. If you don&#039;t, parts of your images will be cut off and they will not fit together any more. You will have to restart TDM or use console command vid_restart for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
* Open your map in TDM and get to the position of your water (at the center of the water source, about surface level, you can use noclip if you can&#039;t get there by walking).&lt;br /&gt;
&lt;br /&gt;
* In the console, type&lt;br /&gt;
&lt;br /&gt;
 envshot [prefix] [size]&lt;br /&gt;
&lt;br /&gt;
[prefix] is how the images are going to be named. The size should be in powers of two. For example, your command could look like this:&lt;br /&gt;
&lt;br /&gt;
 envshot water_pool 512&lt;br /&gt;
 &lt;br /&gt;
Press enter, and you will see some flickering on the screen while your images are created, and a message in the console will appear saying &lt;br /&gt;
&lt;br /&gt;
 Wrote env/water_pool_nz.tga,etc.&lt;br /&gt;
&lt;br /&gt;
You might want to make a few more envshots at slightly different positions, so that you don&#039;t have to repeat the whole procedure if your images are not appropriate. The direction at which you are facing during the shots is not important.&lt;br /&gt;
&lt;br /&gt;
* You should now see six new images in your /env folder:&lt;br /&gt;
&lt;br /&gt;
 water_pool_nx.tga&lt;br /&gt;
 water_pool_ny.tga&lt;br /&gt;
 water_pool_nz.tga&lt;br /&gt;
 water_pool_px.tga&lt;br /&gt;
 water_pool_py.tga&lt;br /&gt;
 water_pool_pz.tga&lt;br /&gt;
&lt;br /&gt;
looking like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Cube map.jpg|320px|Cube map after shot]]&lt;br /&gt;
&lt;br /&gt;
You can of course also move them to a different folder if you want.&lt;br /&gt;
&lt;br /&gt;
==Edit your images==&lt;br /&gt;
:&#039;&#039;This section won&#039;t be necessary in TDM 2.04. The images will be named and oriented correctly.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you leave the images like this, they will not work ingame. You have to rename them and there is also some rotating and flipping required. (Note that this works for me if the reflecting surface is located at the bottom facing upwards, the required procedure might be different if the reflection is located at the walls or the ceiling).&lt;br /&gt;
&lt;br /&gt;
* Rename water_pool_nx to water_pool_back. Rotate it 90° counter clock wise and flip it horizontally. This is going to be located at the west.&lt;br /&gt;
* Rename water_pool_ny to water_pool_right. Flip it horizontally. This is going to be located at the south.&lt;br /&gt;
* Rename water_pool_nz to water_pool_down. You don&#039;t have to manipulate the direction here, since it is located at the bottom and will not be visible anyway.&lt;br /&gt;
* Rename water_pool_px to water_pool_forward. Rotate it 90° clock wise and flip it horizontally. This is going to be located at the east.&lt;br /&gt;
* Rename water_pool_py to water_pool_left. Rotate it 180° and flip it horizontally. This is going to be located at the north.&lt;br /&gt;
* Rename water_pool_pz to water_pool_up. Flip it horizontally and rotate it 90° counter clock wise.&lt;br /&gt;
&lt;br /&gt;
*Rename water_pool_nz to water_pool_down. You don&#039;t have to manipulate the direction here, since it is located at the bottom and will not be visible anyway.&lt;br /&gt;
&lt;br /&gt;
You should now have six files in your /env folder (or wherever you moved them) called&lt;br /&gt;
&lt;br /&gt;
 water_pool_back&lt;br /&gt;
 water_pool_right&lt;br /&gt;
 water_pool_down&lt;br /&gt;
 water_pool_forward&lt;br /&gt;
 water_pool_left&lt;br /&gt;
 water_pool_up&lt;br /&gt;
&lt;br /&gt;
looking like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Cube map processed.jpg|320px|Cube maps processed]]&lt;br /&gt;
&lt;br /&gt;
You can also add some blurryness if you want. That makes it less obvious that the reflection is faked by a static image.&lt;br /&gt;
&lt;br /&gt;
==Write a material shader==&lt;br /&gt;
Open an already existing material file or create a new one. Add the following shader:&lt;br /&gt;
&lt;br /&gt;
 textures/env/water_pool&lt;br /&gt;
 {&lt;br /&gt;
     qer_editorimage env/water_pool_up.tga&lt;br /&gt;
 &lt;br /&gt;
     noFragment&lt;br /&gt;
     noshadows&lt;br /&gt;
     noimpact&lt;br /&gt;
     nooverlays&lt;br /&gt;
     forceOpaque&lt;br /&gt;
     nonsolid&lt;br /&gt;
     &lt;br /&gt;
     {&lt;br /&gt;
   	forceHighQuality&lt;br /&gt;
 	blend add&lt;br /&gt;
 	cameraCubeMap env/water_pool&lt;br /&gt;
 	texgen reflect&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you have forceOpaque in your shader, the texture will be opaque and you will not be able to see the ground. If you leave it out, it will be semi-transparent and you can see the ground also.&lt;br /&gt;
If you moved the images to a different folder, make sure that the correct paths are entered at the qer_editorimage and the cameraCubemap lines. (The path entered in the name of the shader (before the { ) is for the folder the texture will appear in Darkradiant. It can be different from the path the images are in.)&lt;br /&gt;
&lt;br /&gt;
==Get your enviromental map ingame==&lt;br /&gt;
&lt;br /&gt;
* Open DarkRadiant (if you already have it open you might have to close and reopen it to be able to see the texture).&lt;br /&gt;
* Draw a brush that is going to be your water. Texture it with common/nodraw.&lt;br /&gt;
* Go to the media browser. You should find your texture in the /env folder. (If you wrote another path in the name of your shader, it will appear there.)&lt;br /&gt;
[[Image:Cubemap1.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
* Apply it to the top face of the water brush. You should now see the water_pool_up image as editor image (that&#039;s what the qer_editorimage line in the shader was for). Scale and position of the texture is not important.&lt;br /&gt;
&lt;br /&gt;
[[Image:Cubemap2.jpg|300px]]&lt;br /&gt;
* Convert the brush to a func_liquid. (You don&#039;t want to be able to walk on water, do you? That would happen if you didn&#039;t convert your brush.) For more detailed information on water creation, you can also look at the [[Swimmable Water]] tutorial.&lt;br /&gt;
&lt;br /&gt;
* you should now be able to see your water ingame. &lt;br /&gt;
&lt;br /&gt;
[[Image:Cubemap3.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
It will still look flat, like a mirror, and you will see that it is a static image (the torch is not flickering) so you might want to add a patch slightly above the water textured with, e.g. water_clear (or any other water texture that produces water waves).&lt;br /&gt;
&lt;br /&gt;
[[Image:Cubemap4.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Here you can see the same pool textured with true reflective water for comparison:&lt;br /&gt;
&lt;br /&gt;
[[Image:Cubemap5.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
You have to take into consideration that in contrast to a true reflection, the cube map texture will not react to changes in the environment. So if you for example put the torch out, it will still be lit in the cube map.&lt;br /&gt;
&lt;br /&gt;
[[Image:Cubemap6.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
So it would be more practical to have non-extinguishable lights and no large moveables near the water.&lt;br /&gt;
&lt;br /&gt;
{{tutorial-editing}}&lt;br /&gt;
[[Category:Skybox]]&lt;br /&gt;
[[Category:Mapping Tutorials]]&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Talk:Texture_Sources&amp;diff=26108</id>
		<title>Talk:Texture Sources</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Talk:Texture_Sources&amp;diff=26108"/>
		<updated>2020-01-29T10:24:07Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;PeterSpy:&#039;&#039;&#039; I think we should avoid putting similar sites with free CC0 PBR materials just for the sake of it. Their actual behavior should be checked as well.&lt;br /&gt;
For example, 3D Textures only has 1k textures and mixes lossy jpegs with pngs, Share Textures has annoying popup messages and lossy jpegs, etc.&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Talk:Texture_Sources&amp;diff=26107</id>
		<title>Talk:Texture Sources</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Talk:Texture_Sources&amp;diff=26107"/>
		<updated>2020-01-29T10:20:28Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: A suggestion, what to avoid&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I think we should avoid putting similar sites with free CC0 PBR materials just for the sake of it. Their actual behavior should be checked as well.&lt;br /&gt;
For example, 3D Textures only has 1k textures and mixes lossy jpegs with pngs, Share Textures has annoying popup messages and lossy jpegs, etc.&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Texture_Sources&amp;diff=25389</id>
		<title>Texture Sources</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Texture_Sources&amp;diff=25389"/>
		<updated>2019-05-15T15:50:40Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here is a list of sites where you can download some decent textures.&amp;lt;br /&amp;gt;Note that most textures available these days are procedurally generated and made for PBR materials. TDM uses a non-PBR engine (idtech4), so these textures typically require some work to make them look good in game. See [[Textures]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Free===&lt;br /&gt;
* [https://texturehaven.com/textures/ Texture Haven] – 1k to 8k textures, no signup required.&lt;br /&gt;
* [https://cc0textures.com/ CC0 Textures] – 2k to 8k textures and Substance files, no registration required.&lt;br /&gt;
&lt;br /&gt;
===Other sources===&lt;br /&gt;
* [https://www.poliigon.com/search?is_free=true Poliigon] – Textures, brushes, models, and HDRI maps, usually for architectural rendering. Only some of those are free. Textures from 1k to 8k. Requires login credentials.&lt;br /&gt;
* [https://quixel.com/megascans/library/free Quixel Megascans] – Textures and models, selected free assets. Signup required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please add to this list.&lt;br /&gt;
&lt;br /&gt;
{{textures}}&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Texture_Sources&amp;diff=25388</id>
		<title>Texture Sources</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Texture_Sources&amp;diff=25388"/>
		<updated>2019-05-15T15:45:18Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below is a list of sources from which good textures can be found. Note that most textures available these days are procedurally generated for PBR materials. TDM uses a non-PBR engine (idtech4), so these textures typically require some work to make them look good in game. See [[Textures]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Free===&lt;br /&gt;
* [https://texturehaven.com/textures/ Texture Haven] – 1k to 8k textures, no signup required.&lt;br /&gt;
* [https://cc0textures.com/ CC0 Textures] – 2k to 8k textures and Substance files, no registration required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Other sources===&lt;br /&gt;
* [https://www.poliigon.com/search?is_free=true Poliigon] – Textures, brushes, models, and HDRI maps, usually for architectural rendering. Only some of those are free. Textures from 1k to 8k. Requires login credentials.&lt;br /&gt;
* [https://quixel.com/megascans/library/free Quixel Megascans] – Textures and models, selected free assets. Signup required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please add to this list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{textures}}&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Texture_Sources&amp;diff=25387</id>
		<title>Texture Sources</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Texture_Sources&amp;diff=25387"/>
		<updated>2019-05-15T15:42:07Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below is a list of sources from which good textures can be found. These are not sites with ready built textures, there is some work to make them look good in TDM. See [[Textures]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Free===&lt;br /&gt;
* [https://texturehaven.com/textures/ Texture Haven] – 1k to 8k textures, no signup required.&lt;br /&gt;
* [https://cc0textures.com/ CC0 Textures] – 2k to 8k textures and Substance files, no registration required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Other sources===&lt;br /&gt;
* [https://www.poliigon.com/search?is_free=true Poliigon] – Textures, brushes, models, and HDRI maps, usually for architectural rendering. Only some of those are free. Textures from 1k to 8k. Requires login credentials.&lt;br /&gt;
* [https://quixel.com/megascans/library/free Quixel Megascans] – Textures and models, selected free assets. Signup required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please add to this list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{textures}}&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Texture_Sources&amp;diff=25386</id>
		<title>Texture Sources</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Texture_Sources&amp;diff=25386"/>
		<updated>2019-05-15T15:41:50Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below is a list of sources from which good textures can be found. These are not sites with ready built textures, there is some work to make them look good in TDM. See [[Textures]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Free===&lt;br /&gt;
* [https://texturehaven.com/textures/ Texture Haven] – 1k to 8k textures, no signup required.&lt;br /&gt;
* [https://cc0textures.com/ CC0 Textures] – 2k to 8k textures and Substance files, no registration required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Other sources===&lt;br /&gt;
* [https://www.poliigon.com/search?is_free=true Poliigon] – Textures, brushes, models, and HDRI maps, usually for architectural rendering. Only some of those are free. Textures from 1k to 8k. Requires login credentials.&lt;br /&gt;
* [https://quixel.com/megascans/library/free Quixel Megascans] – Textures and models, selected free assets. Signup required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please add to this list.&lt;br /&gt;
&lt;br /&gt;
{{textures}}&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Texture_Sources&amp;diff=25385</id>
		<title>Texture Sources</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Texture_Sources&amp;diff=25385"/>
		<updated>2019-05-15T15:39:59Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below is a list of sources from which good textures can be found. These are not sites with ready built textures, there is some work to make them look good in TDM. See [[Textures]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Free===&lt;br /&gt;
* [https://texturehaven.com/textures/ Texture Haven] – 1k to 8k textures, no signup required.&lt;br /&gt;
* [https://cc0textures.com/ CC0 Textures] – 2k to 8k textures and Substance files, no registration required.&lt;br /&gt;
&lt;br /&gt;
===Other sources===&lt;br /&gt;
* [https://www.poliigon.com/search?is_free=true Poliigon] – Textures, brushes, models, and HDRI maps, usually for architectural rendering. Only some of those are free. Textures from 1k to 8k. Requires login credentials.&lt;br /&gt;
* [https://quixel.com/megascans/library/free Quixel Megascans] – Textures and models, selected free assets. Signup required.&lt;br /&gt;
&lt;br /&gt;
Please add to this list.&lt;br /&gt;
&lt;br /&gt;
{{textures}}&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Texture_Sources&amp;diff=25384</id>
		<title>Texture Sources</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Texture_Sources&amp;diff=25384"/>
		<updated>2019-05-15T15:38:19Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: /* Other sources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below is a list of sources from which good textures can be found. These are not sites with ready built textures, there is some work to make them look good in TDM. See [[Textures]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Free===&lt;br /&gt;
* [https://texturehaven.com/textures/ Texture Haven] – 1k to 8k textures, no signup required.&lt;br /&gt;
* [https://cc0textures.com/ CC0 Textures] – 2k to 8k textures and Substance files, no registration required.&lt;br /&gt;
&lt;br /&gt;
===Other sources===&lt;br /&gt;
* [https://www.poliigon.com/search?is_free=true Poliigon] – Textures, brushes, models, and HDRI maps, usually for architectural rendering. Only some of those are free. Textures from 1k to 8k. Requires login credentials.&lt;br /&gt;
&lt;br /&gt;
Please add to this list.&lt;br /&gt;
&lt;br /&gt;
{{textures}}&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Texture_Sources&amp;diff=25383</id>
		<title>Texture Sources</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Texture_Sources&amp;diff=25383"/>
		<updated>2019-05-15T15:34:51Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: /* Free */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below is a list of sources from which good textures can be found. These are not sites with ready built textures, there is some work to make them look good in TDM. See [[Textures]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Free===&lt;br /&gt;
* [https://texturehaven.com/textures/ Texture Haven] – 1k to 8k textures, no signup required.&lt;br /&gt;
* [https://cc0textures.com/ CC0 Textures] – 2k to 8k textures and Substance files, no registration required.&lt;br /&gt;
&lt;br /&gt;
===Other sources===&lt;br /&gt;
* [https://www.poliigon.com/search?is_free=true Poliigon] – Some free content, requires login credentials.&lt;br /&gt;
&lt;br /&gt;
Please add to this list.&lt;br /&gt;
&lt;br /&gt;
{{textures}}&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Texture_Sources&amp;diff=25382</id>
		<title>Texture Sources</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Texture_Sources&amp;diff=25382"/>
		<updated>2019-05-15T15:33:16Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: /* Not completely free */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below is a list of sources from which good textures can be found. These are not sites with ready built textures, there is some work to make them look good in TDM. See [[Textures]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Free===&lt;br /&gt;
&lt;br /&gt;
* [https://texturehaven.com/textures/ Texture Haven] – All textures are free, no signup required.&lt;br /&gt;
* [https://cc0textures.com/ CC0 Textures] – Free textures only, no registration required.&lt;br /&gt;
&lt;br /&gt;
===Other sources===&lt;br /&gt;
* [https://www.poliigon.com/search?is_free=true Poliigon] – Some free content, requires login credentials.&lt;br /&gt;
&lt;br /&gt;
Please add to this list.&lt;br /&gt;
&lt;br /&gt;
{{textures}}&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Texture_Sources&amp;diff=25381</id>
		<title>Texture Sources</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Texture_Sources&amp;diff=25381"/>
		<updated>2019-05-15T15:31:43Z</updated>

		<summary type="html">&lt;p&gt;Peter spy: /* Free */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below is a list of sources from which good textures can be found. These are not sites with ready built textures, there is some work to make them look good in TDM. See [[Textures]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Free===&lt;br /&gt;
&lt;br /&gt;
* [https://texturehaven.com/textures/ Texture Haven] – All textures are free, no signup required.&lt;br /&gt;
* [https://cc0textures.com/ CC0 Textures] – Free textures only, no registration required.&lt;br /&gt;
&lt;br /&gt;
===Not completely free===&lt;br /&gt;
* [http://www.cgtextures.com/ CGTextures] - Good, well prepared.&lt;br /&gt;
&lt;br /&gt;
Please add to this list.&lt;br /&gt;
&lt;br /&gt;
{{textures}}&lt;/div&gt;</summary>
		<author><name>Peter spy</name></author>
	</entry>
</feed>